Get peer list

Prev Next

Available in VPC

Get the list of peers that maintain the blockchain network and manage the ledger and chaincode.

Request

The following describes the request format for the endpoint. The request format is as follows:

Method URI
GET /api/v1/networks/{networkId}/peers (Korea Region)
GET /api/sgn-v1/networks/{networkId}/peers (Singapore Region)

Request headers

For information about the headers common to all Blockchain Service APIs, see Blockchain Service request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
networkId Long Required Network ID

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
page Integer Optional Page number
  • 0 (default)
size Integer Optional Size of list viewed
  • 20 (default)

Request example

The following is a sample request.

curl --location --request GET 'https://blockchainservice.apigw.ntruss.com/api/v1/networks/{networkId}/peers' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json'

Response

The following describes the response format.

Response body

The following describes the response body.

Field Type Required Description
content Array - Content details: content
totalElements Long - Total number of peer nodes
totalPages Integer - Total number of pages

content

The following describes content.

Field Type Required Description
networkId Long - Network ID
peerId String - Peer ID
peerName String - Peer name
statusDatabaseType String - Peer's state database type
  • LEVEL_DB | COUCH_DB
    • LEVEL_DB: lightweight DB with fast performance and simple data structures
    • COUCH_DB: document-based DB with JSON data and complex query and search capabilities
mspId String - Peer MSP ID
status String - Peer status
  • ACTIVE | DEPLOY | DELETE
    • ACTIVE: running
    • DEPLOY: deploying
    • DELETE: deleting
createDate LocalDateTime - Peer creation date and time
  • YYYY-MM-DDTHH:MM:SS+0000 format
updateDate LocalDateTime - Peer modification date and time
  • YYYY-MM-DDTHH:MM:SS+0000 format

Response status codes

For information about the HTTP status codes common to all Blockchain Service APIs, see Blockchain Service response status codes.

Response example

The following is a sample example.

{
    "content": [
        {
            "networkId": 1630,
            "peerId": "25738634",
            "peerName": "test-peer2",
            "statusDatabaseType": "LEVEL_DB",
            "mspId": "test-msp",
            "status": "ACTIVE",
            "createDate": "2024-07-30T00:29:32+0000",
            "updateDate": "2024-08-08T16:29:32+0000"
        }
    ],
    "totalElements": 1,
    "totalPages": 1
}