JSON-RPC Application Programming Interface
In order for a software application to interact with the IBAX blockchain (fetch block data or send transactions to the network), it must be connected to an IBAX network node.
Due to the generality and extensibility of the original REST API interface, it will become more and more complex with more and more interfaces and different clients. We realize the importance of interface unification to ensure that all clients can use the same set of specifications, regardless of the specific node and client implementation.
JSON-RPC is a stateless, lightweight remote procedure call (RPC) protocol. It defines a number of data structures and their processing rules. It is transport independent, as these concepts can be used in the same process, via an interface, hypertext transfer protocol, or in many different messaging environments. It uses JSON (RFC 4627) as the data format.
JSON-RPC is compatible with most of the REST API interfaces, retaining the original REST API interface, the client using the REST API interface can easily transfer to the JSON-RPC interface, part of the interface:
Available through the REST API interface.
Client-side implementation
Each client can use a different programming language when implementing the JSON-RPC specification, and you can use the
GO-SDK (opens new window)
Curl example
The following provides examples of using the JSON RPC API by making curl requests to IBAX nodes. Each example includes a description of the particular endpoint, its parameters, the return type, and a working example of how it should be used.
Curl requests may return an error message related to the content type. This is because the --data option sets the content type to application/x-www-form-urlencoded. If your request has this problem, set the header manually by placing -H "Content-Type: application/json" at the beginning of the call. These examples also do not include the URL/Internet Protocol and port combination that must be the last parameter of the curl (e.g. 127.0.0.1:7079). A full curl request with this additional data takes would be in the following form:
Covenant
Hex
Hexadecimal code
When encoding byte arrays, hashes, and bytecode arrays: the encoding is hexadecimal, two hexadecimal digits per byte.
Request type
Uniform use
- Content-Type: application/json
Special markers
Omitempty
This field is an optional parameter.
If there are multiple Omitempty
fields in a row, but only want to pass the value of a certain field, then you need to set the unwanted field to null (the field type null value), Example:
If only the name value is passed, then the request parameters are passed as follows
"params":[0, "testname"]
- Number null value is 0
If only the column value is passed, then the request parameters are passed as follows
"params":[0,"", "title,page"]
- String empty value for ""
Authorization
Authorization header, add Authorization to the request header, example:
name : Authorization value : Bearer +login token
Example:
AccountOrKeyId
For the account address parameter, you can use two formats of addresses, for example:
- String - Account Address
"XXXX-XXXX-XXXX-XXXX-XXXX"
or Account Id "64842...538120"
.538120"`
- Object - Address object
- key_id - Number - Account Id, Example:
{"key_id":-64842...38120}
- account - String - Account address, Example:
{"account": "1196-...-...-...-3496"}
Account Id is preferred when both account address and account Id exist.
BlockOrHash
Block height or block HASH, example:
- String - Block Height
"100"
or Block HASH"4663aa47...a60753c18d9ba9cb4"
Batch requests
This feature can be used to reduce network latency, especially when acquiring a large number of largely independent data objects.
The following is an example of obtaining the highest block and total number of transactions:
Error response handling
Returns status 200
in case the request is executed successfully.
If an error occurs, a JSON object with the following fields will be returned:
jsonrpc
Error identifier.
id
Error text message.
error
JSON-RPC Namespaces
ibax Namespace
Authentication Interface
server-side command interface
Data Request Function Interface
Get Metrics Interface
Ecosystem Interface
Contract Function Interface
net Namespace
rpc Namespace
admin Namespace
debug Namespace
JSON-RPC Interface Methods
ibax.getUid
Authorization Omitempty
Generate a temporary JWT token, which needs to be passed to Authorization when calling login.
Parameters
Return Value
uid - String - The signature number.
token - String - temporary token passed during login (temporary token has a 5 second lifespan).
network_id - String - The network identifier.
cryptoer - String - Elliptic curve algorithm.
hasher - String - hash algorithm.
In the case that no authorization is required(the request contains Authorization, the following message will be returned.
expire - String - Expiration time.
ecosystem - String - Ecosystem ID.
key_id - String - The account address.
address - String - wallet address XXXX-XXXXXX-XXXX-XXXX-XXXX
.
network_id - String - The network identifier.
Example
ibax.login
User authentication.
Authorization
The ibax.getUid command should be called first in order to receive the unique value and sign it.
The temporary JWT token for getuid needs to be passed in the request header.
If the request is successful, the token received in the response is contained in Authorization.
Parameters
Object - Authentication call object
ecosystem_id - Number - Ecosystem ID. if not specified, defaults to the first ecosystem ID.
expire - Number - The lifecycle of the JWT token in seconds, default is 28800,8 hours.
public_key - Hex String - Hexadecimal account public key.
key_id - String -
Account address XXXX-... -XXXX
.
Use this parameter if the public key is already stored in the blockchain. It cannot be used with pubkey
parameters are used together.
signature - String -
Use the private key to sign the uid received by getuid.
Signature data content: LOGIN+{$network_id}+uid
role_id - Number - Role ID, default role 0
Return Value Object - Authentication object
token - String - JWT token.
ecosystem_id - String - Ecosystem ID.
key_id - String - Account Address ID
account - String - wallet address XXXX-XXXXXX-XXXX-XXXX-XXXX
.
notify_key - String - The notification ID.
isnode - Bool - Whether the account address is the owner of the node. Values: true,false
.
isowner - Bool - Whether the account address is the creator of this ecosystem. Values: true,false
.
clb - Bool - Whether the logged-in ecosystem is a CLB. Values: true,false
.
timestamp - String - current timestamp
roles - Array list of roles, if there are no roles, the field is nil
- role_id - Number - Role ID
- role_name - String - Role name
Example
ibax.getAuthStatus
User authentication status.
Authorization
Parameters
Return Value Object - Authentication status object
active - Bool - The current user authentication status. Values: true,false
exp - Number - Omitempty Token validity cutoff timestamp
Example
ibax.getVersion
Returns the current server version.
Parameters
Return Value
- vesion - String - version number (
big Version
+ branch name
+ git commit
+ time
+ node status
)
Example
ibax.getBalance
Get the account address balance.
Parameters
Return Value Object - Get the balance object
amount - String - the minimum unit of the contract account balance.
total - String - the total balance of the minimum unit account (amount + utxo).
utxo - String - Minimum unit UTXO account balance.
digits - Number - Accuracy
token_symbol - String - Token symbols
Example
ibax.getBlocksTxInfo
Returns a list containing additional information about the transactions in each block.
Parameters
block_id - Number - the starting block height to query
count - Number - number of blocks, default is 25, maximum request is 100
Return Value Object - Get the block information object.
Example
ibax.detailedBlocks
Returns a list containing detailed additional information about the transactions in each block.
Parameters
block_id - Number - the height of the starting block to query
count - Number - number of blocks, default is 25, maximum request is 100
Return Value Object - Get the block details object.
- block_id - String - block height
- header - Object - block header The block header contains the following fields.
- block_id - Number - the height of the block.
- time - Number - block generation timestamp.
- key_id - Number - the address of the account that signed the block.
- node_position - Number - The position of the node that generated the block in the honor node list.
- version - Number - the block structure version.
- hash - Hex String - The block hash.
- node_position - Number - The position of the node that generated the block in the honor node list.
- key_id - Number - the address of the account that signed the block.
- time - Number - block generation timestamp.
- tx_count - Number - the number of transactions within the block.
- size - String - the size of the block.
- rollback_hash - Hex String - The block rollback hash.
- merkle_root - Hex String - The merkle tree for this block transaction.
- bin_data - Hex String - Serialization of the block header, all transactions within the block, the previous block hash, and the private key of the node that generated the block.
- transactions - Object - Transactions List of transactions in the block and additional information about each transaction:
- hash - Hex String - The transaction hash.
- contract_name - String - The name of the contract.
- params - Object - contract parameters, contract fields can be queried via ibax.getContractInfo.
- key_id - Number - The address of the account that signed the transaction.
- time - Number - transaction generation timestamp (unit: ms).
- type - Number - the type of the transaction.
- size - String - The transaction size.
Example
ibax.getKeyInfo
Returns a list of ecosystems with roles that are registered to the specified address.
Parameters
- account - String - Account Address
Return Value Object - Specify the address eco-list object
- account - String - Account Address
- ecosystems - Array - Eco-List
- ecosystem - String - Ecosystem id
- name - String - Ecosystem name
- digits - Number - Accuracy
- roles - Array - list of roles.
- id - String - role id
- name - String - Character name
Example
ibax.detailedBlock
Returns a detailed list of additional information about the transactions in the block.
Parameters
- Block or Hash - BlockOrHash - Block Height or Block Hash
Return Value Object - Get the block details object
header - Object - block header The block header contains the following fields.
- block_id - Number - the height of the block.
- time - Number - block generation timestamp.
- key_id - Number - the address of the account that signed the block.
- node_position - Number - The position of the node that generated the block in the honor node list.
- version - Number - the block structure version.
hash - Hex String - The block hash.
node_position - Number - The position of the node that generated the block in the honor node list.
key_id - Number - the address of the account that signed the block.
time - Number - block generation timestamp.
tx_count - Number - the number of transactions within the block.
size - String - the size of the block.
rollback_hash - Hex String - The block rollback hash.
merkle_root - Hex String - The merkle tree for this block transaction.
bin_data - Hex String - Serialization of the block header, all transactions within the block, the previous block hash, and the private key of the node that generated the block.
transactions - Array - Transactions List of transactions in the block and additional information about each transaction:
- hash - Hex String - The transaction hash.
- contract_name - String - The name of the contract.
- params - Object - contract parameters, contract fields can be queried via ibax.getContractInfo.
- key_id - Number - The address of the account that signed the transaction.
- time - Number - transaction generation timestamp (unit: ms).
- type - Number - the type of the transaction.
- size - String - The transaction size.
Example
ibax.maxBlockId
Get the highest block ID on the current node
Parameters
Return Value
- Block Id - Number - The highest block on the current node
Example
ibax.getKeysCount
Get the total number of addresses on the current node
Parameters
Return Value
- Count - Number - Total number of addresses
Example
ibax.getTxCount
Get the total number of transactions in the current node
Parameters
Return Value
- Count - Number - Total number of transactions
Example
ibax.getTransactionCount
Get the number of block transactions
Parameters
- block or hash - BlockOrHash - block height or block hash
Return Value
- Count - Number - Total number of blocks
Example
ibax.getBlocksCountByNode
Get the number of node location packing blocks
Parameters
nodePosition - Number - node subscript
consensusMode - Number - Consensus Mode, parameters (1: Creator Management Mode 2: DAO Governance Mode)
Return Value Object - Get the node subscript packing number object
Example
ibax.honorNodesCount
Get number of honor nodes
Parameters
Return Value
- Count - Number - number of nodes
Example
ibax.getEcosystemCount
Number of ecosystem acquisitions
Parameters
Return Value
- Count - Number - Ecosystem number
Example
ibax.ecosystemInfo
Access to ecosystem information
Parameters
- ecosystem id - Number - ecosystem ID
Return Value
- id - Number - Eco-ID
- name - String - Ecosystem name
- digits - Number - Accuracy
- token_symbol - String - Token symbols
- token_name - String - the name of the token
- total_amount - String - the number of issues (first issue, or
"0"
if not issued) - is_withdraw - Bool - destructible
true:destructible false:undestructible
- withdraw - String - amount of destruction (
"0"
if not destructible, or not destroyed) - is_emission - Bool - may be incremented
true:may be incremented false:may not be incremented
- emission - String - increment (
"0"
if no increment is available, or if no increment is available) - introduction - String - Eco Introduction
- logo - Number - ecoLogo Id (corresponds to Binary table id), available through the RESTFUL API
- creator - String - Eco-creator
Example
ibax.appParams
Returns a list of application parameters in the current or specified ecosystem
Authorization
Parameters
appid - Number - the application ID.
ecosystem - Number - Omitempty - Ecosystem ID;
If unspecified or 0, the parameters of the current ecosystem will be returned.
names - String - Omitempty - Filter the application parameter names.
A comma-separated list of names, e.g.: name1,name2
.
offset - Number - Omitempty The offset, default is 0.
limit - Number Omitempty The number of entries, default 100, max 100.
Return Value
Array - List of application parameters
- app_id - Number - Application ID
- list - Number - Each element of the array contains the following parameters
- id - String - parameter ID, unique;
- name - String - the name of the parameter;
- value - String - the parameter value;
- conditions - String - permissions to change parameters.
Example
ibax.getEcosystemParams
Get a list of ecosystem parameters
Authorization
Parameters
ecosystem - Number - Omitempty - Ecosystem ID
If 0 or no such parameter, default: current ecid.
names - String - Omitempty - The name of the filter parameter.
Comma-separated list of names, e.g.: name1,name2
The offset and limit parameters are invalid when there is a filter parameter.
offset - Number - Omitempty The offset, default is 0.
limit - Number Omitempty The number of entries, default 100, max 100.
Return Value
- list - Array - Each element of the array contains the following parameters:
- id - String - The id of the parameter, unique.
- name - String - The name of the parameter.
- value - String - The value of the parameter.
- conditions - String - permissions to change parameters.
Example
ibax.getTableCount
Returns a list of data tables for the current ecosystem.
Offset and number of entries can be set
Authorization
Parameters
offset - Number - Omitempty The offset, default is 0.
limit - Number Omitempty The number of entries, default 100, max 100.
Return Value
Example
ibax.getTable
Returns information about the current ecosystem request data table.
Authorization
Parameters
- tableName - String - Data table name
Return Value
name - String - The name of the data table.
insert - String - Add permission to add an entry.
new_column - String - Add new field permission.
update - String - Change entry permissions.
app_id - String - The application id.
conditions - String - Conditions for changing permissions.
columns - Array - Array of information related to data table fields:
- name - String - The name of the field.
- type - String - The field data type.
- perm - String - Permission to change the value of this field.
Example
ibax.getList
Returns the entry of the specified data table.
You can specify the columns to be returned.
You can set the offset and the number of entries.
You can set the query criteria.
Hex encoding of data tables of type BYTEA (byte arrays, hashes, byte code arrays)
Authorization
Parameters Object - Get the data table object
name - String - The name of the data table.
limit - Number - Omitempty The number of entries, default 25.
offset - Number - Omitempty The offset, default is 0.
order - String - Omitempty Sort by, default id ASC.
columns - String - Omitempty A comma-separated list of requested columns, if not specified, all columns will be returned.
The id column will be returned in all cases.
where - Object - Omitempty
Query criteria
Example:If you want to query id>2 and name = john
You can use where:{"id":{"$gt":2}, "name":{"$eq": "john"}}
For details, please refer to DBFind where syntax
Return Value
Example
ibax.getSections
Return to the tab of the current ecosystem list of table entries, you can set the offset and the number of entries.
If role_access field contains a list of roles and does not include the current role, no record will be returned.
The data in the title field will be replaced by the Accept-Language language resource in the request header.
Authorization
Parameters
- Object - Get the actions request object
limit - Number - Omitempty - The number of entries, default 25 entries.
offset - Number - Omitempty - The offset, default is 0.
lang - String - Omitempty -
This field specifies the multilingual resource code or localization, e.g. en, de. If the specified multilingual resource is not found, e.g. en-US, then search in the Multilingual Resources group, default: en.
Return Value
Example
ibax.getRow
Returns the entries of the specified data table in the current ecosystem. You can specify the columns to be returned.
Authorization
Parameters
tableName - String - The name of the data table.
id - Number - the ID of the entry.
columns - String - Omitempty
A comma-separated list of requested columns, if not specified, all columns will be returned.
If you do not filter, you can place a blank "".
The id column will be returned in all cases.
whereColumn - String - Omitempty - Find column name (only Number type columns can be found)
Return Value
- value- Object - object that receives column values
- id - String - The ID of the entry.
- ... - The sequence of requested columns.
Example
ibax.systemParams
Returns the list of platform parameters.
Authorization
Parameters
names - String Omitempty - A list of request parameters, separated by commas.
For example names="name1,name2"
.
offset - Number - Omitempty The offset, default is 0.
limit - Number Omitempty The number of entries, default 100, max 100.
Return Value
- list - Array - Each element of the array contains the following parameters:
- id - String - Unique id
- name - String - The name of the parameter.
- value - String - The value of the parameter.
- conditions - String - permissions to change parameters.
Example
ibax.history
Returns the changed records of the entries of the specified data table in the current ecosystem
Authorization
Parameters
- name - String - The name of the data table.
- tableId - Number - the ID of the entry.
Return Value
- list - Array - Each element of the array contains change records for the requested entry.
Example
Gets the current entry in the ecosystempages data table field.
Authorization
Parameters
- name - String - Specifies the name of the entry in the table.
Return Value
- id - Number - the ID of the entry.
- name - String - The name of the entry.
- value - String - The content.
- menu - String - Directory.
- nodesCount - Number - the number of nodes the page needs to validate
- app_id - Number - Application Id
- conditions - String - permissions to change parameters
Example
Gets the current entry in the ecosystem menu data table field.
Authorization
Parameters
- name - String - Specifies the name of the entry in the table.
Return Value
- id - Number - the ID of the entry.
- name - String - The name of the entry.
- title - String - The title.
- value - String - The content.
- conditions - String - permissions to change parameters
Example
ibax.getSnippetRow
Gets the current entry in the ecosystem snippet data table field.
Authorization
Parameters
- name - String - Specifies the name of the entry in the table.
Return Value
- id - Number - the ID of the entry.
- name - String - The name of the entry.
- value - String - The content.
- conditions - String - permissions to change parameters.
Example
ibax.getAppContent
Get application related information (including page, snippet, menu)
Authorization
Parameters
- id - Number - Application id
Return Value
snippets - Array - Array of code snippet information
- id - Number - id
- name - String - Code snippet name
pages - Array - Array of page information
- id - Number - id
- name - String - page name
contracts - Array - an array of contract information
- id - Number - id
- name - String - Contract name
Example
ibax.getMember
Get member information
Parameters
Return Value
- id - Number - member id
- member_name - String - Name
- image_id - Number - Avatar id
- member_info - String - Introduction
Example
ibax.getContracts
Get the list of contracts in the current ecosystem, you can set the offset and the number of entries.
Authorization
Parameters
- offset - Number - Omitempty The offset, default is 0.
- limit - Number - Omitempty The number of entries, default 25.
Return Value
Example
ibax.getContractInfo
Returns information about the specified contract.
Authorization
Parameters
- contractName - String - The name of the contract. The format is
@ecosystem_id%%contractName%
, e.g. @1contractName (the specified eco1contract name contractName) or contractName (the current eco-contract name contractName).
Return Value
- id - Number - the contract ID in the VM.
- name - String - Contract name with ecosystem ID
@1MainCondition
. - state - Number - the ecosystem ID to which the contract belongs.
- walletid - String - the address of the account to which the contract is bound
- tokenid - String - the ecosystem ID of the pass that is used as the payment for the contract.
- address - String - the address of the contract-bound wallet
XXXX-... -XXXX
. - tableid - String - ID of the entry in the contracts table where the contract is located.
- fields - Array - array containing structural information for each parameter of the contract data section:
- name - String - The name of the parameter.
- type - String - The type of the parameter.
- optional - Bool - parameter options,
true
means optional parameters, false
means mandatory parameters.
Example
ibax.sendTx
Receives the transactions in the parameters and adds them to the transaction queue, returning a transaction hash if the request is executed successfully. This hash yields the corresponding transaction within the block and is included in the error text message in case of an error response.
Authorization
Parameters
- Object - Transaction data object
- tx_key - String - the content of the transaction, this parameter can specify any name and supports receiving multiple transactions.
Return Value
- hashes - Array - transaction hash arrays:
- tx1 - String - Hash of transaction 1.
- txN - String - Hash of transaction N.
Example
ibax.txStatus
Gets the block ID and error message of the specified transaction hash. If the return value of the block ID and error text message is null, then the transaction is not yet contained in the block.
Authorization
Parameters
- hashes - String - transaction hash, split using
,
.
Return Value
- hash - Object - The transaction hash.
blockid - String - returns the block ID if the transaction was executed successfully;
If the transaction execution fails, blockid will be 0
, and the corresponding block ID will be returned if the transaction execution error is penalized.
result - String - Returns the result of the transaction via the $result variable.
errmsg - Object - Omitempty Returns an error text message if the execution of the transaction failed.
- type - String - Error type
- error - String - error message
penalty - Number - if the transaction execution fails, (0: no penalty 1: penalty)
Example
ibax.txInfo
Returns information about the transaction for the specified hash, including the block ID and the number of confirmations. If optional parameters are specified, the contract name and its associated parameters can also be returned.
Parameters
hash - String - The transaction hash.
contractinfo - Bool Omitempty - Contract detail parameter identifier, get contract details related to this transaction, default is false
Return Value
blockid - Number - The block ID containing the transaction.
If the value is 0
, no transactions are found for this hash.
If the transaction occurred on the current node, it can be obtained via ibax.txStatus
confirm - Number - the number of node confirmations for this block blockid.
data - Object - Returns contract details if contentinfo=true
is specified. null if not specified
- block_id - Number - block height
- block_hash - String - block_hash
- address - String - transaction creation address
- ecosystem - String - transaction sending ecid
- hash - String - transaction hash
- expedite - String - expedited fee, or "" if not available
- contract_name - String - Contract name
- params - Object - contract parameters, contract fields can be queried via ibax.getContractInfo
- created_at - Number - when the transaction was created
- size - String - transaction size unit: B;KiB;MiB;GiB;TiB
- status - String - status (0:success 1:penalty)
Example
ibax.txInfoMultiple
Returns transaction-related information for the specified hash list.
Parameters
hashes - Array - A list of transaction hashes.
contractinfo - Bool Omitempty - Contract detail parameter identifier, get contract details related to this transaction, default is false
Return Value
- results - Array - Data dictionary with transaction hash as key and transaction details as value.
- hash - String - The transaction hash.
- blockid - Number - The block ID containing the transaction. if the value is
0
, then no transaction was found for that hash. - confirm - Number - the number of confirmations for this block blockid.
- data - Object - If
contentinfo=true
is specified, the contract details are returned to this parameter. null when not specified
- block_id- Number - Block height
- block_hash - String - block_hash
- address - String - transaction creation address
- ecosystem - String - transaction sending ecid
- hash - String - transaction hash
- expedite - String - expedited fee, or "" if not available
- contract_name - String - Contract name
- params - Object - contract parameters, contract fields can be queried via ibax.getContractInfo
- created_at - Number - when the transaction was created
- size - String - transaction size unit: B;KiB;MiB;GiB;TiB
- status - String - status (0:success 1:penalty)
Example
ibax.getPageValidatorsCount
Returns the number of nodes to be validated for the specified page.
Parameters
- name - String - page name in the format
@ecosystem_id%%%page_name%
, e.g. @1params_list (specifying ecosystem 1 page name params_list) or params_list (current ecosystem page name params_list)
Return Value
- validate_count - Number - Specifies the number of nodes to be validated by the page.
Example
ibax.getPage
Gets the tree of code JSON objects for the specified page name, which is the result of processing by the templating engine.
Authorization
Parameters
name - String - the name of the page with the ecosystem ID in the format @ecosystem_id%%page_name%
, for example @1main_page
.
If you don't have an ecosystem ID, the default is to find the current ecosystem page, e.g. main_page
Return Value
menu - String - The name of the menu to which the page belongs.
menutree - Array - JSON object tree of the page's menus.
tree - Array - page JSON object tree.
Example
Gets the tree of code JSON objects for the specified menu name, which is the result of processing by the template engine.
Authorization
Parameters
- name - String -
Menu name with ecosystem ID in the format @ecosystem_id%%%menu_name%
, e.g.
@1main_menu
.
If you don't bring the ecosystem ID, the menu of the current ecosystem will be found by default, for example
main_menu
Return Value
Example
ibax.getSource
Returns a tree of coded JSON objects for the specified page name. Does not execute any functions or receive any data. The returned JSON object tree corresponds to the page template and can be used in the visual page designer. If the page is not found, a 404 error is returned.
Authorization
Parameters
- name - String -
Page name with ecosystem ID in the format
@ecosystem_id%%%page_name%
, for example @1main_page
.
If you don't have an ecosystem ID, the default is to find the current ecosystem page e.g. main_page
Return Value
- tree - Array - JSON object tree for the page.
Example
ibax.getPageHash
Returns a SHA256 hash of the specified page name, or a 404 error if the page is not found.
To receive the correct hash when making requests to other nodes, you must also pass the ecosystem,key_id,role_id parameter. To receive pages from other ecosystems, the ecosystem ID must be prefixed to the page name. For example: @2mypage
.
Parameters
name - String - The name of the page with the ecosystem ID. The format is @ecosystem_id%%%page_name%
, e.g. @1main_page
, you can specify the eco ID
ecosystem - Number - Omitempty Ecosystem ID.
Object - Omitempty Get the specified page object
- key_id - String - The account address.
- role_id - String - The role ID.
Return Value
- Object -
- hash - String - Hexadecimal hash.
Example
ibax.getContent
Returns the number of JSON objects for the page code from the template parameter, if the optional parameter source Specified as true
, this JSON object tree does not perform any functions and receive data. This JSON object tree can be used in the visual page designer.
Parameters
- Object
template - String - page code.
source - Bool - If specified as true
, the JSON object tree does not perform any functions and receives data.
Return Value
- tree - Object - JSON object tree.
Example
ibax.getBlockInfo
Returns information about the specified block ID.
Parameters
- id - Number - the height of the block.
Return Value
hash - String - The block hash value.
key_id - Number - the address of the account that signed the block.
time - Number block generation timestamp.
tx_count - Number - the total number of transactions within the block.
rollbacks_hash - String - The block rollback hash.
node_position - Number - The position of the block in the honor node list.
consensus_mode Number - Consensus mode, parameters (1: creator management mode 2: DAO governance mode)
Example
ibax.getConfig
Get the host address and port of centrifugo
Parameters
Return Value
- centrifugo - String - Omitempty host address and port of centrifugo Result format
http://address:port
, e.g.: http://127.0.0.1:8100
.
Example
net.getNetwork
Get node information
Parameters
Return Value
- network_id - String - The network identifier.
- centrifugo_url - String - centrifugo message service address
- test - Bool - whether it is a test chain
- private - Bool - whether the chain is private
- honor_nodes - Object - List of honor nodes
- tcp_address - String - tcp address
- api_address - String - api address
- public_key - String - node public key
- unban_time - String - Unlock time
Example
net.status
Get the current node status
Parameters
Return Value
- status - String - Node Status
"node server status is running" - the node is running
"node server is updating" - node is being updated
"node server is stopped" - node suspended
Example
rpc.modules
Get the currently registered JSON-RPC interface
Parameters
Return Value
- Array - JSON-RPC interface array
Example
admin.startJsonRpc
Can be used to switch between JSON-RPC change namespace services
Parameters
- methods - String - JSON-RPC module, default: "ibax,net"
Return Value
Example
admin.stopJsonRpc
Close the JSON-RPC service
Parameters
Return Value
Example
debug.getNodeBanStat
Get node disable status
Parameters
Return Value node_position - Number - node subscript
status - Bool - Disable status, true
ban status, false
not disabled
Example
debug.getMemStat
Get the current node memory usage
Parameters
Return Value
- alloc - Number - Number of bytes requested and still in use
- sys - Number - Number of bytes fetched from the system
Example