Updated on 2023-10-09 GMT+08:00

Querying Chaincode Installation Information

Function

This API is used to query the information about chaincode installation on peers.

URI

GET /v2/agent/apis/chaincode/install

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

chaincode_name

Yes

String

Chaincode name, which can contain 6 to 25 including lowercase letters and digits, and must start with a letter.

Minimum: 6

Maximum: 25

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

result

Array of PeerInstallInfo objects

Information about chaincode installation on peers.

Table 4 PeerInstallInfo

Parameter

Type

Description

org_name

String

Name of the organization to which the peer belongs.

org_id

String

ID of the organization to which the peer belongs.

peer_name

String

Peer name.

peer_id

String

Peer ID.

install_status

String

Chaincode installation result, which can be installed or uninstalled.

version

String

Chaincode version.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error description.

error_msg

String

Error description.

Example Requests

GET https://192.168.0.90:30603/v2/agent/apis/chaincode/install?chaincode_name=chaincode

Example Responses

Status code: 200

Success

{
  "result" : [ {
    "org_name" : "org1",
    "org_id" : "65cfb1c760f24058c865ffcfd8ce1cdb690bf2a3",
    "peer_name" : "peer-0",
    "peer_id" : "peer-65cfb1c760f24058c865ffcfd8ce1cdb690bf2a3-0.peer-65cfb1c760f24058c865ffcfd8ce1cdb690bf2a3.default.svc.cluster.local",
    "install_status" : "uninstalled",
    "version" : ""
  }, {
    "org_name" : "org1",
    "org_id" : "65cfb1c760f24058c865ffcfd8ce1cdb690bf2a3",
    "peer_name" : "peer-1",
    "peer_id" : "peer-65cfb1c760f24058c865ffcfd8ce1cdb690bf2a3-1.peer-65cfb1c760f24058c865ffcfd8ce1cdb690bf2a3.default.svc.cluster.local",
    "install_status" : "installed",
    "version" : "1.0"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "BCS.4000013",
  "error_message" : "request body is too large"
}

Status Codes

Status Code

Description

200

Success

400

Bad Request

Error Codes

See Error Codes.