Instantiate a Chaincode

post

/console/admin/api/v1.1/chaincodes/{chaincodeName}/instantiate

Instantiates a chaincode on a channel.

Request

Supported Media Types
Path Parameters
Body ()
Information about where and how to instantiate the chaincode.
Root Schema : instantiateChaincode
Type: object
Show Source
Example:
{
    "channelName":"mychannel1",
    "chaincodeVersion":"v1",
    "transientMap":{
    },
    "endorsementPolicy":{
        "identities":[
        ],
        "policy":{
            "0-of":[
            ]
        }
    },
    "args":[
        "a",
        "100",
        "b",
        "200"
    ],
    "dataCollectionConfig":{
        "name":"",
        "policy":"",
        "requiredPeerCount":1,
        "maxPeerCount":2,
        "blockToLive":10
    },
    "chaincodeType":"golang",
    "peers":[
        {
            "url":"grpcs://peer0.org1.example.com:7051"
        }
    ]
}
Nested Schema : args
Type: array
Show Source
Nested Schema : dataCollectionConfig
Type: array
Show Source
Nested Schema : endorsementPolicy
Type: object
Show Source
Nested Schema : peers
Type: array
Show Source
Nested Schema : transientMap
Type: object
Nested Schema : items
Type: object
Show Source
Nested Schema : identities
Type: array
Show Source
Nested Schema : policy
Type: object
Nested Schema : items
Type: object
Show Source
Nested Schema : role
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

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

202 Response

In Progress

400 Response

Invalid argument
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