Step 1 :
Download the Docker image
Step 1.1 :
Copy to the home folder and load the docker by running the following command
sudo docker load --input multichaindocker
Step 1.2 :
Run the following command to check installed image.
sudo docker images
Note : This docker image has the following things installed.
pip wget multichain [link](http://www.multichain.com/download-install/) Savoir [link](https://github.com/DXMarkets/Savoir) Pubnub==3.8.3 [link](https://www.pubnub.com/docs/python/pubnub-python-sdk) logging git
Step 2 :
Open three terminals and run the docker image in three terminals.
Note : Decide the terminals with the names
example : container 1 - farmland container 2 - warehouse container 3 - retailstore
Step 3 :
Run cd in each container.
Step 4 :
Clone the blockchain_agri_usecase repository in three containers.
Step 5 :
Choose the farmland contianer as the admin by starting the chain in the farmland container
Step 5.1 :
Run the command "multichain-util create chain1" in the farmland container.
multichain-util create chain1
Step 5.2 :
Run the command "multichaind chain1 -daemon"
multichaind chain1 -daemon
Step 6 :
Connect to the chain from the other(warehouse,retailstore) containers.
Step 6.1 :
Copy the command that given when you started the chain in farmland.
Step 6.2 :
Run that command in other contatiners.
Step 7 :
Now we have to give permissions for the other containers.
Step 7.1 :
Copy the line that you got in the above operation.
Step 7.2 :
Paste it in the admin(farmland) container and add two more permissions
1) issue 2) mine
and run the command
Step 7.3 :
Please follow the same procedure to give permissions for the retailstore container.
Now permissions are granted for the warehouse and retailstore containers.
Step 8 :
Now we have to start the chain from the warehouse and retailstore containers.
multichaind chain1 -daemon
Step 9 :
Next have to give permission for the burnaddress of the chain.
Step 9.1 :
Run the following command to get the info about the chain.
multichain-cli chain1 getinfo
Step 9.2 :
Copy the burnaddress
Step 9.3 :
Grant receive permission to the burn address by running following command.
multichain-cli chain1 grant <copied burnaddress> receive.
Step 10 :
Now goto the repository root folder and run the following get.sh to get the values for rpcuser,rpcport,rpcpassword
Note : Run this program in three containers and save those values.
Run the following command sh get.sh 1.rpcuser 2.rpcport 3.rpcpassword
Step 11 :
Now goto the respective folders in the container.
container 1 - Farmland folder container 2 - Warehouse folder container 3 - Retailstore folder
Step 11.1 :
Open the config.ini program in each container and paste those copied values from the step 10, and save.
Step 12 :
Now the run the programs in three containers.
container1 - python farmland.py container2 - python warehouse.py container3 - python retailstore.py