0Chain
Search…
Step 3: Initialize and Build the 0Chain components

Initialize the Sharder and Miner directories

1.Navigate to 0chain directory
cd 0chain
2.Run the init.setup.sh script located in the docker.local/bin directory using the command
./docker.local/bin/init.setup.sh
After running the script you will see the sharder and miner directories populated in docker.local folder
3.Lets verify whether the directories exist by navigating to docker.local folder and running
ls
The output should be like this:
bin build.sc_unit_test docker-clean miner5 sharder2
build.base build.sharder miner1 miner6 sharder3
build.genkeys build.test.multisigsc miner2 miner7
build.magicBlock build.unit_test miner3 miner8
build.miner config miner4 sharder1

Build the miner and sharder containers

Note: The build instructions mentioned below only works with Linux and Intel based Macs.To build base,miners and sharders on M1 mac run this script inside the 0chain/dev.local directory and follow the build instructions . 1.Navigate to 0chain directory
cd 0chain
2.First build the base containers using the script.(This may take few minutes)
./docker.local/bin/build.base.sh
Screenshot after successful build:
3.Build the sharder containers using
./docker.local/bin/build.sharders.sh
Screenshot of successful build:
Note: In-case you are getting mockery not found error when building sharders .Please first install Homebrew for Linux and Mac from here ,run brew install mockery command, and then run the sharder build script again. 4.Build the miner containers using
./docker.local/bin/build.miners.sh
Screenshot of a successful build

Initialize the blobber directories

1.Navigate to blobber directory
cd blobber
2.Run the init.setup.sh script located in the Docker.local/bin directory using the command
./docker.local/bin/blobber.init.setup.sh
After running the script you will see the blobber directories populated in docker.local folder
3.Let's verify whether the directories exist by navigating to docker.local folder and running
ls
The output should be like this:
b0docker-compose.yml blobber4 Dockerfile
bin blobber5 IntegrationTestsBlobberDockerfile
blobber1 blobber6 keys_config
blobber2 docker-clean p0docker-compose.yml
blobber3 docker-compose.yml ValidatorDockerfile

Build the blobber containers

1.Go back to blobber directory-path 2.Log in to your docker account using the command
docker login
3.Now run the following scripts located in the docker.local/bin directory .
./docker.local/bin/build.base.sh
./docker.local/bin/build.blobber.sh
./docker.local/bin/build.validator.sh
Note:The above build script does not work with M1 mac,to build blobbers on m1 mac follow instructions in this guide . Screenshot after a successful build

Copy link
On this page
Initialize the Sharder and Miner directories
Build the miner and sharder containers
Initialize the blobber directories
Build the blobber containers