Gateway-API Commands
The Gateway-API supports a few Gateway-specific commands that are not related to the Cloud-API.

REQUEST

Commands

Command
Description
gateway_status
Get the status of the Gateway. It accepts an [optional] parameter that can be 'SUMMARY’ [default] or β€˜DETAILED’
memory
Get the memory utilization of the Gateway
peers
Get the list of peers connected to the Gateway
bdn_performance
Get percentage of blocks/transactions first received from the BDN
stop
Shutdown the Gateway
help
Print detailed help

Examples

We assume that the Gateway IP is 127.0.0.1 with port 28332
gateway_status
memory
peers
bdn_performance
1
curl http://127.0.0.1:28332 \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
5
-d '{"method": "gateway_status", "id": "1", "params": {"details_level": "summary"}}'
6
Copied!
1
curl http://127.0.0.1:28332 \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
5
-d '{"method": "memory", "id": "1", "params": null}'
6
Copied!
1
curl http://127.0.0.1:28332 \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
5
-d '{"method": "peers", "id": "1", "params": null}'
6
Copied!
1
curl http://127.0.0.1:28332 \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
5
-d '{"method": "bdn_performance", "id": "1", "params": null}'
6
Copied!

RESPONSE

Result Fields

gateway_status
memory
peers
bdn_performance
Result Field
Description
gateway_status
The status of the Gateway, e.g., Online.
account_info
Information about the account, e.g., The account ID or Gateway not registered to any account ID.
block_relay_connection_state
The state of the block Relay connection, e.g., Established.
transaction_relay_connection_state
The state of the transaction Relay connection, e.g., Established.
blockchain_node_connection_state
The state of the blockchain node connection, e.g., Established.
ip_address
The Gateway's IP address, e.g., 11.22.33.44.
continent
The continent at which the Gateway resides, e.g., NA (North America).
country
The country in which the Gateway resides, e.g., United States.
update_required
Indicates if the Gateway needs to be updated, e.g., false.
quota_level
The percent of transactions that have been sent, relative to the quota_limit , from this Gateway, e.g., 0%.
Result Field
Description
total_cached_transactions
The total number of cached transactions, e.g., 46186.
total_mem_usage
The total memory usage, e.g., 257 MB.
total_cached_transactions_size
The total size of cashed transactions, e.g., 8 MB.
Result Field
Description
id
The peer's id, e.g., null.
type
The type of the peer, e.g., BLOCKCHAIN_NODE.
addr
The IP address and port number of the peer, e.g., 172.17.0.1 30303.
direction
The peer's direction, e.g., OUTBOUND.
state
The connection state, e.g., CONNECTING.
Result Field
Description
interval_start_time
The interval start time, e.g., 2020-09-01 22.10.52.063009.
interval_end_time
The interval end time, e.g., 2020-09-01 22.25.52.096951.
blocks_from_bdn_percentage
The percent of blocks received from the BDN, relative to all received blocks, e.g., 90.72%.
transactions_from_bdn_percentage
The percent of transactions received from the BDN, relative to all received transactions, e.g., 79.13%.

Examples

gateway_status
memory
peers
bdn_performance
1
{
2
"jsonrpc": "2.0",
3
"id": "1",
4
"result": {
5
"gateway_status": "Online",
6
"account_info": "This gateway is not registered to any account and is limited to the daily free quota",
7
"block_relay_connection_state": "Established",
8
"transaction_relay_connection_state": "Established",
9
"blockchain_node_connection_state": "Established",
10
"remote_blockchain_node_connection_state": "Established",
11
"ip_address": "11.22.33.44",
12
"continent": "NA",
13
"country": "United States",
14
"update_required": false,
15
"quota_level": "0%"
16
}
17
}
18
​
Copied!
1
{
2
"jsonrpc": "2.0",
3
"id": "1",
4
"result": {
5
"total_mem_usage": "257 MB",
6
"total_cached_transactions": 46186,
7
"total_cached_transactions_size": "8 MB"
8
}
9
}
10
​
Copied!
1
{
2
"jsonrpc": "2.0",
3
"id": "1",
4
"result": [
5
{
6
"id": null,
7
"type": "BLOCKCHAIN_NODE",
8
"addr": "172.17.0.1 30303",
9
"direction": "OUTBOUND",
10
"state": "CONNECTING"
11
},
12
{...}
13
]
14
}
15
​
Copied!
1
{
2
"jsonrpc": "2.0",
3
"id": "1",
4
"result": {
5
"interval_start_time": "2020-09-01 22:10:52.063009",
6
"interval_end_time": "2020-09-01 22:25:52.096951",
7
"blocks_from_bdn_percentage": "90.72%",
8
"transactions_from_bdn_percentage": "79.13%"
9
}
10
}
11
​
Copied!
​
Last modified 11mo ago
Copy link