Getting Started
This section covers how to install and configure blobber. In order to use blobber functionality, you will need to join the Züs network with the following prerequisites:
Storage : Required Free Space: 5 GB for blobber files and additional free storage space for renting it on Züs network.
RAM: 4GB Minimum
CPU: 4 Core CPU
OS: Linux (Ubuntu Preferred) Version: 20.04 and Above
Mac(Apple Silicon or Intel) Version: Big Sur and Above
Windows(Requires WSL ) Version: Windows 11 or 10 version 2004 and above
Installing and running blobber requires deployment-specific dependencies to be preinstalled
Docker is available for Linux, macOS and Windows platforms. Find instructions for the preferred operating system here.
After installing Docker and Docker Compose:
- 1.Clone the Blobber repository using the command
git clone https://github.com/0chain/blobber.git
2. Navigate into blobber directory
cd blobber
3. Inside blobber directory, run the commands below .The first command makes the shell script executable and while the next ones execute the shell script to create blobber directories.
chmod +x ./docker.local/bin/blobber.init.setup.sh
./docker.local/bin/blobber.init.setup.sh
NOTE: For Mac :
chmod +x ./docker.local/bin/blobber.init.setup-mac.sh
./docker.local/bin/blobber.init.setup-mac.sh
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.To set up a network, specify the network name(testnet0),subnet and gateway by using the below command.
docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0
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 network, we will replace the default URL in
blobber/config/0chain_validator.yaml
and0chain_blobber.yaml
with the below-mentioned URL.block_worker: http://demo.zus.network/dns
3. Navigate to the config directory using
cd blobber/config
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 :nano 0chain_blobber.yaml
and
nano 0chain_validator.yaml
Note: Step 5 and 6 is an optional step and only required when you are setting up blobber on cloud computing instances. In case of a local blobber setup leave them as it is.
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.nano /docker.local/keys_config/b0bnode1_keys.txt
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- 1.Now go back to the blobber directory and build containers using the below command
./docker.local/bin/build.base.sh
./docker.local/bin/build.blobber.sh
./docker.local/bin/build.validator.sh
This would take few minutes to set up install dependencies.
- 1.Now clone the zbox CLI repository using the command
git clone https://github.com/0chain/zboxcli.git
- 2.Install the zboxcli dependencies
Go installation instructions for different operating systems can be found here . Once dependencies are installed navigate into zboxcli directory using
cd zboxcli
3. Use the make install command to compile the source code.
make install
This might take couple of minutes. Sample output after successful compiling:
- 4.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 newconfig.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
mkdir $HOME/.zcn
.zcn
is used to denote a hidden folder.5. Copy the content from one.yaml to a new config.yaml file using
cp network/one.yaml $HOME/.zcn/config.yaml
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
nano config.yaml
---
block_worker: https://dev.0chain.net/dns
signature_scheme: bls0chain
min_submit: 50
min_confirmation: 50
confirmation_chain_length: 3
max_txn_query: 5
query_sleep_time: 5
# # OPTIONAL - Uncomment to use/ Add more if you want
# preferred_blobbers:
# - http://one.devnet-0chain.net:31051
# - http://one.devnet-0chain.net:31052
# - http://one.devnet-0chain.net:31053
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
cd zboxcli
and type
./zbox
On a successful run you will see a help section like this:
zbox is a decentralized storage application written on the 0Chain platform.
Complete documentation is available at https://docs.0chain.net/0chain/
Usage:
zbox [command]
Available Commands:
add-collab add collaborator for a file
alloc-cancel Cancel an allocation
alloc-fini Finalize an expired allocation
bl-info Get blobber info
bl-update Update blobber settings by its delegate_wallet owner
commit commit a file changes to chain
copy copy an object(file/folder) to another folder on blobbers
cp-info Challenge pool information.
delete delete file from blobbers
delete-collab delete collaborator for a file
download download file from blobbers
get Gets the allocation info
get-diff Get difference of local and allocation root
get-download-cost Get downloading cost
get-upload-cost Get uploading cost
getwallet Get wallet information
help Help about any command
list list files from blobbers
list-all list all files from blobbers
listallocations List allocations for the client
ls-blobbers Show active blobbers in storage SC.
meta get meta data of files from blobbers
move move an object(file/folder) to another folder on blobbers
newallocation Creates a new allocation
register Registers the wallet with the blockchain
rename rename an object(file/folder) on blobbers
rp-create Create read pool if missing
rp-info Read pool information.
rp-lock Lock some tokens in read pool.
rp-unlock Unlock some expired tokens in a read pool.
sc-config Show storage SC configuration.
share share files from blobbers
sign-data Sign given data
sp-info Stake pool information.
sp-lock Lock tokens lacking in stake pool.
sp-pay-interests Pay interests not payed yet.
sp-unlock Unlock tokens in stake pool.
sp-user-info Stake pool information for a user.
start-repair start repair file to blobbers
stats stats for file from blobbers
sync Sync files to/from blobbers
update update file to blobbers
update-attributes update object attributes on blobbers
updateallocation Updates allocation's expiry and size
upload upload file to blobbers
version Prints version information
wp-info Write pool information.
wp-lock Lock some tokens in write pool.
wp-unlock Unlock some expired tokens in a write pool.