Native Api

Blockchain API

73min

abci_info - Get application description information

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc: JSONRPC Version, fixed as "2.0"
  • id: ID number of API request
  • result: Result object
    • response: Response result
      • data: Application information
      • last_block_height: Highest block
      • ast_block_app_hash: Last block application hash

Sample code

request:

Curl


response:

JSON


block - Get the data of the specified block

parameter

height - The height of the block to be queried, int64, optional, default value: 0, which means the latest block

return value

Return a JSON object, the structure is as follows:

  • block_hash: Block hash
    • block: Block information
      • header: Block header
        • version: Block version
          • block: The version number of the block
          • app: app version number
        • chain_id: ID number of the chain
        • height: Block height
        • round_received: Receive round
        • last_block_id: Previous block
          • hash: Block hash
        • timestamp: time
        • validators_hash: Validator hash
        • next_validators_hash: Next validator hash
        • consensus_hash: Consensus hash
        • last_results_hash: The result of the previous hash
        • frame_hash: Hash in consensus state
        • txs_hash: txs hash
        • app_hash: app hash
        • receipts_hash: Receiver's hash
      • txs: Transaction set
      • receipts:Recipient
        • validator: Verifier
        • event_cnt: number of events
        • tx_cnt: tx number
      • signatures: Signature information
        • validator: Verifier
        • sig: Signature information

Sample code

request:

Curl


response:

JSON


block_results - Get the ABCI result of the specified block

parameter

height - The height of the block to be queried, int64, optional, default value: 0, which means the latest block

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • error:Error description information
  • result:Application information results

Sample code

request:

Curl


response:

JSON


blockchain - Query blockchain information

parameter

minHeight - Starting block height maxHeight - Cutoff block height

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • error:Error description information
  • result:Application information results

Sample code

request:

JSON


response:

JSON


commit - Query submission data

TODO

consensus_params - Get consensus parameters

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result object
    • block_height: Block height
    • consensus_params: Consensus parameters
      • event: event max_bytes: Event size time_iota_ms: Minimum time unit
      • validator: Verifier pub_key_types: Digital signature algorithm for verifier's public key

Sample code

request:

Curl


response:

JSON


consensus_state - Query consensus status

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result Height
    • round_state:
      • height: Block height
      • priv_validator: Verifier private key
      • validators_set: Validator set
        • validators: List of validators
        • address: Verifier address
          • pub_key: Verifier public key type: Digital signature algorithm for verifier's public key value: Public key
          • voting_power: Voting rights
          • proposer_priority: Applicant's priority
        • proposer: Proposer
          • address: Proposer address
          • pub_key: Proposer public key type: Digital signature algorithm of proponent's public key value: Public key
          • voting_power: Voting rights
          • proposer_priority: Applicant's priority

Sample code

request:

Curl


response:

JSON


genesis - Get Genesis Document

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: result
    • genesis: Founding Information
      • genesis_time: time
      • chain_id: Chain ID number
      • consensus_params: Consensus parameters
        • event: event information max_gas: How much gas can an event put in, currently this number is sent from the application side. max_bytes: The size of an event is 128m time_iota_ms: The block interval is 1s, currently configured in config.toml
        • validator: Verifier pub_key_types: Verifier signature algorithm ed25519
      • app_hash:app's hash code
      • app_state: App status information gov: Community information mint: Inflation information crisis: Fixed rate information staking: Configuration information of the staking module bank: Configuration information of bank module slashing: Configuration information of the slashing module supply: Configuration information of the supply module params: Parameter information auth: Authentication information punishment: Penalize nodes that do not produce blocks distribution: Distribute block rewards iam: Configuration information of iam module genutil: Generating transaction information for the genesis block

Sample code

request:

Curl


response:

JSON


health - Query node health status

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result object

Sample code

request:

Curl


reponse:

JSON


net_info - Query node network status

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result:result
    • listening: Whether the node is in the listening state
    • listeners: Node monitoring address array
    • n_peers: Number of peer nodes
    • peers: Peer node array

Sample code

request:

Curl


response:

JSON


num_unconfirmed_txs - Check unconfirmed transactions

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request -result:result
    • n_txs: Number of unconfirmed transactions
    • txs: Unconfirmed transaction array

Sample code

request:

Curl


response:

JSON


status - Query chain status

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result:
    • node_info: Node information
    • sync_info: Synchronization information
    • validator_info: Verify node information

Sample code

request:

Curl


response:

JSON


tx - Get specified transaction

parameter

