From 332d97b98c005812e3b1f8ae4e6ca9d0ed240602 Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Mon, 20 Nov 2023 00:26:49 +0530 Subject: [PATCH 1/7] blobber cleanup --- README.md | 59 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index a7d5ac0c5..0c9c331ec 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Other apps are [Bolt](https://bolt.holdings/), a wallet that is very secure with - 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 + - Windows Version: Windows 11 or 10 version 2004 and later requires WSL2. Instructions for installing WSL can be found [here](https://learn.microsoft.com/en-us/windows/wsl/install). - Docker is available for Linux, macOS and Windows platforms. Find instructions for the preferred operating system [here](https://docs.docker.com/engine/install/#supported-platforms). ### Directory Setup for Blobbers @@ -107,20 +107,20 @@ DOCKER_BUILD=build ./docker.local/bin/build.validator.sh. ``` -5. Now create a wallet using zwalletcli and install zboxcli to perform storage operations on blobbers.Instructions for [creating wallet](https://github.com/0chain/zwalletcli#creating-wallet---any-command) and installing zboxcli are available [here](https://github.com/0chain/zboxcli#installation-guides) +5. Begin by installing [zwalletcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) , [configure network](https://github.com/0chain/zwalletcli/wiki/Configure-network) and then proceed to install [zboxcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) for performing storage operations on blobbers. Detailed instructions for creating a wallet using zwalletcli can be found [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). -6. Once the wallet is created, the wallet information will be stored in wallet.json located in the .zcn folder of the Linux home directory. Now navigate to the .zcn folder (this is created during zbox build) +6. Once the wallet is created, the wallet information will be stored in `wallet.json` located in the .zcn folder of the linux or mac `$HOME` directory. Now navigate to the .zcn folder ``` cd $HOME/.zcn/ ``` -7. Open the wallet.json file. It should be similar to the similar to the output below: +7. Open the wallet.json file. It should be similar to the output below: ``` {"client_id":"4af719e1fdb6244159f17922382f162387bae3708250cab6bc1c20cd85fb594c", "client_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c119","keys":[{"public_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c1> "private_key":"542f6be49108f52203ce75222601397aad32e554451371581ba0eca56b093d19"}],"mnemonics":"butter whisper wheat hope duck mention bird half wedding aim good regret maximum illegal much inch immune unlock resource congress drift> "version":"1.0","date_created":"2021-09-09T20:22:56+05:30"} ``` -8. Copy the client_id value and paste it into blobbers and validators settings. The files can be found in `blobber/config` directory. +8. Copy the client_id value and paste it into blobbers and validators settings. These files can be found in `blobber/config` directory. 9. Open both the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` and edit the `delegate_wallet` value with your `client_id` value. @@ -136,9 +136,30 @@ cd $HOME/.zcn/ ``` **_Note: Replace the localhost form `docker.local/p0docker-compose.yml` to your public IP if you are trying to connect to another network ._** -If you are facing `insufficient balance to pay fee` errors when starting blobbers, you can turn -off fees in [0chain.yaml.server_chain.smart_contract.miner](https://github.com/0chain/0chain/blob/3c38dfd0920675d86876a5b8895272cb66ded9ad/docker.local/config/0chain.yaml#LL96C3-L96C16) -by adjusting true to false. +If you are facing `insufficient balance to pay fee` errors when starting blobbers, you can turn off fees in [0chain.yaml.server_chain.smart_contract.miner](https://github.com/0chain/0chain/blob/3c38dfd0920675d86876a5b8895272cb66ded9ad/docker.local/config/0chain.yaml#LL96C3-L96C16) by adjusting true to false. + + + 11. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, follow the guide below to get tokens: + +- [Get Tokens](https://github.com/0chain/zwalletcli#getting-tokens-with-faucet-smart-contract---faucet) + + 12. Then create new allocation using the command below: + +``` +./zbox newallocation --lock 0.5 +``` +Note: If unable to create new allocations as shown below. + +``` +./zbox newallocation --lock 0.5 +Error creating allocation: transaction_not_found: Transaction was not found on any of the sharders +``` + +To fix this issue you must lock some tokens on the blobber.Get the local blobber id using the `./zbox ls-blobbers` and use the following command + +``` +./zbox sp-lock --blobber_id $BLOBBER_ID --tokens 1 +``` ## Troubleshooting @@ -150,7 +171,7 @@ docker ps ``` This should display the container image blobber_blobber and should have the ports mapped like "0.0.0.0:5050->5050/tcp" -2. Now check whether the blobber has registered to the blockchain by running the following zbox command +2. To check whether the blobber has registered to the blockchain by running the following zbox command ``` ./zbox ls-blobbers @@ -160,7 +181,7 @@ In the response you should see the local blobbers mentioned with their urls for Sample Response: ``` - id: 0bf5ae461d6474ca1bebba028ea57d646043bbfb6a4188348fd649f0deec5df2 - url: http://beta.0chain.net:31304 + url: http://demo.zus.network:31304 used / total capacity: 14.0 GiB / 100.0 GiB last_health_check: 1635347306 terms: @@ -190,7 +211,7 @@ Sample Response: cct: 2m0s max_offer_duration: 744h0m0s - id: f8dc4aaf3bb32ae0f4ed575dd6931a42b75e546e07cb37a6e1c6aaf1225891c5 - url: http://beta.0chain.net:31305 + url: http://demo.zus.network:31305 used / total capacity: 13.3 GiB / 100.0 GiB last_health_check: 1635347346 terms: @@ -205,24 +226,8 @@ Note: When starting multiple blobbers, it could happen that blobbers are not bei Blobber registration takes some time and adding at least 5 second wait before starting the next blobber usually avoids the issue. -3. Now you can create allocations on blobber and store files. - -Note: If unable to create new allocations as shown below. - -``` -./zbox newallocation --lock 0.5 -Error creating allocation: transaction_not_found: Transaction was not found on any of the sharders -``` - -To fix this issue you must lock some tokens on the blobber.Get the local blobber id using the `./zbox ls-blobbers` and use the following command - -``` -zbox sp-lock --blobber_id f65af5d64000c7cd2883f4910eb69086f9d6e6635c744e62afcfab58b938ee25 --tokens 0.5 -``` - ## Connect to other network - - Your network connection depends on the block_worker url you give in the `config/0chain_blobber/validator.yaml` and `0chain_blobber.yaml` config file. ``` From 3cd2b557b44c9557760af22af8e82e66fffe815e Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Mon, 20 Nov 2023 03:24:21 +0530 Subject: [PATCH 2/7] additions --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0c9c331ec..87bde5666 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # Blobber - A storage provider in Züs network -This readme provides instructions on how to setup and register blobber to the Züs network . +A blobber serves as a storage provider within the Züs network, comprising decentralized servers scattered across the globe, all interconnected to the Züs network to cater to our users' storage requirements.This readme provides instructions on how to setup and register blobber to the Züs network . ## Table of Contents @@ -47,12 +47,14 @@ Other apps are [Bolt](https://bolt.holdings/), a wallet that is very secure with - Mac(Apple Silicon or Intel) Version: Big Sur and Above - Windows Version: Windows 11 or 10 version 2004 and later requires WSL2. Instructions for installing WSL can be found [here](https://learn.microsoft.com/en-us/windows/wsl/install). - Docker is available for Linux, macOS and Windows platforms. Find instructions for the preferred operating system [here](https://docs.docker.com/engine/install/#supported-platforms). + - Setting up Docker Desktop for Windows with WSL 2 (Windows Subsystem for Linux, version 2) requires additional steps. Instructions can be found [here](https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers). ### Directory Setup for Blobbers -1. Clone the Blobber repository using the command +1. Clone the Blobber repository and navigate to blobber directory. ``` git clone https://github.com/0chain/blobber.git +cd blobber ``` 2. In the git/blobber run the following command @@ -72,17 +74,19 @@ chmod +x ./docker.local/bin/blobber.init.setup-mac.sh ``` docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0 ``` -Note: Run all scripts as sudo +Note: Run all scripts as sudo . 2. Set up the block_worker URL -A block worker URL is a field in the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` configuration files that require the URL of blockchain network you want to connect to. For testing purposes we will connect to the beta 0chain network and replace the default URL in blobber/config/0chain_validator.yaml and 0chain_blobber.yaml with the below-mentioned URL. +A block worker URL is a field in the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` configuration files that require the URL of blockchain network you want to connect to. For testing purposes we will connect to the demo Züs network and replace the default URL in blobber/config/0chain_validator.yaml and 0chain_blobber.yaml with the below-mentioned URL. ``` block_worker: https://demo.zus.network/dns ``` +**Note:** Change the default value of block_worker field with the following: `http://198.18.0.98:9091/` for the local testnet. + ### Building on standard hardware -3. Go back to the blobber directory and build blobber containers using the scripts below +3. Go back to the blobber directory and build blobber containers using the scripts below: ``` ./docker.local/bin/build.base.sh ./docker.local/bin/build.blobber.sh @@ -107,7 +111,7 @@ DOCKER_BUILD=build ./docker.local/bin/build.validator.sh. ``` -5. Begin by installing [zwalletcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) , [configure network](https://github.com/0chain/zwalletcli/wiki/Configure-network) and then proceed to install [zboxcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) for performing storage operations on blobbers. Detailed instructions for creating a wallet using zwalletcli can be found [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). +5. Begin by creating wallet by installing [zwalletcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) , [configure network](https://github.com/0chain/zwalletcli/wiki/Configure-network) and then proceed to install [zboxcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) for performing storage operations on blobbers. Detailed instructions for creating a wallet using zwalletcli can be found [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). 6. Once the wallet is created, the wallet information will be stored in `wallet.json` located in the .zcn folder of the linux or mac `$HOME` directory. Now navigate to the .zcn folder ``` @@ -138,8 +142,7 @@ cd $HOME/.zcn/ If you are facing `insufficient balance to pay fee` errors when starting blobbers, you can turn off fees in [0chain.yaml.server_chain.smart_contract.miner](https://github.com/0chain/0chain/blob/3c38dfd0920675d86876a5b8895272cb66ded9ad/docker.local/config/0chain.yaml#LL96C3-L96C16) by adjusting true to false. - - 11. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, follow the guide below to get tokens: + 11. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, follow the guide below to get tokens into wallet using zwalletcli: - [Get Tokens](https://github.com/0chain/zwalletcli#getting-tokens-with-faucet-smart-contract---faucet) From bb6c3b314bd0508acccb1c47dde3e8ff37ae48cd Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:11:09 +0530 Subject: [PATCH 3/7] add links to standalone guides --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 87bde5666..3aa2eb17e 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,8 @@ Other apps are [Bolt](https://bolt.holdings/), a wallet that is very secure with - Linux (Ubuntu Preferred) Version: 20.04 and Above - Mac(Apple Silicon or Intel) Version: Big Sur and Above - - Windows Version: Windows 11 or 10 version 2004 and later requires WSL2. Instructions for installing WSL can be found [here](https://learn.microsoft.com/en-us/windows/wsl/install). - - Docker is available for Linux, macOS and Windows platforms. Find instructions for the preferred operating system [here](https://docs.docker.com/engine/install/#supported-platforms). - - Setting up Docker Desktop for Windows with WSL 2 (Windows Subsystem for Linux, version 2) requires additional steps. Instructions can be found [here](https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers). + - Windows Version: Windows 11 or 10 version 2004 and later requires WSL2. Instructions for installing WSL with docker can be found [here](https://github.com/0chain/0chain/blob/hm90121-patch-1/standalone_guides.md#install-wsl-with-docker). + - Docker is required to run blobber containers. Instructions for installing Docker can be found [here](https://github.com/0chain/0chain/blob/hm90121-patch-1/standalone_guides.md#install-docker-desktop). ### Directory Setup for Blobbers From 8d5dc3ad79eefee0f1d231141492c30a13994beb Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Fri, 24 Nov 2023 15:49:40 +0530 Subject: [PATCH 4/7] fixes --- README.md | 74 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 3aa2eb17e..9972bfb42 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ A blobber serves as a storage provider within the Züs network, comprising decen - [Directory Setup for Blobbers](#directory-setup-for-blobbers) - [Building and Starting the Blobber](#building-and-starting-the-nodes) - [Building on Standard Hardware](#building-on-standard-hardware) - - [Building on apple silicon](#building-on-apple-silicon) + - [Building on apple silicon](#building-on-apple-silicon) +- [Creating Allocation on Blobbers](#creating-allocation-on-blobbers) - [Connect to other network](#connect-to-other-network) - [Miscellaneous](#miscellaneous) - [Cleanup](#cleanup) @@ -68,16 +69,17 @@ chmod +x ./docker.local/bin/blobber.init.setup-mac.sh ``` ## Building and Starting the Nodes -1. Setup a network called testnet0 for each of these node containers to talk to each other. +1. In case network is not configured setup a network called testnet0 for each of these node containers to talk to each other. ``` docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0 ``` -Note: Run all scripts as sudo . +Note: Run all scripts as sudo. 2. Set up the block_worker URL A block worker URL is a field in the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` configuration files that require the URL of blockchain network you want to connect to. For testing purposes we will connect to the demo Züs network and replace the default URL in blobber/config/0chain_validator.yaml and 0chain_blobber.yaml with the below-mentioned URL. + ``` block_worker: https://demo.zus.network/dns ``` @@ -85,49 +87,63 @@ block_worker: https://demo.zus.network/dns ### Building on standard hardware -3. Go back to the blobber directory and build blobber containers using the scripts below: +3. Go back to the blobber directory in terminal(`cd blobber`) and build blobber containers using the scripts below: + ``` ./docker.local/bin/build.base.sh ./docker.local/bin/build.blobber.sh ./docker.local/bin/build.validator.sh ``` -Note: Run all scripts as sudo. -This would take few minutes. +Note: Run all scripts as sudo. This would take few minutes. ### Building on apple silicon -Sometimes in Apple Silicon devices (m1/m2 macbooks), buildx will not work for build scripts. To force a regular blobber build, run the following instead of the build commands mentioned above: -``` -DOCKER_BUILD=build ./docker.local/bin/build.base.sh -DOCKER_BUILD=build ./docker.local/bin/build.blobber.sh -DOCKER_BUILD=build ./docker.local/bin/build.validator.sh. -``` +4. Sometimes in Apple Silicon devices (m1/m2 macbooks), build might fail using the scripts above. To force a regular blobber build, run the scripts above in Rosetta from Terminal on apple silicon devices. To open the Terminal on a Mac with Apple Silicon (M1 or later) under Rosetta, you can do so by following these steps: -4. To link to local gosdk so that the changes are reflected on the blobber build please use the below command(optional) + 4.1) Click on the Finder icon in your dock, or open a new Finder window. -``` -./docker.local/bin/build.blobber.dev.sh + 4.2) Navigate to the "Applications" folder. You can usually find this on the left sidebar of a Finder window. -``` + 4.3) Open the "Utilities" folder within "Applications." + + 4.4) Look for the "Terminal" application. Right-Click Terminal > Get Info > Check Open using Rosetta. + + 4.5) Double-click on the Terminal application to open it under Rosetta. -5. Begin by creating wallet by installing [zwalletcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) , [configure network](https://github.com/0chain/zwalletcli/wiki/Configure-network) and then proceed to install [zboxcli](https://github.com/0chain/zwalletcli/wiki/Install-zwalletcli) for performing storage operations on blobbers. Detailed instructions for creating a wallet using zwalletcli can be found [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). + 4.6) Now to go to blobber directory and build blobber containers use the commands below: -6. Once the wallet is created, the wallet information will be stored in `wallet.json` located in the .zcn folder of the linux or mac `$HOME` directory. Now navigate to the .zcn folder + ``` + cd blobber + ./docker.local/bin/build.base.sh + ./docker.local/bin/build.blobber.sh + ./docker.local/bin/build.validator.sh + ``` + 4.7) To link to local gosdk so that the changes are reflected on the blobber build please use the below command(optional) + + ``` + ./docker.local/bin/build.blobber.dev.sh + ``` + +5. Now install [zwalletcli](https://github.com/0chain/zwalletcli/tree/digismash-patch-2#1-installation), then proceed to configure the network as outlined [here](https://github.com/0chain/zwalletcli/tree/digismash-patch-2#2-configure-network), and create a wallet using zwalletcli as detailed [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). + +6. Next, install zboxcli to execute storage operations on blobber. Detailed instructions for installation can be found [here](https://github.com/0chain/zboxcli/tree/hm90121-patch-1-1#1-installation). + +7. Once the wallet is created, the wallet information will be stored in `wallet.json` located in the .zcn folder of the linux or mac `$HOME` directory. Now navigate to the .zcn folder ``` cd $HOME/.zcn/ ``` -7. Open the wallet.json file. It should be similar to the output below: +8. Open the wallet.json file. It should be similar to the output below: ``` {"client_id":"4af719e1fdb6244159f17922382f162387bae3708250cab6bc1c20cd85fb594c", "client_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c119","keys":[{"public_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c1> "private_key":"542f6be49108f52203ce75222601397aad32e554451371581ba0eca56b093d19"}],"mnemonics":"butter whisper wheat hope duck mention bird half wedding aim good regret maximum illegal much inch immune unlock resource congress drift> "version":"1.0","date_created":"2021-09-09T20:22:56+05:30"} ``` -8. Copy the client_id value and paste it into blobbers and validators settings. These files can be found in `blobber/config` directory. +9. Copy the client_id value and paste it into blobbers and validators settings. These files can be found in `blobber/config` directory. -9. Open both the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` and edit the `delegate_wallet` value with your `client_id` value. +10. Open both the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` and edit the `delegate_wallet` value with your `client_id` value. -10. Now run the blobbers by navigating into blobber directories for Blobber1 (git/blobber/docker.local/blobber1) and run the container using +11. Now run the blobbers by navigating into blobber directories for Blobber1 (git/blobber/docker.local/blobber1) and run the container using ``` # For locally build images @@ -141,27 +157,33 @@ cd $HOME/.zcn/ If you are facing `insufficient balance to pay fee` errors when starting blobbers, you can turn off fees in [0chain.yaml.server_chain.smart_contract.miner](https://github.com/0chain/0chain/blob/3c38dfd0920675d86876a5b8895272cb66ded9ad/docker.local/config/0chain.yaml#LL96C3-L96C16) by adjusting true to false. - 11. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, follow the guide below to get tokens into wallet using zwalletcli: +## Creating Allocation on Blobbers + +1. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, follow the guide below to get tokens into wallet using zwalletcli: - [Get Tokens](https://github.com/0chain/zwalletcli#getting-tokens-with-faucet-smart-contract---faucet) - 12. Then create new allocation using the command below: + 2. Then open zbox in another terminal tab and create new allocation using the command below: ``` ./zbox newallocation --lock 0.5 ``` +Now, you have the capability to store files in allocated space and execute a variety of operations using zboxcli. For a comprehensive list of commands and their respective functionalities, please refer to the documentation [here](https://github.com/0chain/zboxcli/tree/hm90121-patch-1-1#commands-table). + Note: If unable to create new allocations as shown below. ``` ./zbox newallocation --lock 0.5 Error creating allocation: transaction_not_found: Transaction was not found on any of the sharders ``` - -To fix this issue you must lock some tokens on the blobber.Get the local blobber id using the `./zbox ls-blobbers` and use the following command +To fix this issue you must lock some tokens on the blobber stake pool. Get the blobber id using the `./zbox ls-blobbers` and use the command below to lock tokens into stake pool. ``` ./zbox sp-lock --blobber_id $BLOBBER_ID --tokens 1 ``` +Note: At least have 1 ZCN token balance in your wallet before locking tokens into stake pool.To know how to get tokens check [Get Tokens](https://github.com/0chain/zwalletcli#getting-tokens-with-faucet-smart-contract---faucet). + +Still facing any issues refer to troubleshooting section [here](#troubleshooting). ## Troubleshooting From a713ca217c4c92274f7f8f6f50e1b5a036cb2ef9 Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:59:55 +0530 Subject: [PATCH 5/7] minor additions --- README.md | 54 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9972bfb42..5cc141139 100644 --- a/README.md +++ b/README.md @@ -51,18 +51,18 @@ Other apps are [Bolt](https://bolt.holdings/), a wallet that is very secure with ### Directory Setup for Blobbers -1. Clone the Blobber repository and navigate to blobber directory. +1. Clone the Blobber repository and go to blobber directory. ``` git clone https://github.com/0chain/blobber.git cd blobber ``` -2. In the git/blobber run the following command +2. In the blobber directory run the following command for linux/wsl : ``` chmod +x ./docker.local/bin/blobber.init.setup.sh ./docker.local/bin/blobber.init.setup.sh ``` -**NOTE**: For mac user please run below: +**NOTE**: For mac user please run the command below: ``` chmod +x ./docker.local/bin/blobber.init.setup-mac.sh ./docker.local/bin/blobber.init.setup-mac.sh @@ -87,7 +87,7 @@ block_worker: https://demo.zus.network/dns ### Building on standard hardware -3. Go back to the blobber directory in terminal(`cd blobber`) and build blobber containers using the scripts below: +3. Go back to the blobber directory in terminal(`cd -`) and build blobber containers using the scripts below: ``` ./docker.local/bin/build.base.sh @@ -100,17 +100,17 @@ Note: Run all scripts as sudo. This would take few minutes. 4. Sometimes in Apple Silicon devices (m1/m2 macbooks), build might fail using the scripts above. To force a regular blobber build, run the scripts above in Rosetta from Terminal on apple silicon devices. To open the Terminal on a Mac with Apple Silicon (M1 or later) under Rosetta, you can do so by following these steps: - 4.1) Click on the Finder icon in your dock, or open a new Finder window. + - 4.1) Click on the Finder icon in your dock, or open a new Finder window. - 4.2) Navigate to the "Applications" folder. You can usually find this on the left sidebar of a Finder window. + - 4.2) Navigate to the "Applications" folder. You can usually find this on the left sidebar of a Finder window. - 4.3) Open the "Utilities" folder within "Applications." + - 4.3) Open the "Utilities" folder within "Applications." - 4.4) Look for the "Terminal" application. Right-Click Terminal > Get Info > Check Open using Rosetta. + - 4.4) Look for the "Terminal" application. Right-Click Terminal > Get Info > Check Open using Rosetta. - 4.5) Double-click on the Terminal application to open it under Rosetta. + - 4.5) Double-click on the Terminal application to open it under Rosetta. - 4.6) Now to go to blobber directory and build blobber containers use the commands below: + - 4.6) Now to go to blobber directory and build blobber containers use the commands below: ``` cd blobber @@ -118,7 +118,7 @@ Note: Run all scripts as sudo. This would take few minutes. ./docker.local/bin/build.blobber.sh ./docker.local/bin/build.validator.sh ``` - 4.7) To link to local gosdk so that the changes are reflected on the blobber build please use the below command(optional) + - 4.7) To link to local gosdk so that the changes are reflected on the blobber build please use the below command(optional) ``` ./docker.local/bin/build.blobber.dev.sh @@ -159,16 +159,38 @@ If you are facing `insufficient balance to pay fee` errors when starting blobber ## Creating Allocation on Blobbers -1. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, follow the guide below to get tokens into wallet using zwalletcli: +1. Now you can create allocations on blobber and store files. For creating allocations you need tokens into your wallet, Running the command below in zwallet will give 1 token to wallet. -- [Get Tokens](https://github.com/0chain/zwalletcli#getting-tokens-with-faucet-smart-contract---faucet) +```sh +./zwallet faucet --methodName pour --input "need token" +``` + +You can specify the number of tokens required using the following command for adding 5 tokens: + +```sh +./zwallet faucet --methodName pour --input "need token" --tokens 5 +``` + +Sample output from `faucet` prints the transaction. + +``` +Execute faucet smart contract success with txn: d25acd4a339f38a9ce4d1fa91b287302fab713ef4385522e16d18fd147b2ebaf +``` +To check wallet balance run `./zwallet getbalance` command + +Response: +``` +Balance: 5 ZCN (4.2299999999999995 USD) +``` - 2. Then open zbox in another terminal tab and create new allocation using the command below: + 2. Then open zbox in another terminal window and create new allocation using the command below: ``` ./zbox newallocation --lock 0.5 ``` -Now, you have the capability to store files in allocated space and execute a variety of operations using zboxcli. For a comprehensive list of commands and their respective functionalities, please refer to the documentation [here](https://github.com/0chain/zboxcli/tree/hm90121-patch-1-1#commands-table). +Note: Atleast have 1 ZCN balance in your wallet before running the command above. + +Now, you can store files in allocated space and execute a variety of operations using zboxcli. For a comprehensive list of zbox commands and their respective functionalities, please refer to the documentation [here](https://github.com/0chain/zboxcli/tree/hm90121-patch-1-1#commands-table). Note: If unable to create new allocations as shown below. @@ -181,7 +203,7 @@ To fix this issue you must lock some tokens on the blobber stake pool. Get the b ``` ./zbox sp-lock --blobber_id $BLOBBER_ID --tokens 1 ``` -Note: At least have 1 ZCN token balance in your wallet before locking tokens into stake pool.To know how to get tokens check [Get Tokens](https://github.com/0chain/zwalletcli#getting-tokens-with-faucet-smart-contract---faucet). +Note: At least have 1 ZCN token balance in your wallet before locking tokens into stake pool. Still facing any issues refer to troubleshooting section [here](#troubleshooting). From 0e4694a0b550881746f04e9d4d27722ae88b7a87 Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Fri, 24 Nov 2023 18:01:30 +0530 Subject: [PATCH 6/7] sudo fix for directories setup --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cc141139..c209e49a1 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,12 @@ cd blobber ``` chmod +x ./docker.local/bin/blobber.init.setup.sh -./docker.local/bin/blobber.init.setup.sh +sudo ./docker.local/bin/blobber.init.setup.sh ``` **NOTE**: For mac user please run the command below: ``` chmod +x ./docker.local/bin/blobber.init.setup-mac.sh -./docker.local/bin/blobber.init.setup-mac.sh +sudo ./docker.local/bin/blobber.init.setup-mac.sh ``` ## Building and Starting the Nodes From 3df2130331e1a9d7ac9254c774bdccc22d4bf571 Mon Sep 17 00:00:00 2001 From: Harshit Mehndiratta <65766301+hm90121@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:41:41 +0530 Subject: [PATCH 7/7] typos --- README.md | 73 +++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index c209e49a1..20796eaf7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # Blobber - A storage provider in Züs network -A blobber serves as a storage provider within the Züs network, comprising decentralized servers scattered across the globe, all interconnected to the Züs network to cater to our users' storage requirements.This readme provides instructions on how to setup and register blobber to the Züs network . +A blobber serves as a storage provider within the Züs network, comprising decentralized servers scattered across the globe, all interconnected to the Züs network to cater to our users storage requirements. This readme provides instructions on how to setup and register blobber to the Züs network. ## Table of Contents @@ -71,14 +71,14 @@ sudo ./docker.local/bin/blobber.init.setup-mac.sh 1. In case network is not configured setup a network called testnet0 for each of these node containers to talk to each other. - ``` +``` docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0 ``` Note: Run all scripts as sudo. 2. Set up the block_worker URL -A block worker URL is a field in the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` configuration files that require the URL of blockchain network you want to connect to. For testing purposes we will connect to the demo Züs network and replace the default URL in blobber/config/0chain_validator.yaml and 0chain_blobber.yaml with the below-mentioned URL. +A block worker URL is a field in the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` configuration files that require the URL of blockchain network you want to connect to. For testing purposes we will connect to the demo Züs network and replace the default URL in `blobber/config/0chain_validator.yaml` and `0chain_blobber.yaml` with the below-mentioned URL. ``` block_worker: https://demo.zus.network/dns @@ -98,19 +98,25 @@ Note: Run all scripts as sudo. This would take few minutes. ### Building on apple silicon -4. Sometimes in Apple Silicon devices (m1/m2 macbooks), build might fail using the scripts above. To force a regular blobber build, run the scripts above in Rosetta from Terminal on apple silicon devices. To open the Terminal on a Mac with Apple Silicon (M1 or later) under Rosetta, you can do so by following these steps: - - - 4.1) Click on the Finder icon in your dock, or open a new Finder window. - - - 4.2) Navigate to the "Applications" folder. You can usually find this on the left sidebar of a Finder window. - - - 4.3) Open the "Utilities" folder within "Applications." +4. Sometimes in Apple Silicon devices (m1/m2 macbooks), build might fail using the scripts above. To force a regular blobber build, run the following instead of the build commands mentioned above: +``` +DOCKER_BUILD=build ./docker.local/bin/build.base.sh +DOCKER_BUILD=build ./docker.local/bin/build.blobber.sh +DOCKER_BUILD=build ./docker.local/bin/build.validator.sh. +``` +If the above doesnot work you can follow steps below: - - 4.4) Look for the "Terminal" application. Right-Click Terminal > Get Info > Check Open using Rosetta. + - Click on the Finder icon in your dock, or open a new Finder window. - - 4.5) Double-click on the Terminal application to open it under Rosetta. + - Navigate to the "Applications" folder. You can usually find this on the left sidebar of a Finder window. - - 4.6) Now to go to blobber directory and build blobber containers use the commands below: + - Open the "Utilities" folder within "Applications." + + - Look for the "Terminal" application. Right-Click Terminal > Get Info > Check Open using Rosetta. + + - Double-click on the Terminal application to open it under Rosetta. + + - Now to go to blobber directory and build blobber containers using the commands below: ``` cd blobber @@ -118,32 +124,31 @@ Note: Run all scripts as sudo. This would take few minutes. ./docker.local/bin/build.blobber.sh ./docker.local/bin/build.validator.sh ``` - - 4.7) To link to local gosdk so that the changes are reflected on the blobber build please use the below command(optional) - - ``` - ./docker.local/bin/build.blobber.dev.sh - ``` -5. Now install [zwalletcli](https://github.com/0chain/zwalletcli/tree/digismash-patch-2#1-installation), then proceed to configure the network as outlined [here](https://github.com/0chain/zwalletcli/tree/digismash-patch-2#2-configure-network), and create a wallet using zwalletcli as detailed [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). +5. To link to local gosdk so that the changes are reflected on the blobber build please use the command(optional) +``` + ./docker.local/bin/build.blobber.dev.sh +``` +6. Now install [zwalletcli](https://github.com/0chain/zwalletcli/tree/digismash-patch-2#1-installation), then proceed to configure the network as outlined [here](https://github.com/0chain/zwalletcli/tree/digismash-patch-2#2-configure-network), and create a wallet using zwalletcli as detailed [here](https://github.com/0chain/zwalletcli#creating-wallet---any-command). -6. Next, install zboxcli to execute storage operations on blobber. Detailed instructions for installation can be found [here](https://github.com/0chain/zboxcli/tree/hm90121-patch-1-1#1-installation). +7. Next, install zboxcli to execute storage operations on blobber. Detailed instructions for installation can be found [here](https://github.com/0chain/zboxcli/tree/hm90121-patch-1-1#1-installation). -7. Once the wallet is created, the wallet information will be stored in `wallet.json` located in the .zcn folder of the linux or mac `$HOME` directory. Now navigate to the .zcn folder +8. Once the wallet is created, the wallet information will be stored in `wallet.json` located in the .zcn folder of the linux or mac `$HOME` directory. Now navigate to the .zcn folder ``` cd $HOME/.zcn/ ``` -8. Open the wallet.json file. It should be similar to the output below: +9. Open the wallet.json file. It should be similar to the output below: ``` {"client_id":"4af719e1fdb6244159f17922382f162387bae3708250cab6bc1c20cd85fb594c", "client_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c119","keys":[{"public_key":"da1769bd0203b9c84dc19846ed94155b58d1ffeb3bbe35d38db5bf2fddf5a91c91b22bc7c89dd87e1f1fecbb17ef0db93517dd3886a64274997ea46824d2c1> "private_key":"542f6be49108f52203ce75222601397aad32e554451371581ba0eca56b093d19"}],"mnemonics":"butter whisper wheat hope duck mention bird half wedding aim good regret maximum illegal much inch immune unlock resource congress drift> "version":"1.0","date_created":"2021-09-09T20:22:56+05:30"} ``` -9. Copy the client_id value and paste it into blobbers and validators settings. These files can be found in `blobber/config` directory. +10. Copy the client_id value and paste it into blobbers and validators settings. These files can be found in `blobber/config` directory. -10. Open both the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` and edit the `delegate_wallet` value with your `client_id` value. +11. Open both the `blobber/config/0chain_validator.yaml` and `blobber/config/0chain_blobber.yaml` and edit the `delegate_wallet` value with your `client_id` value. -11. Now run the blobbers by navigating into blobber directories for Blobber1 (git/blobber/docker.local/blobber1) and run the container using +12. Now run the blobbers by navigating into blobber directories for Blobber1 (`cd blobber/docker.local/blobber1`) and run the containers using ``` # For locally build images @@ -151,8 +156,10 @@ cd $HOME/.zcn/ # For remote images ../bin/p0blobber.start.sh - ``` + +Note: Run atleast 4 blobbers for a minimal working setup. For running more blobbers repeat the process in more blobber directories (blobber/docker.local/blobber|i)(blobber1/2/3 etc.). + **_Note: Replace the localhost form `docker.local/p0docker-compose.yml` to your public IP if you are trying to connect to another network ._** If you are facing `insufficient balance to pay fee` errors when starting blobbers, you can turn off fees in [0chain.yaml.server_chain.smart_contract.miner](https://github.com/0chain/0chain/blob/3c38dfd0920675d86876a5b8895272cb66ded9ad/docker.local/config/0chain.yaml#LL96C3-L96C16) by adjusting true to false. @@ -299,41 +306,27 @@ block_worker: https://demo.zus.network/dns 1. Get rid of old unused docker resources: - - ``` docker system prune ``` - 2. To get rid of all the docker resources and start afresh: - - ``` - docker system prune -a - ``` - 3. Stop All Containers - ``` - docker stop $(docker ps -a -q) ``` - - 4. Remove All Containers - - ``` docker rm $(docker ps -a -q)