RESTFUL API
ELA Node
uses the 2*334
port to provide the following interface services:
/api/v1/node/connectioncount
: Returns the number of nodes to which the node is connectedExample:
/api/v1/node/state
: Returns status of the nodeExample:
/api/v1/block/height
: Returns the block height of the nodeExample:
/api/v1/transactionpool
: Returns various information about the TX mempoolExample:
/api/v1/restart
: Restart the restful service/api/v1/block/hash/<height>
: Returns the blockhash
about the given blockheight
Example:
/api/v1/block/details/height/<height>
: Returns information about the given blockheight
Example:
/api/v1/block/details/hash/<hash>
: Returns information about the given blockhash
Example:
/api/v1/confirm/details/height/<height>
: Returns information about the given confirm of blockheight
Example:
/api/v1/confirm/details/hash/<hash>
: Returns information about the given confirm of blockhash
Example:
/api/v1/block/transactions/height/<height>
: Returns allhash
es of the transactions in the block according to the blockheight
Example:
/api/v1/transaction/<hash>
: Returns information about the given transactionhash
Example:
/api/v1/asset/balances/<addr>
: Returns the balance of the addressExample:
/api/v1/asset/<hash>
: Always return ELA asset information.
Deprecated: May be removed in the next version.
/api/v1/asset/utxos/<addr>
: Returns theUTXO
s according to the given addressExample:
/api/v1/asset/balance/<addr>/<assetid>
: Returns the balance about the given address and AssetID
Deprecated: May be removed in the next version.
Example:
/api/v1/asset/utxo/<addr>/<assetid>
: Returns the UTXO(s) according to the given address and AssetID
Deprecated: May be removed in the next version.
/api/v1/transaction
: Broadcasts the transaction data to the nodeExample:
The generation of the data parameter value (the signed transaction data) in this interface can be done in two ways:
Use the ela-cli command line tool, examples are as follows
Please replace the parameter values of
--from
and--to
in the example with the actual ELA Address.Here you need to enter the password of your local wallet. The long string of hexadecimal characters returned by this command is the signed transaction data.
Use the relevant tools provided by the Elastos.ELA.Utilities.Java tool library to generate specific referenced to the documentation of the repository.
Last updated