Instantiate a Chaincode
post
/console/admin/api/v1.1/chaincodes/{chaincodeName}/instantiate
Instantiates a chaincode on a channel.
Request
Supported Media Types
- application/json
Path Parameters
-
chaincodeName: string
Name of the chaincode to instantiate.
Information about where and how to instantiate the chaincode.
Root Schema : instantiateChaincode
Type:
Show Source
object
-
args(optional):
array args
-
chaincodeType(optional):
string
Allowed Values:
[ "golang", "node", "java" ]
-
chaincodeVersion(optional):
string
-
channelName(optional):
string
-
dataCollectionConfig(optional):
array dataCollectionConfig
-
endorsementPolicy(optional):
object endorsementPolicy
-
peers(optional):
array peers
-
transientMap(optional):
object transientMap
-
upgrade(optional):
boolean
Example:
{
"channelName":"mychannel1",
"chaincodeVersion":"v1",
"transientMap":{
},
"endorsementPolicy":{
"identities":[
],
"policy":{
"0-of":[
]
}
},
"args":[
"a",
"100",
"b",
"200"
],
"dataCollectionConfig":{
"name":"",
"policy":"",
"requiredPeerCount":1,
"maxPeerCount":2,
"blockToLive":10
},
"chaincodeType":"golang",
"peers":[
{
"url":"grpcs://peer0.org1.example.com:7051"
}
]
}
Nested Schema : transientMap
Type:
object
Nested Schema : policy
Type:
object
Nested Schema : role
Type:
Show Source
object
-
mspId(optional):
string
-
name(optional):
string
Allowed Values:
[ "member", "admin", "peer" ]
Response
Supported Media Types
- application/json
200 Response
Instantiated chaincode successfully
202 Response
In Progress
400 Response
Invalid argument
401 Response
Unauthorized
403 Response
Forbidden
500 Response
Internal Server Error
Default Response
Unexpected error