1. Install
POST api/v1/chaincodeschaincode/install
The front end will allow uploading a chaincode package, which is a .tar.gz format file.
Install a chaincode: peer lifecycle install
Questions?:
After the chaincode is installed, do we need to expose the package identifier to the clients?
Body Parameters | Type | Note | ||
---|---|---|---|---|
peers | stringarray | the version of the chaincode | ||
Peers | array | an array of peer nodes | ||
Chaincode File | string | Package | ||
The array of names of the peer nodes where the chaincode package will be installed. | ||||
chaincode_package | string | The base64-encoded contexts of the chaincode package | ||
chaincode_label | string | The label that will be used to identify the installed chaincode package | ||
chaincode_type | string (optional) | The type of chaincode language (e.g. "golang") | Description | string |
2. Deploy a Chaincode → Approve (may by several orgs), Commit
POST api/v1/chaincodes/<chaincode_name>/channels?operaions=<commit/approve>
Query Parameters | Type | Note |
---|---|---|
operations | string | HLF lifecycle command that deploys, approves, and commits a chaincode with several organizations |
Body Parameters | Type | Note | |||
---|---|---|---|---|---|
Namechaincode_label | stringChannel | The label that will be used to identify the installed chaincode package | |||
package_id | string | name The package id of the chaincode package that will be installed. | |||
channel | Chaincode Version | string_id | string | The channel on which this command should be executed. | |
version | string | the version of the chaincode | |||
Initialization Function | string | Chaincode function that will be invoked | |||
definition to be approved | |||||
signature-policy | array | Use a policy inside the channel configuration as the chaincode endorsement policy. | |||
peer | array | The array of id of the peer nodes. For commit only | Organizations | array | an array of endorsing organization ids |
3. Upgrade
PUT api/v1/chaincodes/<chaincode_name>
Update a channel
Body Parameters | Type | Note | |||
---|---|---|---|---|---|
Namechannel_id | stringChannel | The channel on which this command should be executed. | |||
chaincode_label | string | The label that will be used to identify the installed chaincode package | |||
version | string | name of the channel | Chaincode Version | string | the version of chain code |
Organizations | array | an array of organization ids | |||
Language | string | ? | |||
Chaincode File | string | ? | |||
the chaincode definition to be approved | |||||
constructor_message | string | The constructor message for the chaincode is in JSON format. | |||
policy | string | The endorsement policy associated with this chaincode | Description | string