0Chain
Search…
Getting Started
This section covers how to install and configure blobber. In order to use blobber functionality, you will need to join the 0chain network with the following prerequisites-

System requirements

To properly deploy blobber , you must have a virtual Machine .physical computer or cloud computing instance setup with the following requirements:‌
  • Linux with ubuntu 18.04 preferred
  • 4 vCPU, 8 Gb Memory at minimum
  • 30 GB of minimum space to store the initial container components. Expandable storage can be added later to provide services as a storage provider.

Required Software dependencies

Installing and running blobber requires deployment-specific dependencies to be preinstalled

Docker

Installing Docker will provide the ability to create containers for blobbers.
  1. 1.
    To install Docker on Ubuntu, log in as root user in the terminal window and enter the command:
1
sudo apt update
2
sudo apt install docker.io
Copied!
2.Start and enable docker by entering the following commands:
1
sudo systemctl start docker
2
sudo systemctl enable docker
Copied!
3.To verify the installed Docker version number, enter:
1
docker --version
Copied!
Successful Installation Output :
4. If you are not logged as a root user, add your Linux username{USER} to the docker group for running the docker commands as root.
4.1 Add the user to the docker group using
1
sudo usermod -aG docker ${USER}
Copied!
4.2 Apply permissions by typing the following:
1
su - ${USER}
Copied!
4.3Enter your Linux user’s password to continue and confirm that the user added to the docker group by typing:
1
id -nG
Copied!
4.4 In the output you will see your Linux username(ubuntu) added to the docker group like this

Docker Compose

  1. 1.
    Download the current docker-compose release using :
    1
    sudo curl -L "https://github.com/docker/compose/releases/download/1.29.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    Copied!
  2. 2.
    Provide execution permissions using
    1
    sudo chmod +x /usr/local/bin/docker-compose
    Copied!
  3. 3.
    Verify the installation with
1
docker-compose --version
Copied!
Output:

Clone the Blobber Repository

After installing Docker and Docker Compose
  1. 1.
    Clone the Blobber repository using the command
1
git clone https://github.com/0chain/blobber.git
Copied!
2. Change directory to blobber
1
cd blobber
Copied!
3. Use the following command for running shell script located in the sub directory to initialize blobber components
1
./docker.local/bin/blobber.init.setup.sh
Copied!

Create and Configure Containers for Blobbers

To create containers for blobbers and allow interaction between them. You need to create a network using docker which connects them with each other.
  1. 1.
    To set up a network, specify the network name(testnet0),subnet and gateway by using the below command.
1
$ docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0
Copied!
2. Set up the block_worker URL
A block worker URL is a field in the blobber/config/0chain_validator.yaml and0chain_blobber.yaml configuration files that require the URL of network you want to connect to.
Since we are connecting to the 0chain network, we will replace the default URL in blobber/config/0chain_validator.yaml and0chain_blobber.yaml with the below-mentioned URL.
1
block_worker: http://beta.0chain.net/dns
Copied!
3. Navigate to the config directory using
1
cd blobber/config
Copied!
You will see blobber and validation files listed
4. Use the nano editor to edit the block_worker field for both files using the command
1
sudo nano 0chain_blobber.yaml
Copied!
and
1
sudo nano 0chain_validator.yaml
Copied!
5. Navigate back to the blobber directory and modify the b0bnode1_keys.txt located in thedocker.local/keys_config by replacing localhost with public IP of your cloud VM/ instance.
1
nano /docker.local/keys_config/b0bnode1_keys.txt
Copied!
Sample Screenshot:
6. In the b0docker-compose.yml file located in thedocker.local directory, edit the command field in the blobber section, the command field will look like this :
Here replace the localhost with < public ip here > of instance /VM IP
Note: Step 5 and 6 is an optional step and is only required when you are setting up blobber on cloud computing instances. In case of a local blobber setup leave them as it is.

Build Blobbers

  1. 1.
    Now go back to the blobber directory and build containers using the below command
