Deploy Your Chaincode
Lets look at our first chaincode application and deploy it to our basic-network.
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.
-
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. -
index.js
: This is used to expose the landrec chaincode module. -
docker-compose.yml
: This defines thefabric-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 fabric network components.
Get hands-on with 1400+ tech skills courses.