Verify Blocks

get

/console/admin/api/v1.1/nodes/peers/{peerId}/blockaudit/{channelName}

Verifies blocks against a channel owned by the given peer.

Request

Supported Media Types
Path Parameters
Back to Top

Response

Supported Media Types

200 Response

Response with block audit result

400 Response

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

401 Response

Unauthorized

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

Examples

This endpoint is used to validate ledger blocks against a channel owned by the given peer.

Block validation does the following:

  • Parses local blockchain ledger files.
  • Verifies the integrity and data format.
  • Collects statistics such as block size, number of transactions, etc.

The following example shows how to validate blocks by submitting a GET request on the REST resource using cURL.

curl -u <username>:<password> -X GET \
  "https://<rest_server_url:port>/console/admin/api/v1.1/nodes/peers/<peerId>/blockaudit/<channelName>"

For example,

curl -u myname@oracle.com:mypswd\
 -X GET "https://myvm.oracle.com:10001/console/admin/api/v1.1/nodes/peers/devpeer04/blockaudit/devchannel02"
 

Example of the Response Body

The following example shows the contents of a response body in JSON format:

{
    "verifyResult"      : "success|failure",
    "timeStamp"         : "2020-11-02 16:15:36 UTC",    # timestamp when generating this report
    "timeElapse"        : "35.356285ms",                # total execution time
    "ledgerFiles"       : [                             # the ledger files have been verified
                            "blockfile_000000",
                            "blockfile_000001",
                            ...
                          ],
    "ledgerHeight"      : 10,
    "firstBlockNum"     : 0,
    "lastBlockNum"      : 9,
    "txCount"           : 14,
    "lastConfigIndex"   : 2,
    "lastBlockDataHash" : "a1b720700c0265f7ba6a63882a48ee01aa7b96524b591f340205efa5399d64e7",
    "lastBlockPreHash"  : "4da6d7d881a9e8b51e179fd4a57d50eca6c28634bf81feb464fe74bfc407c9d8"
}
Back to Top