1
./docker.local/bin/build.base.sh
2
./docker.local/bin/build.blobber.sh
3
./docker.local/bin/build.validator.sh
Copied!
This would take few minutes to set up install dependencies.

Register a Wallet using zboxcli

  1. 1.
    Now clone the zbox CLI repository using the command
1
git clone https://github.com/0chain/zboxcli.git
Copied!
2.Install the zboxcli dependencies
GoLang Binaries
Use the Linux built-in Wget tool is used to fetch the golang archive from the google server using the command
1
wget https://dl.google.com/go/go1.13.linux-amd64.tar.gz
Copied!
The tar command is used to extract the group of files into a usr/local directory.
1
tar -C /usr/local -xzf go1.13.linux-amd64.tar.gz
Copied!
Path Variable is set to usr/local directory using
1
export PATH=$PATH:/usr/local/go/bin
Copied!
Build-Essential
The build**-**essential package is required to build and make Zbox application. It includes the necessary GCC/g++ compilers and other essential critical libraries and utilities.
Run apt update command to update the packages.
1
sudo apt update
Copied!
Get Build-essential package.
1
sudo apt-get install build-essential
Copied!
Once dependencies are installed navigate into zboxcli directory using
1
cd zboxcli
Copied!
3. Use the make install command to compile the source code.
1
make install
Copied!
This might take couple of minutes. Sample output after successful compiling:
3. Now Connect the Zbox to the 0Chain network Configuration for the 0chain network by default is stored in network/one.yaml file which we will copy to a new config.yaml file.
The config.yaml file and all the other Zbox component information will be stored in a new zcn folder located in home directory of file system.
4. Make a new zcn folder in home linux directory using
1
mkdir $HOME/.zcn
Copied!
.zcn is used to denote a hidden folder.
5. Copy the content from one.yaml to a new config.yaml file using
1
cp network/one.yaml $HOME/.zcn/config.yaml
Copied!
To verify whether the config.yaml exist and network configuration is stored properly. From the home directory navigate to zcn folder . You will see config.yaml listed.
6. Check the config file configuration using
1
nano config.yaml
Copied!
1
---
2
block_worker: https://beta.0chain.net/dns
3
signature_scheme: bls0chain
4
min_submit: 50
5
min_confirmation: 50
6
confirmation_chain_length: 3
7
max_txn_query: 5
8
query_sleep_time: 5
9
# # OPTIONAL - Uncomment to use/ Add more if you want
10
# preferred_blobbers:
11
# - http://one.devnet-0chain.net:31051
12
# - http://one.devnet-0chain.net:31052
13
# - http://one.devnet-0chain.net:31053
14
Copied!
According to the config mentioned in block worker field of your file, zbox will connect to desired 0chain network by default this would be https://one.devnet-0chain.net/` lets change it to http://beta.0chain.net/0dns .
7. Check whether Zbox is running by navigating back to zboxcli directory
1
cd zboxcli
Copied!
and type
1
./zbox
Copied!
On a successful run you will see a help section like this:
1
zbox is a decentralized storage application written on the 0Chain platform.
2
Complete documentation is available at https://docs.0chain.net/0chain/
3
4
Usage:
5
zbox [command]
6
7
Available Commands:
8
add-collab add collaborator for a file
9
alloc-cancel Cancel an allocation
10
alloc-fini Finalize an expired allocation
11
bl-info Get blobber info
12
bl-update Update blobber settings by its delegate_wallet owner
13
commit commit a file changes to chain
14
copy copy an object(file/folder) to another folder on blobbers
15
cp-info Challenge pool information.
16
delete delete file from blobbers
17
delete-collab delete collaborator for a file
18
download download file from blobbers
19
get Gets the allocation info
20
get-diff Get difference of local and allocation root
21
get-download-cost Get downloading cost
22
get-upload-cost Get uploading cost
23
getwallet Get wallet information
24
help Help about any command
25
list list files from blobbers
26
list-all list all files from blobbers
27
listallocations List allocations for the client
28
ls-blobbers Show active blobbers in storage SC.
29
meta get meta data of files from blobbers
30
move move an object(file/folder) to another folder on blobbers
31
newallocation Creates a new allocation
32
register Registers the wallet with the blockchain
33
rename rename an object(file/folder) on blobbers
34
rp-create Create read pool if missing
35
rp-info Read pool information.
36
rp-lock Lock some tokens in read pool.
37
rp-unlock Unlock some expired tokens in a read pool.
38
sc-config Show storage SC configuration.
39
share share files from blobbers
40
sign-data Sign given data
41
sp-info Stake pool information.
42
sp-lock Lock tokens lacking in stake pool.
43
sp-pay-interests Pay interests not payed yet.
44
sp-unlock Unlock tokens in stake pool.
45
sp-user-info Stake pool information for a user.
46
start-repair start repair file to blobbers
47
stats stats for file from blobbers
48
sync Sync files to/from blobbers
49
update update file to blobbers
50
update-attributes update object attributes on blobbers
51
updateallocation Updates allocation's expiry and size
52
upload upload file to blobbers
53
version Prints version information
54
wp-info Write pool information.
55
wp-lock Lock some tokens in write pool.
56
wp-unlock Unlock some expired tokens in a write pool.
57
58
Flags:
59
--config string config file (default is config.yaml)
60
--configDir string configuration directory (default is $HOME/.zcn)
61
-h, --help help for zbox
62
--network string network file to overwrite the network details (if required, default is network.yaml)
63
--silent Do not show interactive sdk logs (shown by default)
64
--wallet string wallet file (default is wallet.json)
65
--wallet_client_id string wallet client_id
66
--wallet_client_key string wallet client_key
67
68
Use "zbox [command] --help" for more information about a command.
Copied!
8. To register a wallet on Zbox to be used both by the blockchain and blobbers. Use the following Zbox command
1
./zbox register
Copied!
Successful Response:
1
Wallet Registered
Copied!
By default, the wallet information will be stored in wallet.json located in the .zcn folder of the Linux home directory. 9. Navigate back to the .zcn folder
1
cd $HOME/.zcn/
Copied!
10. Open the wallet.json file. It should be similar to the similar to the output below:
1
{"client_id":"4af719e1fdb6244159f17922382f162387bae3708250cab6bc1c20cd85fb594c",
2
"client_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c119",
3
"keys":[{"public_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c1>
4
"private_key":"542f6be49108f52203ce75222601397aad32e554451371581ba0eca56b093d19"}],
5
"mnemonics":"butter whisper wheat hope duck mention bird half wedding aim good regret maximum illegal much inch immune unlock resource congress drift>
6
"version":"1.0","date_created":"2021-09-09T20:22:56+05:30"}
Copied!
11. Copy the client_id value and paste it into blobbers and validators settings. These are found in blobber/config directory. Navigate to the config directory :
1
cd blobber/config
Copied!
You will see blobber and validation files listed
12. Open both the configuration files and edit the delegate_wallet value with client_id copied from wallet. Here is a sample configuration file below:
1
# [configurations above]
2
3
# for testing
4
# 500 MB - 536870912
5
# 1 GB - 1073741824
6
# 2 GB - 2147483648
7
# 3 GB - 3221225472
8
capacity: 1073741824 # 1 GB bytes total blobber capacity
9
read_price: 0.01 # token / GB for reading
10
write_price: 1.00 # token / GB for writing
11
# min_lock_demand is value in [0; 1] range; it represents number of tokens the
12
# blobber earned even if a user will not read or write something
13
# to an allocation; the number of tokens will be calculated by the following
14
# formula
15
#
16
# allocation_size * write_price * min_lock_demand
17
#
18
min_lock_demand: 0.1
19
# max_offer_duration restrict long contacts where,
20
# in the future, prices can be changed
21
max_offer_duration: 744h # 31 day
22
challenge_completion_time: 1m # 15m # duration to complete a challenge
23
24
# delegate wallet for all rewards, if it's empty, then blobber ID used
25
delegate_wallet: 'b145bf241eab00c9865a3551b18028a6d12b3ef84df8b4a5c317c8d184a82412'
Copied!

