Initial Set-Up

Complete these operations before embarking on writing, reading and verifying records.

This user guide provides cURL and JavaScript examples. cURL can be directly executable in a terminal window and can be easily translated to the language of your choice by cURL converters which are readily available on the internet.

Configure REST API Info

The API URL and the associated key and means of using the key will be provided by your supplier. We set them up as variables to make the endpoints easier to use in the subsequent examples.

Example code:

URL=https://nchainplatform.com/products/api/2cdee07fe....45d58e65537f39

KEY=b6519d3c56c....6746131380159bb9

Check Readiness

This enables you to check that the program is initially working and find out its version number.

Example code:

curl "$URL/readiness" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain"

Example cURL response:

{
  "appVersion": "1.2.1",
  ....
}

Chain Event uses semantic versioning as specified at https://semver.org.

Check Liveness

This enables you to check whether the program thinks it is Healthy or not. Applications that interact with nChain Event could call this every hour when they are idling.

Example code:

curl "$URL/readiness" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain"

Example cURL response:

Healthy