> For the complete documentation index, see [llms.txt](https://ellcrys.gitbook.io/ellcrys/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ellcrys.gitbook.io/ellcrys/api/node-apis.md).

# Node

## Overview

Node APIs provide access to the client engine. Access information about the client's state and configuration.&#x20;

## node\_getTransactionStatus

Get the status of a transaction. Learn whether a transaction has been included in a mined block or whether it is in the transaction pool.

**Parameters:**

| Argument | Type   | Required | Description            |
| -------- | ------ | -------- | ---------------------- |
| hash     | String | True     | The transaction's hash |

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"node_getTransactionStatus", "params": "0xf91be74146afb8717834f70969d02edff4316508dc62ec8716104968391fc492", "id":21}'
```

#### Console Example

```javascript
> node.getTransactionStatus("0xf91be74146afb8717834f70969d02edff4316508dc62ec8716104968391fc492")
```

#### Returns:

`Object`&#x20;

| Field  | Type   | Description                                                                                 |
| ------ | ------ | ------------------------------------------------------------------------------------------- |
| status | String | <p>"mined" = In a block that has been mined. </p><p>"pooled" = In the transaction pool.</p> |

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "status": "mined"
  }
}
```

## node\_getSyncStat

Get the progress stats of block synchronization between the node and a peer.

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"node_getSyncStat", "id":21}'
```

#### Console Example

```javascript
> node.getSyncStat()
```

#### Returns:

`Object` | `null`

| Field                  | Type    | Description                                                     |
| ---------------------- | ------- | --------------------------------------------------------------- |
| currentChainHeight     | Integer | The current height of the main chain.                           |
| currentTotalDifficulty | Integer | The current total difficulty of the main chain.                 |
| progressPercent        | Integer | Describes the sync progress as a percentage.                    |
| targetChainHeight      | Integer | The highest chain height discovered from peer interactions.     |
| targetTotalDifficulty  | Integer | The highest total difficulty discovered from peer interactions. |

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "currentChainHeight": 1,
    "currentTotalDifficulty": 10000000,
    "progressPercent": 0,
    "targetChainHeight": 8159,
    "targetTotalDifficulty": 81680611840
  }
}
```

## node\_isSyncing

Checks whether the client is currently syncing with peers.

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"node_isSyncing", "id":21}'
```

#### Console Example

```javascript
> node.isSyncing()
```

#### Returns:

`Boolean`&#x20;

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": false
}
```

## node\_info

Get information about the node. The information returned may include sensitive details about the node.

{% hint style="info" %}
**Private**: Requires authentication.
{% endhint %}

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"node_info", "id":21}'
```

#### Console Example

```javascript
> node.info()
```

#### Returns:

`Object`&#x20;

| Field              | Type           | Description                                                                                        |
| ------------------ | -------------- | -------------------------------------------------------------------------------------------------- |
| address            | String         | The listening address of client.                                                                   |
| id                 | String         | The node ID.                                                                                       |
| name               | String         | A random pet name.                                                                                 |
| coinbase           | String         | <p>The clients loaded account used to derive its unique </p><p>network ID and receive rewards.</p> |
| coinbasePublicKey  | String         | <p>The public key of the client. Used to derive the </p><p>address and node ID.</p>                |
| listeningAddresses | Array\<String> | A list of all listening addresses.                                                                 |
| mode               | String         | The currently enabled environment. ("development" or "production").                                |
| syncing            | Boolean        | Whether the node is currently syncing.                                                             |
| netVersion         | String         | The nodes network version.                                                                         |
| buildVersion       | String         | The client's build version.                                                                        |
| buildDate          | String         | The client's build date.                                                                           |
| buildCommit        | String         | The client's build git commit hash.node.                                                           |
| goVersion          | String         | The version of go that was used to create the build.                                               |

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "name": "frankly-resolved-snipe",
    "address": "ellcrys://12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5@127.0.0.1:9001",
    "coinbase": "eH3vy3dv3KLFQ3bJD9nNuqubCZqxduWRsg",
    "coinbasePublicKey": "47w9pZcNDa868gB1pD3Ye14aMGqpUzm4eZG7LUjsGym5VHNdMfF",
    "id": "12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5",
    "listeningAddresses": [
      "/ip4/127.0.0.1/tcp/9001/ipfs/12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5",
      "/ip4/192.168.40.205/tcp/9001/ipfs/12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5",
      "/ip4/10.6.6.251/tcp/9001/ipfs/12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5"
    ],
    "mode": "development",
    "netVersion": "/inception/1",
    "syncing": false,
    "buildCommit": "2ee1b3b70a4acd6ea45d2e00ea4fba666c709ac7",
    "buildDate": "2018-12-17T21:17:05Z",
    "buildVersion": "0.1.5-alpha",
    "goVersion": "go1.10.4"
  }
}
```

