Commit a Chaincode Definition in a Channel

post

/console/admin/api/v2/channels/{channelName}/chaincodeDefinitions/commit

Commit a chaincode definition in a channel. The new chaincode lifecycle in Hyperledger Fabric 2.x involves approving and committing the chaincode during the deployment. The chaincode definition needs to be approved by a sufficient number of organizations to satisfy the channel's LifecycleEndorsement policy before the chaincode can be committed on the channel.

Request

Supported Media Types
Path Parameters
Body ()
Details about the chaincode definition to be committed
Root Schema : CommitCCReq
Type: object
Show Source
Example:
{
    "chaincodeName":"myCC1",
    "chaincodeVersion":"v1",
    "chaincodeInitRequired":false,
    "endorsementPolicy":{
        "type":"signature-policy",
        "policy":"OR('org1.member')"
    },
    "dataCollectionConfig":[
        {
            "name":"test",
            "policy":"OR('org1.member')",
            "requiredPeerCount":1,
            "maxPeerCount":2,
            "blockToLive":10,
            "memberOnlyRead":true,
            "memberOnlyWrite":true,
            "endorsementPolicy":{
                "signaturePolicy":"OutOf(1,'org1.member')"
            }
        }
    ]
}
Nested Schema : dataCollectionConfig
Type: array
Show Source
Nested Schema : endorsementPolicy
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : endorsementPolicy
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Success
Body ()
Root Schema : 200successModels
Type: object
Show Source
Example:
{
    "status":"success"
}

400 Response

Invalid arguments
Body ()
Root Schema : 400errorModels
Type: object
Show Source
Example:
{
    "respMesg":"invalid argument"
}

401 Response

Unauthorized

403 Response

Forbidden

500 Response

Internal server error
Body ()
Root Schema : 500errorModels
Type: object
Show Source

Default Response

Unexpected error
Body ()
Root Schema : errorModel
Type: object
Show Source
Back to Top