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

Initialize the Sharder and Miner directories

1.Navigate to 0chain directory
1
cd 0chain
Copied!
2.Run the init.setup.sh script located in the docker.local/bin directory using the command
1
./docker.local/bin/init.setup.sh
Copied!
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
1
ls
Copied!
The output should be like this:
1
bin build.sc_unit_test docker-clean miner5 sharder2
2
build.base build.sharder miner1 miner6 sharder3
3
build.genkeys build.test.multisigsc miner2 miner7
4
build.magicBlock build.unit_test miner3 miner8
5
build.miner config miner4 sharder1
Copied!

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
1
cd 0chain
Copied!
2.First build the base containers using the script.(This may take few minutes)
1
./docker.local/bin/build.base.sh
Copied!
Screenshot after successful build:
3.Build the sharder containers using
1
./docker.local/bin/build.sharders.sh
Copied!
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
1
./docker.local/bin/build.miners.sh
Copied!
Screenshot of a successful build

Initialize the blobber directories

1.Navigate to blobber directory
1
cd blobber
Copied!
2.Run the init.setup.sh script located in the Docker.local/bin directory using the command
1
./docker.local/bin/blobber.init.setup.sh
Copied!
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
1
ls
Copied!
The output should be like this:
1
b0docker-compose.yml blobber4 Dockerfile
2
bin blobber5 IntegrationTestsBlobberDockerfile
3
blobber1 blobber6 keys_config
4
blobber2 docker-clean p0docker-compose.yml
5
blobber3 docker-compose.yml ValidatorDockerfile
Copied!

Build the blobber containers

1.Go back to blobber directory-path 2.Log in to your docker account using the command
1
docker login
Copied!
3.Now run the following scripts located in the docker.local/bin directory .
1
./docker.local/bin/build.base.sh
2
./docker.local/bin/build.blobber.sh
3
./docker.local/bin/build.validator.sh
Copied!
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