Install a Chaincode
post
/console/admin/api/v1.1/chaincodes
Installs a chaincode on a specified peer. The chaincode must be BASE64 encoded zip file.
Request
Supported Media Types
- application/json
Root Schema : installChaincode
Type:
Show Source
object
-
chaincodeId(optional):
string
-
chaincodeVersion(optional):
string
-
peers(optional):
array peers
-
source(optional):
object source
Example:
{
"source":{
"fileName":"example_cc",
"content":"example chaincode code (BASE64 encoded)"
},
"chaincodeId":"exampleChaincodeId",
"chaincodeVersion":"v1",
"peers":[
{
"url":"grpcs://peer0.org1.example.com:7051"
}
]
}
Nested Schema : source
Type:
Show Source
object
-
content(optional):
string
The content should be a base64-encoded string of chaincode, which could be a source file or zip package
-
fileName(optional):
string
Response
Supported Media Types
- application/json
200 Response
Installed chaincode successfully
400 Response
Invalid arguments
401 Response
Unauthorized
403 Response
Forbidden
500 Response
Internal Server Error
Default Response
Unexpected error