Run Blobbers

1. In blobber/docker.localdirectory there would be six blobbers created with different folder numbers. See the screenshot below:
2. Navigate to any of the blobber(for example blobber 2) directory using
1
cd blobber/docker.local/blobber2
Copied!
3. Run the blobber container using the below command
1
../bin/blobber.start_bls.sh
Copied!
Here is a sample output of blobber2 successfully running:
4. Now to check whether blobber is properly running by visit them at the following link localhost:blobber port number
For blobber 1 the port number is 5051 .In our case we started blobber2 so it would be 5052
Here is the sample output:
blobber running.png
blobber running.png
63KB
Image
5. You can repeat step 2 for start the other five blobbers .
6.Now to check whether blobbers has joined the 0chain network navigate to zboxcli directory and run the following command
1
./zbox ls-blobbers
Copied!
Sample Response:
1
- id: 0bf5ae461d6474ca1bebba028ea57d646043bbfb6a4188348fd649f0deec5df2
2
url: http://beta.0chain.net:31304
3
used / total capacity: 14.0 GiB / 100.0 GiB
4
last_health_check: 1635347306
5
terms:
6
read_price: 26.874 mZCN / GB
7
write_price: 26.874 mZCN / GB / time_unit
8
min_lock_demand: 0.1
9
cct: 2m0s
10
max_offer_duration: 744h0m0s
11
12
- id: 71ac0a40d18ee48f53e73189007ce2c1e8769993c7713aeef07640b53a60149f
13
url: http://beta.0chain.net:31302
14
used / total capacity: 12.7 GiB / 100.0 GiB
15
last_health_check: 1635347348
16
terms:
17
read_price: 26.865 mZCN / GB
18
write_price: 26.865 mZCN / GB / time_unit
19
min_lock_demand: 0.1
20
cct: 2m0s
21
max_offer_duration: 744h0m0s
22
- id: 7a90e6790bcd3d78422d7a230390edc102870fe58c15472073922024985b1c7d
23
url: http://198.18.0.92:5052
24
used / total capacity: 0 B / 1.0 GiB
25
last_health_check: 1635347427
26
terms:
27
read_price: 10.000 mZCN / GB
28
write_price: 100.000 mZCN / GB / time_unit
29
min_lock_demand: 0.1
30
cct: 2m0s
31
max_offer_duration: 744h0m0s
32
- id: f65af5d64000c7cd2883f4910eb69086f9d6e6635c744e62afcfab58b938ee25
33
url: http://198.18.0.91:5051
34
used / total capacity: 0 B / 1.0 GiB
35
last_health_check: 1635347950
36
terms:
37
read_price: 10.000 mZCN / GB
38
write_price: 100.000 mZCN / GB / time_unit
39
min_lock_demand: 0.1
40
cct: 2m0s
41
max_offer_duration: 744h0m0s
42
- id: f8dc4aaf3bb32ae0f4ed575dd6931a42b75e546e07cb37a6e1c6aaf1225891c5
43
url: http://beta.0chain.net:31305
44
used / total capacity: 13.3 GiB / 100.0 GiB
45
last_health_check: 1635347346
46
terms:
47
read_price: 26.874 mZCN / GB
48
write_price: 26.865 mZCN / GB / time_unit
49
min_lock_demand: 0.1
50
cct: 2m0s
51
max_offer_duration: 744h0m0s
Copied!
In the response you should see the locally running blobbers mentioned with their urls for example http://198.18.0.91:5051 and http://198.18.0.92:5052

💻 Troubleshooting

For support related to blobber installation check our community forum at [https://community.0chain.net/]
If you want to automate 0Chain deployment using Kubernetes please have a look at 0miner documentation here
You might also want to check our 0Chain blog here for additional information

Chat

Join our community chat directly on
Telegram
Twitter
Last modified 1mo ago