Install a Chaincode
post
/console/admin/api/v2/chaincodes
Installs a chaincode. The chaincode must be BASE64 encoded zip file of source code, or a BASE64 encoded TAR.GZ of packaged chaincode (new in Oracle Blockchain Platform 22.2.1).
Request
Supported Media Types
- application/json
Root Schema : installChaincode
Type:
Show Source
object
-
label:
string
Required when the value of 'source.content' represents the chaincode source (.zip). Not allowed when 'source.isPackaged' is true.
-
peers(required):
array peers
-
source(required):
object source
-
type:
string
Allowed Values:
[ "golang", "node", "java" ]
Required when the value of 'source.content' represents the chaincode source (.zip). Not allowed when 'source.isPackaged' is true.
Example:
{
"source":{
"fileName":"example_cc",
"content":"example chaincode code"
},
"label":"example",
"type":"golang",
"peers":[
{
"url":"grpcs://peer0.org1.example.com:7051"
}
]
}
Nested Schema : source
Type:
Show Source
object
-
content(required):
string
The content should be base64 encoded string of chaincode source (.zip) or chaincode package (tar.gz).
-
fileName(required):
string
-
isPackaged:
boolean
True, if the value of 'source.content' represents chaincode package (tar.gz), or false, if it represents chaincode source (.zip).
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