Skip to content

0chain_build

hm90121 edited this page Jul 14, 2021 · 3 revisions

Initialize the Sharder and Miner directories

  1. Clone the 0chain repo
git clone https://github.com/0chain/0chain.git

‌2. Navigate to 0chain directory

cd 0chain
  1. 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

  1. Let's verify whether the directories exist by navigating to docker.local folder and running
ls 

‌The output should be similar to 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

Setup Network

Setup a network called testnet0 for each of these node containers to talk to each other.

Note: The config file should be providing the IP address of the nodes as per the IP addresses in this network.

./docker.local/bin/setup_network.sh

Build the miner and sharder containers

  1. First build the base containers using the script.(This may take few minutes)
./docker.local/bin/build.base.sh
  1. Build the sharder containers using
./docker.local/bin/build.sharders.sh
  1. Build the miner containers using
./docker.local/bin/build.miners.sh