# Initial Set-Up

Complete these operations before embarking on writing, reading and verifying [**†**](https://docs.teranode.group/nchain-event/overview/configuration-symbols) records.

## 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:

{% tabs %}
{% tab title="cURL" %}

```bash
URL=https://event-platform.com/products/api/2cdee07fe....45d58e65537f39

KEY=b6519d3c56c....6746131380159bb9
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const url = "https://nchainplatform.com/products/api/2cdee07fe....45d58e65537f39";

const key = "b6519d3c56c....6746131380159bb9";
```

{% endtab %}
{% endtabs %}

## Check Readiness

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

#### Example code:

{% tabs %}
{% tab title="cURL" %}

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

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch('${url}/readiness', {
  headers: {
    'x-api-key': '{$key}',
    'accept': 'text/plain'
  }
});
```

{% endtab %}
{% endtabs %}

#### Example cURL response:

```json
{
  "appVersion": "1.4.1",
  ....
}
```

Chain Event uses semantic versioning as specified at [https://semver.org](https://semver.org/).

## Check Liveness

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

#### Example code:

{% tabs %}
{% tab title="cURL" %}

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

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch('${url}/liveness', {
  headers: {
    'x-api-key': `${key}`,
    'accept': 'text/plain'
  }
});
```

{% endtab %}
{% endtabs %}

#### Example cURL response:

```json
Healthy
```
