This post is part of the ‘DL Fabric Gateway™ User Guide’ originally published as
DL Fabric Gateway™ — User Guide
DL Fabric Gateway™ is a platform intended to facilitate the deployment and execution of chaincode on Hyperledger Fabric…
This post continues our ongoing discussion regarding instantiating chaincode on DL Fabric Gateway™.
Instantiating Chaincode on DL Fabric Gateway™
Instantiating chaincode is another way of saying “deploy”. This will allow anyone on the channel to invoke (call functions from) your chaincode.
IMPORTANT — In order to instantiate chaincode, a channel and installed chaincode is required. If you are following this guide in sequence, you should have already done both.
Instantiate chaincode on DL Fabric Gateway™ using the fab_instantiateChaincode API:
Open a Command Line Interface (CLI) of your choice (Terminal, cmd, etc.)
Copy and paste the following API Call into your CLI of choice, and tap “enter” on your keyboard
curl -X POST \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: AUTH_TOKEN_HERE’ \
“userName” : “email@example.com”,
“chaincodeName” : “YourChaincodeName”,
“chaincodeType” : “golang”,
“args” : ,
“functionName” : “”,
YourChaincodeName is the name of a previously installed chaincode, args are the arguments for the Init function in the chaincode (in the Fab Car example, no arguments are required), the functionName defaults to the Init function, but can be overridden to accept a different function, and the channelName represents the channel on which the chaincode will be instantiated.
Which will return a success response:
“status” : “success”,
“message” : “Successfully instantiated chaincode.”