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:
Argument
Type
Required
Description
hash
String
True
The transaction's hash
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"node_getTransactionStatus", "params": "0xf91be74146afb8717834f70969d02edff4316508dc62ec8716104968391fc492", "id":21}'
Copied!

Console Example

1
> node.getTransactionStatus("0xf91be74146afb8717834f70969d02edff4316508dc62ec8716104968391fc492")
Copied!

Returns:

Object
Field
Type
Description
status
String
"mined" = In a block that has been mined.
"pooled" = In the transaction pool.

Output:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"status": "mined"
6
}
7
}
Copied!

node_getSyncStat

Get the progress stats of block synchronization between the node and a peer.
Parameters: None
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"node_getSyncStat", "id":21}'
Copied!

Console Example

1
> node.getSyncStat()
Copied!

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:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"currentChainHeight": 1,
6
"currentTotalDifficulty": 10000000,
7
"progressPercent": 0,
8
"targetChainHeight": 8159,
9
"targetTotalDifficulty": 81680611840
10
}
11
}
Copied!

node_isSyncing

Checks whether the client is currently syncing with peers.
Parameters: None
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"node_isSyncing", "id":21}'
Copied!

Console Example

1
> node.isSyncing()
Copied!

Returns:

Boolean

Output:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": false
5
}
Copied!

node_info

Get information about the node. The information returned may include sensitive details about the node.
Private: Requires authentication.
Parameters: None
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"node_info", "id":21}'
Copied!

Console Example

1
> node.info()
Copied!

Returns:

Object
Field
Type
Description
address
String
The listening address of client.
id
String
The node ID.
name
String
A random pet name.
coinbase
String
The clients loaded account used to derive its unique
network ID and receive rewards.
coinbasePublicKey
String
The public key of the client. Used to derive the
address and node ID.
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:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"name": "frankly-resolved-snipe",
6
"address": "ellcrys://[email protected]:9001",
7
"coinbase": "eH3vy3dv3KLFQ3bJD9nNuqubCZqxduWRsg",
8
"coinbasePublicKey": "47w9pZcNDa868gB1pD3Ye14aMGqpUzm4eZG7LUjsGym5VHNdMfF",
9
"id": "12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5",
10
"listeningAddresses": [
11
"/ip4/127.0.0.1/tcp/9001/ipfs/12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5",
12
"/ip4/192.168.40.205/tcp/9001/ipfs/12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5",
13
"/ip4/10.6.6.251/tcp/9001/ipfs/12D3KooWBBSJ75d1imQResWMrHf5D3GrreKjdjkHBJVKb8iWyWQ5"
14
],
15
"mode": "development",
16
"netVersion": "/inception/1",
17
"syncing": false,
18
"buildCommit": "2ee1b3b70a4acd6ea45d2e00ea4fba666c709ac7",
19
"buildDate": "2018-12-17T21:17:05Z",
20
"buildVersion": "0.1.5-alpha",
21
"goVersion": "go1.10.4"
22
}
23
}
Copied!

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:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"node_basic", "id":21}'
Copied!

Console Example

1
> node.basic()
Copied!

Returns:

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

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"id": "12D3KooWCsZKcVA2kzRwxBF4NcUXsuABK9Mmd9nRuyfyLqtKEFcR",
6
"mode": "production",
7
"name": "frankly-resolved-snipe",
8
"netVersion": "0001",
9
"syncing": false,
10
"buildCommit": "2ee1b3b70a4acd6ea45d2e00ea4fba666c709ac7",
11
"buildDate": "2018-12-17T21:17:05Z",
12
"buildVersion": "0.1.5-alpha",
13
"goVersion": "go1.10.4"
14
}
15
}
Copied!

node_config

Returns the clients configurations.
Private: Requires authentication.
Parameters: None
Curl Example:
1
curl -X POST --data '{"jsonrpc":"2.0","method":"node_config", "id":21}'
Copied!

Console Example

1
> node.config()
Copied!

Returns:

Object
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.
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:

1
{
2
"id": 21,
3
"jsonrpc": "2.0",
4
"result": {
5
"peer": {
6
"MessageTimeout": 60,
7
"addresses": null,
8
"cleanUpInt": 600,
9
"conEstInt": 10,
10
"mode": 1,
11
"getAddrInt": 60,
12
"maxAddrsExpected": 1000,
13
"maxInConnections": 10,
14
"maxOutConnections": 10,
15
"pingInt": 60,
16
"selfAdvInt": 10
17
},
18
"rpc": {
19
"disableAuth": false,
20
"password": "admin",
21
"sessionSecretKey": "wGzgzDAVmr....ylSiIaYbUgIU",
22
"username": "admin"
23
},
24
"txPool": {
25
"cap": 10000
26
}
27
}
28
}
Copied!