You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

1. Upload

POST api/v1/chaincodes

The front end will allow uploading a chaincode package, which is a .tar.gz format file.

Install a chaincode: peer lifecycle install

Body Parameters

Type

Note

namestringthe name of chaincode
chaincode_packagestringThe base64-encoded contexts of the chaincode package
chaincode_labelstring The label that will be used to identify the installed chaincode package
versionstring The version of the uploaded chaincode 
languagestringThe programming language 
description string (optional)
versionstring



2. Perform chaincode operations → Install, Approve (may by several orgs), Commit

POST api/v1/chaincodes/<chaincode_name>/?operaions=<install/approve/commit>

Query Parameters

Type

Note

operationsstringHLF lifecycle command that deploys, approves, and commits a chaincode with several organizations


Body Parameters

Type

Note

chaincode_labelstring(optional)The label that will be used to identify the installed chaincode package
package_id string(optional)The package id of the chaincode package that will be installed.
channel_idstring(optional)The channel on which this command should be executed.
versionstring (optional)the version of the chaincode definition to be approved
signature_policystring (optional)Use a policy inside the channel configuration as the chaincode endorsement policy.
peersstring array (optional)The array of the id of the peer nodes. For commit only


3. List chaincodes

Get api/v1/chaincodes

Get a list of uploaded chaincodes

Response Body  

Type

Note

namestringThe name of the chaincode.
chaincode_labelstringThe label that will be used to identify the installed chaincode package
versionstring the version of the chaincode definition to be approved
package_idstring the package id of installed package
languagestring the programming language of chaincode
descriptionstringa description of chaincode

3. Get a chaincode

Get api/v1/chaincodes/<chaincode_name>

Get a chaincodes 

Response Body 

Type

Note

namestringThe name of the chaincode.
chaincode_labelstringThe label that will be used to identify the installed chaincode package
versionstring the version of the chaincode definition to be approved
package_idstring the package id of installed package
package_idstringthe approval status 
organizationsstring array A list of orgs that installed the chaincode.
channelstringSelected channel for the  chaincode
  • No labels