RPC API
CHAIN
get_info
return the object includes each detail info of blockchain
1 | POST http://127.0.0.1:8888/v1/chain/get_info |
Example:
1 | curl --request POST \ |
Results:
1 | { |
get_block
Return an object includes each specific detail info of blockchain
1 | POST http://127.0.0.1:8888/v1/chain/get_block |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
block_num_or_id | string | Provide a block number or a block id |
REQUIRED |
Results:
1 | { |
get_block_header_state
Return reversible block head status.
1 | POST http://127.0.0.1:8888/v1/chain/get_block_header_state |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
block_num_or_id | string | Provide a block number or a block id |
/ |
get_account
Return an object includes each detail info of specific account.
1 | POST http://127.0.0.1:8888/v1/chain/get_account |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
account_name | string | Provide an account name | REQUIRED |
Results:
1 | { |
get_abi
Get account abi data
1 | POST http://127.0.0.1:8888/v1/chain/get_abi |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
account_name | string | name of account to retrieve ABI for | / |
Results:
1 | { |
get_raw_code_and_abi
Get account original code and abi data
1 | POST http://127.0.0.1:8888/v1/chain/get_raw_code_and_abi |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
account_name | string | Account name to get code and abi for | / |
Results:
1 | { |
get_table_rows
Return an object includes specific rows of table.
1 | POST http://127.0.0.1:8888/v1/chain/get_table_rows |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
scope | string | Provide the account name | REQUIRED |
code | string | Provide the smart contract name | REQUIRED |
table | string | Provide the table name | REQUIRED |
json | boolean | return result in JSON format | REQUIRED |
lower_bound | int32 | Provide the lower bound | / |
upper_bound | int32 | Provide the upper bound | / |
limit | int32 | Provide the limit | / |
Results:
1 | { |
abi_json_to_bin
Serialize json to binary or hexadecimal. Generated binary or hexadecimal
1 | POST http://127.0.0.1:8888/v1/chain/abi_json_to_bin |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
code | string | Provide the account name | / |
action | string | Provide the action arguments | / |
args | json | Provide the json arguments | / |
Results:
1 | { |
abi_bin_to_json
Serialize binary or hexadecimal to json.
1 | POST http://127.0.0.1:8888/v1/chain/abi_bin_to_json |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
code | string | Provide the smart contract account name | REQUIRED |
action | string | Provide the action name | REQUIRED |
binargs | string | Provide the binary arguments | REQUIRED |
Results:
1 | { |
get_required_keys
Return requiring key of registration.
1 | POST http://127.0.0.1:8888/v1/chain/get_required_keys |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
transaction | json | Provide the transaction object | REQUIRED |
available_keys | array of strings | Provide the available keys | REQUIRED |
Results:
1 | { |
Example
transaction
1 | { |
available_keys
1 | ["EOS4toFS3YXEQCkuuw1aqDLrtHim86Gz9u3hBdcBw5KNPZcursVHq", |
get_currency_stats
Get details about some assets
1 | POST http://127.0.0.1:8888/v1/chain/get_currency_stats |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
code | string | / | |
symbol | string | currency symbol to get the stats for | / |
get_producers
Get the producer info
1 | POST http://127.0.0.1:8888/v1/chain/get_producers |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
limit | string | total number of producers to retrieve | / |
lower_bound | string | / | |
json | boolean | return result in JSON format? | / |
push_block
Push block.
1 | POST http://127.0.0.1:8888/v1/chain/push_block |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
timestamp | date-time | / | |
producer | string | / | |
confirmed | int32 | / | |
previous | string | / | |
transaction_mroot | string | / | |
action_mroot | int32 | / | |
version | string | / | |
new_producers | array of strings | / | |
header_extensions | array of strings | / | |
producer_signature | string | / | |
transactions | array | / | |
block_extensions | array of strings | / |
push_transaction
This method requires JSON format, and try to use it in blockchain.
1 | POST http://127.0.0.1:8888/v1/chain/push_transaction |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
signatures | array of strings | array of signatures required to authorize transaction | / |
compression | string | compression used, usually false | / |
packed_context_free_data | string | json to hex | / |
packed_trx | string | json to hex | / |
Results:
1 | { |
Example
Note
The ref_block_num
andref_block_prefix
here is the result of last_irreversible_block
and/v1/chain/get_block
. You can use/v1/chain/get_info
to findlast_irreversible_block
. You also need to use/v1/wallet/sign_transaction
to get the right signature.
push_transactions
This method requires json format object and try to use it in blockchain. This method will push multiple objects per time.
1 | POST http://127.0.0.1:8888/v1/chain/push_transaction |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
body | json | Provide the authorizations for the transaction | REQUIRED |
Results:
1 | { |
Example
Note
Theref_block_num
and ref_block_prefix
here is the result of last_irreversible_block
and/v1/chain/get_block
You can use/v1/chain/get_info
to findlast_irreversible_block
. You also need to use /v1/wallet/sign_transaction
to get the right signature.
HISTORY
Note: history-api plugin needs to be started.
get_key_accounts
Check account according to the public key.
1 | POST http://127.0.0.1:8888/v1/history/get_key_accounts |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | |
---|---|---|
public_key | int32 | / |
NET
Note: net plugin is required.
connect
1 | POST http://127.0.0.1:8888/v1/net/connect |
Example:
1 | curl --request POST \ |
Parameters
string
disconnect
1 | POST http://127.0.0.1:8888/v1/net/disconnect |
Example:
1 | curl --request POST \ |
Parameters
string
connections
1 | POST http://127.0.0.1:8888/v1/net/connections |
Example:
1 | curl --request POST \ |
status
1 | POST http://127.0.0.1:8888/v1/net/status |
Example:
1 | curl --request POST \ |
PRODUCER
producer plugin is required.
pause
1 | POST http://127.0.0.1:8888/v1/producer/pause |
Example:
1 | curl --request POST \ |
resume
1 | POST http://127.0.0.1:8888/v1/producer/resume |
Example:
1 | curl --request POST \ |
paused
1 | POST http://127.0.0.1:8888/v1/producer/paused |
Example:
1 | curl --request POST \ |
get_runtime_options
1 | POST http://127.0.0.1:8888/v1/producer/get_runtime_options |
Example:
1 | curl --request POST \ |
update_runtime_options
1 | POST http://127.0.0.1:8888/v1/producer/update_runtime_options |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | |
---|---|---|
max_transaction_time | int32 | / |
max_irreversible_block_age | int32 | / |
produce_time_offset_us | int32 | / |
last_block_time_offset_us | int32 | / |
incoming_defer_ratio | int32 | / |
subjective_cpu_leeway_us | int32 | / |
get_greylist
1 | POST http://127.0.0.1:8888/v1/producer/get_greylist |
Example:
1 | curl --request POST \ |
Results:
1 | {"accounts":["a11111111111","aaa","bbb"]} |
add_greylist_accounts
1 | POST http://127.0.0.1:8888/v1/producer/add_greylist_accounts |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
accounts | array of strings | Accounts to add to greylist | / |
remove_greylist_accounts
1 | POST http://127.0.0.1:8888/v1/producer/remove_greylist_accounts |
Example:
1 | curl --request POST \ |
Main Parameters
Parameters | Type | Description | |
---|---|---|---|
accounts | array of strings | Accounts to add to greylist | / |
get_whitelist_blacklist
1 | POST http://127.0.0.1:8888/v1/producer/get_whitelist_blacklist |
Example:
1 | curl --request POST \ |
set_whitelist_blacklist
1 | POST http://127.0.0.1:8888/v1/producer/set_whitelist_blacklist |
Example:
1 | curl --request POST \ |
DBSIZE
get
1 | POST http://127.0.0.1:8888/v1/db_size/get |
Example:
1 | curl --request POST \ |