## node\_basic

Get public-friendly information about the node. Unlike `node_basic` , the information that is returned are non-sensitive and suitable for public access.

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"node_basic", "id":21}'
```

#### Console Example

```javascript
> node.basic()
```

#### Returns:

`Object`&#x20;

| Field        | Type    | Description                                                         |
| ------------ | ------- | ------------------------------------------------------------------- |
| id           | String  | The node ID.                                                        |
| name         | String  | A random pet name.                                                  |
| mode         | String  | The currently enabled environment. ("development" or "production"). |
| syncing      | Boolean | Whether the node is currently syncing.                              |
| netVersion   | String  | The nodes network version.                                          |
| buildVersion | String  | The client's build version.                                         |
| buildDate    | String  | The client's build date.                                            |
| buildCommit  | String  | The client's build git commit hash.node.                            |
| goVersion    | String  | The version of go that was used to create the build.                |

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "id": "12D3KooWCsZKcVA2kzRwxBF4NcUXsuABK9Mmd9nRuyfyLqtKEFcR",
    "mode": "production",
    "name": "frankly-resolved-snipe",
    "netVersion": "0001",
    "syncing": false,
    "buildCommit": "2ee1b3b70a4acd6ea45d2e00ea4fba666c709ac7",
    "buildDate": "2018-12-17T21:17:05Z",
    "buildVersion": "0.1.5-alpha",
    "goVersion": "go1.10.4"
  }
}
```

## node\_config

Returns the clients configurations.

{% hint style="info" %}
**Private**: Requires authentication.
{% endhint %}

**Parameters:** None

**Curl Example:**&#x20;

```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"node_config", "id":21}'
```

#### Console Example

```javascript
> node.config()
```

#### Returns:

`Object`&#x20;

| Field             | Type           | Description                                                                       |
| ----------------- | -------------- | --------------------------------------------------------------------------------- |
| **peer**          | Object         | The client specific configuration.                                                |
| .messageTimeout   | Int            | The number of seconds to wait before aborting connection attempt.                 |
| .addresses        | Array\<String> | A list of bootstrap connection addresses.                                         |
| .cleanUpInt       | Int            | Number of seconds between peer address clean up.                                  |
| .conEstInt        | Int            | Number of seconds between attempts to establish connection with unconnected peer. |
| .dev              | Int            | The environment mode. (0 = production, 1 = development, 2 = test).                |
| getAddrInt        | Int            | Number of seconds between requests for more addresses.                            |
| maxAddrsExpected  | Int            | The maximum number of addresses expected from a peer.                             |
| maxInConnections  | Int            | The maximum number of inbound connections.                                        |
| maxOutConnections | Int            | The maximum number of outbound connections.                                       |
| pingInt           | Int            | Number of seconds between pings to peers.                                         |
| selfAdvInt        | Int            | Number of seconds between self advertisements to peers.                           |
| **rpc**           | Object         | RPC specific configurations.                                                      |
| .disableAuth      | Boolean        | Disable RPC authentication (default=false)                                        |
| .username         | String         | RPC username (default=admin)                                                      |
| .password         | String         | RPC Password (default=admin)                                                      |
| .sessionSecretKey | String         | Session key is used to bcrypt the RPC session token.                              |
| **txPool**        | Object         | Transaction pool configurations.                                                  |
| .cap              | Int            | The maximum number of transactions that is allowed in the transaction pool.       |

{% hint style="danger" %}
Please change the default RPC **username** and **password** before enabling RPC service. Also set up appropriate firewall to prevent unauthorized access to the RPC endpoint.&#x20;
{% endhint %}

{% hint style="danger" %}
Keep your RPC session secret private.&#x20;
{% endhint %}

#### Output:

```javascript
{
  "id": 21,
  "jsonrpc": "2.0",
  "result": {
    "peer": {
      "MessageTimeout": 60,
      "addresses": null,
      "cleanUpInt": 600,
      "conEstInt": 10,
      "mode": 1,
      "getAddrInt": 60,
      "maxAddrsExpected": 1000,
      "maxInConnections": 10,
      "maxOutConnections": 10,
      "pingInt": 60,
      "selfAdvInt": 10
    },
    "rpc": {
      "disableAuth": false,
      "password": "admin",
      "sessionSecretKey": "wGzgzDAVmr....ylSiIaYbUgIU",
      "username": "admin"
    },
    "txPool": {
      "cap": 10000
    }
  }
}
```