hash - Transaction hash, byte array

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result Object
    • hash: Hash
    • height: Block height
    • index: index
    • tx_result: The result of the transaction code: 0 data: "" log: Log output info: information gasWanted: The amount of gas that needs to be consumed gasUsed: Gas used events: Event set codespace: "" tx:

Sample code

request:

Curl


response:

JSON


unconfirmed_txs - Get unconfirmed transactions

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result object n_txs: Number of unconfirmed transactions txs: Unconfirmed transaction array

Sample code

request:

Curl


response:

JSON


validators - Return to the verification node set

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result object
    • block_height: Block height
    • validators: Verifier
      • address: Verifier address
        • pub_key: Verifier public key type: Signature algorithm value: public key
        • voting_power: Voting rights
        • proposer_priority: Applicant's priority

Sample code

request:

Curl


response:

JSON


node_info - Query node data

parameter

no

return value

Return a JSON object, the structure is as follows:

  • jsonrpc:JSONRPC version, fixed as "2.0"
  • id:ID number of API request
  • result: Result object
    • node_info:
      • protocol_version: Protocol version number p2p: p2p protocol version number block: Protocol version number of block app: Protocol version number of app
      • id: Node id
      • listen_addr: TCP listening address and port
      • network: Network number
      • version: Node version
      • channels: Channel data
      • moniker: Monitor the network
      • other: tx_index: on is to open tx_index, off is to close rpc_address: rpc's IP and listening port
    • application_version: App version name: Application Name server_name: name of server client_name: Client name version: version number commit: Submission number go: Go version and operating platform

Sample code

request:

Curl


response:

JSON


syncing - Check syncing status

parameter

no

return value

Return a JSON object, the structure is as follows:

  • syncing: Synchronization is true, asynchronous is false

Sample code

request:

Curl


response:

JSON


blocks/latest - Query the highest block information

parameter

no

return value

Return a JSON object, the structure is as follows:

  • block_hash: Block hash
    • block: Block information
      • header: Block header
        • version: Block version
          • block: The version number of the block
          • app: app version number
        • chain_id: ID number of the chain
        • height: Block height
        • round_received: Receive round
        • last_block_id: Previous block
          • hash: Block hash
        • timestamp: time
        • validators_hash: Validator hash
        • next_validators_hash: Next validator hash
        • consensus_hash: Consensus hash
        • last_results_hash: The result of the previous hash
        • frame_hash: Hash in consensus state
        • txs_hash: txs hash
        • app_hash: app hash
        • receipts_hash: Receiver's hash
      • txs: Transaction set
      • receipts:Recipient
        • validator: Verifier
        • event_cnt: number of events
        • tx_cnt: tx number
      • signatures: Signature information
        • validator: Verifier
        • sig: Signature information

Sample code

request:

Curl


response:

JSON


blocks - Query specified block height information

parameter

height - The height of the block to be queried, int64, optional, default value: 0, which means the latest block

return value

Return a JSON object, the structure is as follows:

  • block_hash: Block hash
    • block: Block information
      • header: Block header
        • version: Block version
          • block: The version number of the block
          • app: app version number
        • chain_id: ID number of the chain
        • height: Block height
        • round_received: Receive round
        • last_block_id: Previous block
          • hash: Block hash
        • timestamp: time
        • validators_hash: Validator hash
        • next_validators_hash: Next validator hash
        • consensus_hash: Consensus hash
        • last_results_hash: The result of the previous hash
        • frame_hash: Hash in consensus state
        • txs_hash: txs hash
        • app_hash: app hash
        • receipts_hash: Receiver's hash
      • txs: Transaction set
      • receipts:Recipient
        • validator: Verifier
        • event_cnt: number of events
        • tx_cnt: tx number
      • signatures: Signature information
        • validator: Verifier
        • sig: Signature information

Sample code

request:

Curl


response:

JSON


validatorsets/latest - Query the verifier information of the highest block

parameter

no

return value

Return a JSON object, the structure is as follows:

  • height: Block height
    • result: result
      • block_height: "1732",
      • validators: Verifier information
        • address: Verifier address
        • pub_key: Verifier public key
        • proposer_priority: Applicant's priority
        • voting_power: Voting rights

Sample code

request:

JS


response:

JSON


validatorsets - Query the verifier information of the specified block height

parameter

height - The height of the block to be queried, int64, optional, default value: 0, which means the latest block

return value

Return a JSON object, the structure is as follows:

  • height: Block height
    • result: result
      • block_height: "1732",
      • validators: Verifier information
        • address: Verifier address
        • pub_key: Verifier public key
        • proposer_priority: Applicant's priority
        • voting_power: Voting rights

Sample code

request:

Curl


response:

JSON






Updated 25 Mar 2024
Doc contributor
Did this page help you?