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
gateway_status
curl http://127.0.0.1:28332 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
-d '{"method": "gateway_status", "id": "1", "params": {"details_level": "summary"}}'
memory
curl http://127.0.0.1:28332 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
-d '{"method": "memory", "id": "1", "params": null}'
peers
curl http://127.0.0.1:28332 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
-d '{"method": "peers", "id": "1", "params": null}'
bdn_performance
curl http://127.0.0.1:28332 \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR-AUTHORIZATION-HEADER>" \
-d '{"method": "bdn_performance", "id": "1", "params": null}'

RESPONSE

Result Fields

gateway_status
memory
peers
bdn_performance
gateway_status

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%.

memory

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.

peers

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.

bdn_performance

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
gateway_status
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"gateway_status": "Online",
"account_info": "This gateway is not registered to any account and is limited to the daily free quota",
"block_relay_connection_state": "Established",
"transaction_relay_connection_state": "Established",
"blockchain_node_connection_state": "Established",
"remote_blockchain_node_connection_state": "Established",
"ip_address": "11.22.33.44",
"continent": "NA",
"country": "United States",
"update_required": false,
"quota_level": "0%"
}
}
​
memory
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"total_mem_usage": "257 MB",
"total_cached_transactions": 46186,
"total_cached_transactions_size": "8 MB"
}
}
​
peers
{
"jsonrpc": "2.0",
"id": "1",
"result": [
{
"id": null,
"type": "BLOCKCHAIN_NODE",
"addr": "172.17.0.1 30303",
"direction": "OUTBOUND",
"state": "CONNECTING"
},
{...}
]
}
​
bdn_performance
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"interval_start_time": "2020-09-01 22:10:52.063009",
"interval_end_time": "2020-09-01 22:25:52.096951",
"blocks_from_bdn_percentage": "90.72%",
"transactions_from_bdn_percentage": "79.13%"
}
}
​

​