Search⌘ K

Deploy Your Chaincode

Explore the complete process of deploying chaincode on a Hyperledger Fabric blockchain. Learn to organize your chaincode folder, bring up the network, install and instantiate the chaincode, and test its invocation using command-line tools. This lesson prepares you to manage smart contracts and ensures secure transactions on the blockchain.

Folder Structure for Chaincode Folder #


Please note that infra-basic-network has all the stuff we used earlier to bring up a network. We will use the same network now and deploy our landrec chaincode on it.

Now lets look at important files inside the chaincode folder.

  1. lib/landrec.js: This contains the chaincode logic which reads and writes values to key value-based data store (state db). This defines valid transactions on the ledger.

  2. index.js: This is used to expose the landrec chaincode module.

  3. docker-compose.yml: This defines the fabric-tools container from which we will deploy our chaincode. This container will access the chaincode as mounted volume and will connect to same docker network as our ...