Hyperledger Fabric network setup for the workshop
Make sure you have the correct proxy settings in your machine
##Steps to download the setup
- Goto your home directory
cd $HOME
- Create the nework direcory
mkdir -p projects/cartrack/network
- Change directory to the network directory
cd $HOME/projects/cartrack/network
- Clone the repository
git clone https://github.com/suddutt1/workshopnetwork.git . # Do not miss the DOT(.) at the end of the command
Blockchain network setup
All the commands must be executed from $HOME/projects/cartrack/network directory.
========First time setup instructions ( START)=============
First time setup. Run the following commands
- Download the binaries
. ./downloadbin.sh
- To Generate the cryto config and other configurations
. ./generateartifacts.sh
- Create the chain code directiory.
mkdir -p chaincode/github.com/ctrack
- Copy the chain code files in the chaincode/github.com/ctrack ( Assumption : chaincode is avalable under $GOPATH/src/github.com/blockchain)
./copycc.sh
- Start the netowrk
. setenv.sh
docker-compose up -d
- Build and join channel. Make sure that network is running
docker exec -it cli bash -e ./buildandjoinchannel.sh
- Install and intantiate the chain codes
docker exec -it cli bash -e ./ctrack_install.sh
========First time setup instructions ( END)=============
========When chain code is modified ( START)=============
To update the chain code , first update the chain code source files in the above mentioned directory.Then run the following commands as appropriate
docker exec -it cli bash -e ./ctrack_update.sh <version>
========When chain code is modified ( END)=============
========To bring up an existing network ( START)=============
. setenv.sh
docker-compose up -d
========To bring up an existing network ( END)=============
========To destory an existing network ( START)=============
. setenv.sh
docker-compose down
If you are stoping a network using the above commands,to start the network again , you have to execute steps 2,5,6,7 of the first time setup.