Node

Overview

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

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:

Curl Example:

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

Console Example

> node.getTransactionStatus("0xf91be74146afb8717834f70969d02edff4316508dc62ec8716104968391fc492")

Returns:

Object

Output:

{
  "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:

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

Console Example

> node.getSyncStat()

Returns:

Object | null

Output:

{
  "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:

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

Console Example

> node.isSyncing()

Returns:

Boolean

Output:

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

node_info

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

Private: Requires authentication.

Parameters: None

Curl Example:

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

Console Example

> node.info()

Returns:

Object

Output:

{
  "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:

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

Console Example

> node.basic()

Returns:

Object

Output:

{
  "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.

Private: Requires authentication.

Parameters: None

Curl Example:

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

Console Example

> node.config()

Returns:

Object

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.

Keep your RPC session secret private.

Output:

{
  "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
    }
  }
}

Last updated