Main Chain JSON-RPC API
The ELA main chain uses a custom JSON-RPC interface that is not Ethereum-compatible. All calls use POST with a JSON body containing method, params, and id. The jsonrpc field is optional; if omitted, the node defaults to "2.0".
{
"method": "getblockcount",
"params": {},
"id": 1
}
Connection
| Network | URL | Notes |
|---|---|---|
| Mainnet | https://api.elastos.io/ela | Public endpoint |
| Testnet | https://api-testnet.elastos.io/ela | Public testnet endpoint |
| Self-hosted | http://localhost:20336 | Default JSON-RPC port |
Block & Transaction
getbestblockhash
Returns the hash of the most recent block on the longest chain.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| blockhash | string | Hash of the tip block |
Example
// Request
{
"method": "getbestblockhash",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"error": null
}
getblockhash
Returns the block hash at a given height.
Parameters
| Name | Type | Description |
|---|---|---|
| height | integer | Block height |
Result
| Name | Type | Description |
|---|---|---|
| blockhash | string | Hash of the block at the specified height |
Example
// Request
{
"method": "getblockhash",
"params": {
"height": 100
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "3893390c9fe372eab5b356a02c54d3baa41fc48918bbdbd7f4f12f9a9f4c4dc4",
"error": null
}
getblock
Returns block information for a given block hash.
Parameters
| Name | Type | Description |
|---|---|---|
| blockhash | string | The block hash |
| verbosity | integer | 0 = serialized hex string, 1 = JSON summary with tx hashes, 2 = JSON with full transaction objects |
Use verbosity 0 when you only need the raw hex. Use 1 for block metadata with transaction IDs. Use 2 to get full transaction objects embedded in the block response — this avoids separate getrawtransaction calls.
Result (verbosity 1)
| Name | Type | Description |
|---|---|---|
| hash | string | Block hash |
| confirmations | integer | Number of confirmations |
| size | integer | Block size in bytes |
| strippedsize | integer | Block size excluding witness data |
| weight | integer | Block weight |
| height | integer | Block height |
| version | integer | Block version |
| versionhex | string | Block version in hex |
| merkleroot | string | Merkle root of transactions |
| tx | array<string> | Transaction hashes in this block |
| time | integer | Block timestamp (Unix) |
| mediantime | integer | Median time of the previous 11 blocks |
| nonce | integer | Nonce used in mining |
| bits | integer | Compact target |
| difficulty | string | Mining difficulty |
| chainwork | string | Cumulative chain work in hex |
| previousblockhash | string | Hash of the previous block |
| nextblockhash | string | Hash of the next block (if any) |
| auxpow | string | Auxiliary proof-of-work data (from merged mining) |
Example
// Request
{
"method": "getblock",
"params": {
"blockhash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"verbosity": 1
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"hash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"confirmations": 5,
"size": 498,
"strippedsize": 498,
"weight": 1992,
"height": 171454,
"version": 0,
"versionhex": "00000000",
"merkleroot": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"tx": [
"6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2"
],
"time": 1620000000,
"mediantime": 1619999400,
"nonce": 0,
"bits": 486801407,
"difficulty": "1234567.89012345",
"chainwork": "0000000000000000000000000000000000000000000000000000012345678901",
"previousblockhash": "8fc39d0d18d2341bba75a74d3f0bab87bcc585aba87de3e05f3dd691ae0b0e1a",
"nextblockhash": "aa51e400f3e9faa52e58de04a7e9dbb64db93a1c6c4bb2b32be98e690e5206da",
"auxpow": "..."
},
"error": null
}
getblockcount
Returns the current block height of the node's longest chain.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| height | integer | Current block height |
Example
// Request
{
"method": "getblockcount",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": 171454,
"error": null
}
getblockbyheight
Returns full block information for a given height. The result schema matches getblock with verbosity 2 (includes full transaction objects).
Parameters
| Name | Type | Description |
|---|---|---|
| height | uint32 | Block height |
Result
Same as getblock with verbosity 2.
Example
// Request
{
"method": "getblockbyheight",
"params": {
"height": 171454
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"hash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"confirmations": 5,
"size": 498,
"strippedsize": 498,
"weight": 1992,
"height": 171454,
"version": 0,
"versionhex": "00000000",
"merkleroot": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"tx": [
{
"txid": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"hash": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"size": 254,
"vsize": 254,
"version": 0,
"type": 0,
"payloadversion": 0,
"payload": {},
"locktime": 171454,
"vin": [],
"vout": [
{
"value": "1.50000000",
"n": 0,
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"assetid": "a3d0eaa466df74983b5d7c543de6904f4c9418ead5ffd6d25814234a96db37b0",
"outputlock": 0
}
],
"blockhash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"confirmations": 5,
"time": 1620000000,
"blocktime": 1620000000,
"attributes": [],
"programs": []
}
],
"time": 1620000000,
"mediantime": 1619999400,
"nonce": 0,
"bits": 486801407,
"difficulty": "1234567.89012345",
"chainwork": "0000000000000000000000000000000000000000000000000000012345678901",
"previousblockhash": "8fc39d0d18d2341bba75a74d3f0bab87bcc585aba87de3e05f3dd691ae0b0e1a",
"nextblockhash": "aa51e400f3e9faa52e58de04a7e9dbb64db93a1c6c4bb2b32be98e690e5206da",
"auxpow": "..."
},
"error": null
}
getrawtransaction
Returns raw transaction data. When verbose is true, returns a decoded JSON object; otherwise returns the serialized hex string.
Parameters
| Name | Type | Description |
|---|---|---|
| txid | string | Transaction hash |
| verbose | bool | true for decoded JSON, false for hex string |
Result (verbose = true)
| Name | Type | Description |
|---|---|---|
| txid | string | Transaction ID |
| hash | string | Transaction hash |
| size | integer | Transaction size in bytes |
| vsize | integer | Virtual size |
| version | integer | Transaction version |
| locktime | integer | Lock time |
| vin | array | Array of inputs |
| vout | array | Array of outputs, each with value, n, address, assetid, outputlock |
| blockhash | string | Block containing this transaction |
| confirmations | integer | Number of confirmations |
| time | integer | Transaction timestamp |
| blocktime | integer | Block timestamp |
| type | integer | Transaction type |
| payloadversion | integer | Payload version |
| payload | object | Transaction payload |
| attributes | array | Transaction attributes |
| programs | array | Transaction programs (scripts) |
Example
// Request
{
"method": "getrawtransaction",
"params": {
"txid": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"verbose": true
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"txid": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"hash": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"size": 254,
"vsize": 254,
"version": 0,
"type": 0,
"payloadversion": 0,
"payload": {},
"locktime": 171454,
"vin": [
{
"txid": "0000000000000000000000000000000000000000000000000000000000000000",
"vout": 65535,
"sequence": 4294967295
}
],
"vout": [
{
"value": "1.50000000",
"n": 0,
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"assetid": "a3d0eaa466df74983b5d7c543de6904f4c9418ead5ffd6d25814234a96db37b0",
"outputlock": 0
}
],
"blockhash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"confirmations": 5,
"time": 1620000000,
"blocktime": 1620000000,
"attributes": [],
"programs": []
},
"error": null
}
sendrawtransaction
Broadcasts a signed, serialized transaction to the network.
Parameters
| Name | Type | Description |
|---|---|---|
| data | string | Hex-encoded signed transaction |
Result
| Name | Type | Description |
|---|---|---|
| hash | string | Transaction hash of the broadcast transaction |
Example
// Request
{
"method": "sendrawtransaction",
"params": {
"data": "0200010013313637..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"error": null
}
getrawmempool
Returns all transaction hashes currently in the memory pool.
Parameters
| Name | Type | Description |
|---|---|---|
| state | string | (optional) Pass "all" to return full transaction details instead of just hashes |
Result
| Name | Type | Description |
|---|---|---|
| (default) | array<string> | Array of transaction hashes |
| (state="all") | array<object> | Full transaction details |
Example
// Request
{
"method": "getrawmempool",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcdef"
],
"error": null
}
createrawtransaction
Creates an unsigned raw transaction from the given inputs and outputs.
Parameters
| Name | Type | Description |
|---|---|---|
| inputs | array | Array of {"txid": "...", "vout": N} objects |
| outputs | array | Array of {"address": "...", "amount": "..."} objects |
| locktime | integer | Transaction lock time |
Result
| Name | Type | Description |
|---|---|---|
| data | string | Hex-encoded unsigned transaction |
Example
// Request
{
"method": "createrawtransaction",
"params": {
"inputs": [
{
"txid": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"vout": 0
}
],
"outputs": [
{
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"amount": "1.00000000"
}
],
"locktime": 0
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0200010013313637...",
"error": null
}
signrawtransactionwithkey
Signs a raw transaction with the provided private keys.
Parameters
| Name | Type | Description |
|---|---|---|
| data | string | Hex-encoded raw transaction |
| codes | string | Redeem script(s) |
| privkeys | string | Private key(s) for signing |
Result
| Name | Type | Description |
|---|---|---|
| data | string | Hex-encoded signed transaction |
Example
// Request
{
"method": "signrawtransactionwithkey",
"params": {
"data": "0200010013313637...",
"codes": "2102...",
"privkeys": "5JYc..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0200010013313637...signed...",
"error": null
}
decoderawtransaction
Decodes a raw transaction hex string into a human-readable JSON object.
Parameters
| Name | Type | Description |
|---|---|---|
| data | string | Hex-encoded raw transaction |
Result
| Name | Type | Description |
|---|---|---|
| txid | string | Transaction ID |
| hash | string | Transaction hash |
| size | integer | Size in bytes |
| vsize | integer | Virtual size |
| version | integer | Transaction version |
| type | integer | Transaction type |
| payloadversion | integer | Payload version |
| payload | object | Transaction payload |
| locktime | integer | Lock time |
| vin | array | Inputs |
| vout | array | Outputs |
| attributes | array | Attributes |
| programs | array | Programs |
Example
// Request
{
"method": "decoderawtransaction",
"params": {
"data": "0200010013313637..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"txid": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"hash": "6c42a2ee69444c0fe684e0be82e38ce67a32cb2d66ae2c72ef21eeb5c073f4c2",
"size": 254,
"vsize": 254,
"version": 0,
"type": 0,
"payloadversion": 0,
"payload": {},
"locktime": 0,
"vin": [
{
"txid": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"vout": 0,
"sequence": 4294967295
}
],
"vout": [
{
"value": "1.00000000",
"n": 0,
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"assetid": "a3d0eaa466df74983b5d7c543de6904f4c9418ead5ffd6d25814234a96db37b0",
"outputlock": 0
}
],
"attributes": [],
"programs": []
},
"error": null
}
Address & UTXO
getreceivedbyaddress
Returns the total amount received by the given address (confirmed transactions only).
Parameters
| Name | Type | Description |
|---|---|---|
| address | string | ELA address |
Result
| Name | Type | Description |
|---|---|---|
| amount | string | Total ELA received |
Example
// Request
{
"method": "getreceivedbyaddress",
"params": {
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "15.23400000",
"error": null
}
listunspent
Returns unspent transaction outputs (UTXOs) for the specified addresses.
Parameters
| Name | Type | Description |
|---|---|---|
| addresses | array<string> | List of ELA addresses |
| utxotype | string | (optional) "mixed" (default), "vote", or "normal" |
Result
| Name | Type | Description |
|---|---|---|
| result | array | Array of UTXO objects with txid, vout, address, amount, confirmations |
Example
// Request
{
"method": "listunspent",
"params": {
"addresses": [
"EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo"
]
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"txid": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"vout": 0,
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"amount": "5.00000000",
"confirmations": 120,
"assetid": "a3d0eaa466df74983b5d7c543de6904f4c9418ead5ffd6d25814234a96db37b0",
"outputlock": 0
}
],
"error": null
}
getutxosbyamount
Returns UTXOs whose total value is greater than or equal to the specified amount.
Parameters
| Name | Type | Description |
|---|---|---|
| address | string | ELA address |
| amount | string | Minimum total value required |
| utxotype | string | (optional) "mixed", "vote", or "normal" |
Result
| Name | Type | Description |
|---|---|---|
| result | array | Array of UTXO objects sufficient to cover the requested amount |
Example
// Request
{
"method": "getutxosbyamount",
"params": {
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"amount": "2.50000000"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"txid": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"vout": 0,
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo",
"amount": "5.00000000",
"confirmations": 120
}
],
"error": null
}
getamountbyinputs
Calculates the total value of the specified inputs.
Parameters
| Name | Type | Description |
|---|---|---|
| inputs | string | Hex-encoded input data |
Result
| Name | Type | Description |
|---|---|---|
| amount | string | Total ELA value of the inputs |
Example
// Request
{
"method": "getamountbyinputs",
"params": {
"inputs": "0201a1b2c3d4..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "10.50000000",
"error": null
}
Node Info
getinfo
Returns general information about the node.
Deprecated — Use
getnodestatefor more detailed information.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| version | integer | Node software version |
| height | integer | Current block height |
| connections | integer | Number of connected peers |
Example
// Request
{
"method": "getinfo",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"version": 10000,
"height": 171454,
"connections": 25
},
"error": null
}
getnodestate
Returns detailed information about the node's state, including compile info, ports, and connected peers.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| compile | string | Node compile version string |
| height | integer | Current block height |
| version | integer | Protocol version |
| services | string | Supported service flags |
| port | integer | P2P listen port |
| rpcport | integer | JSON-RPC port |
| restport | integer | REST API port |
| wsport | integer | WebSocket port |
| neighbors | array | Connected peers (see below) |
Neighbor fields
| Name | Type | Description |
|---|---|---|
| netaddress | string | Peer IP and port |
| services | string | Peer service flags |
| relaytx | bool | Whether the peer relays transactions |
| lastsend | string | Timestamp of last message sent |
| lastrecv | string | Timestamp of last message received |
| conntime | string | Connection established time |
| timeoffset | integer | Time offset from local clock (seconds) |
| version | integer | Peer protocol version |
| inbound | bool | Whether this is an inbound connection |
| startingheight | integer | Peer's block height when connected |
| lastblock | integer | Peer's latest known block height |
| lastpingtime | string | Last ping timestamp |
| lastpingmicros | integer | Last ping round-trip in microseconds |
Example
// Request
{
"method": "getnodestate",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"compile": "v0.9.2-48-gd1e2f3a",
"height": 171454,
"version": 30000,
"services": "SFNodeNetwork|SFTxFiltering|SFNodeBloom",
"port": 20338,
"rpcport": 20336,
"restport": 20334,
"wsport": 20335,
"neighbors": [
{
"netaddress": "192.0.2.1:20338",
"services": "SFNodeNetwork|SFTxFiltering|SFNodeBloom",
"relaytx": false,
"lastsend": "2024-01-15 10:30:00",
"lastrecv": "2024-01-15 10:30:01",
"conntime": "2024-01-14 08:00:00",
"timeoffset": 0,
"version": 30000,
"inbound": false,
"startingheight": 171400,
"lastblock": 171454,
"lastpingtime": "2024-01-15 10:29:50",
"lastpingmicros": 12345
}
]
},
"error": null
}
getconnectioncount
Returns the number of peers connected to the node.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| count | integer | Number of connected peers |
Example
// Request
{
"method": "getconnectioncount",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": 25,
"error": null
}
getneighbors
Returns information about connected peers.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| result | array | Array of peer info objects |
Example
// Request
{
"method": "getneighbors",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"netaddress": "192.0.2.1:20338",
"services": "SFNodeNetwork|SFTxFiltering|SFNodeBloom",
"inbound": false,
"version": 30000,
"lastblock": 171454
}
],
"error": null
}
setloglevel
Changes the logging verbosity of the node at runtime.
Parameters
| Name | Type | Description |
|---|---|---|
| level | integer | Log level (0 = debug, 1 = info, 2 = warn, 3 = error, 4 = fatal, 5 = off) |
Result
| Name | Type | Description |
|---|---|---|
| result | string | Confirmation message |
Example
// Request
{
"method": "setloglevel",
"params": {
"level": 1
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "log level has been set to 1",
"error": null
}
BPoS & Validators
listproducers
Returns a paginated list of block producers (validators) with optional state filtering.
Parameters
| Name | Type | Description |
|---|---|---|
| start | integer | Start index for pagination |
| limit | integer | Maximum number of results |
| state | string | Filter: "all", "pending", "active", "inactive", "canceled", "illegal", "returned" |
Result
| Name | Type | Description |
|---|---|---|
| ownerpublickey | string | Owner's public key |
| nodepublickey | string | Node's public key |
| nickname | string | Producer name |
| url | string | Producer info URL |
| location | integer | Location code |
| active | bool | Whether the producer is currently active |
| votes | string | Number of votes received |
| state | string | Current state |
| registerheight | integer | Block height of registration |
| cancelheight | integer | Block height of cancellation (0 if active) |
| inactiveheight | integer | Block height when became inactive (0 if active) |
| illegalheight | integer | Block height when marked illegal (0 if not) |
| index | integer | Index in the result set |
| totalvotes | string | Total votes across all producers |
| totalcounts | integer | Total number of producers matching the filter |
Example
// Request
{
"method": "listproducers",
"params": {
"start": 0,
"limit": 3,
"state": "active"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"producers": [
{
"ownerpublickey": "0306e4f...",
"nodepublickey": "0282d5a...",
"nickname": "Elephant Wallet",
"url": "https://elephantwallet.app",
"location": 86,
"active": true,
"votes": "45230120.12345678",
"state": "Active",
"registerheight": 362738,
"cancelheight": 0,
"inactiveheight": 0,
"illegalheight": 0,
"index": 0
}
],
"totalvotes": "182345670.98765432",
"totalcounts": 96
},
"error": null
}
producerstatus
Checks the registration status of a block producer.
Parameters
| Name | Type | Description |
|---|---|---|
| publickey | string | Producer's public key |
Result
| Name | Type | Description |
|---|---|---|
| status | integer | 0 = not registered, 1 = confirmed, 2 = registered but unconfirmed |
Example
// Request
{
"method": "producerstatus",
"params": {
"publickey": "0306e4f..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": 1,
"error": null
}
votestatus
Returns the voting status for a given address.
Parameters
| Name | Type | Description |
|---|---|---|
| address | string | ELA address |
Result
| Name | Type | Description |
|---|---|---|
| total | string | Total ELA in the address |
| voting | string | ELA currently locked in votes |
| pending | string | ELA in pending vote transactions |
Example
// Request
{
"method": "votestatus",
"params": {
"address": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"total": "1000.00000000",
"voting": "500.00000000",
"pending": "0.00000000"
},
"error": null
}
getdepositcoin
Returns deposit coin information for a producer by their owner public key.
Parameters
| Name | Type | Description |
|---|---|---|
| ownerpublickey | string | Producer's owner public key |
Result
| Name | Type | Description |
|---|---|---|
| available | string | Available (withdrawable) amount |
| deducted | string | Deducted penalty amount |
| deposit | string | Locked deposit amount |
| assets | array | Additional asset details |
Example
// Request
{
"method": "getdepositcoin",
"params": {
"ownerpublickey": "0306e4f..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"available": "500.00000000",
"deducted": "0.00000000",
"deposit": "5000.00000000",
"assets": []
},
"error": null
}
getarbitersinfo
Returns information about current and next round arbiters and candidates.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| arbiters | array<string> | Current arbiter public keys |
| candidates | array<string> | Current candidate public keys |
| nextarbiters | array<string> | Next round arbiter public keys |
| nextcandidates | array<string> | Next round candidate public keys |
| ondutyarbiter | string | Public key of the currently on-duty arbiter |
| currentturnstartheight | integer | Block height when the current rotation started |
| nextturnstartheight | integer | Block height when the next rotation starts |
Example
// Request
{
"method": "getarbitersinfo",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"arbiters": [
"0306e4f...",
"0282d5a...",
"03a9b2c..."
],
"candidates": [
"02f1d8e...",
"03b4c6d..."
],
"nextarbiters": [
"0306e4f...",
"0282d5a...",
"03a9b2c..."
],
"nextcandidates": [
"02f1d8e...",
"03b4c6d..."
],
"ondutyarbiter": "0306e4f...",
"currentturnstartheight": 171440,
"nextturnstartheight": 171476
},
"error": null
}
getarbitratorgroupbyheight
Returns the arbitrator group that was active at a given block height.
Parameters
| Name | Type | Description |
|---|---|---|
| height | uint32 | Block height to query |
Result
| Name | Type | Description |
|---|---|---|
| ondutyarbitratorindex | integer | Index of the on-duty arbitrator |
| arbitrators | array<string> | List of arbitrator public keys |
Example
// Request
{
"method": "getarbitratorgroupbyheight",
"params": {
"height": 171454
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"ondutyarbitratorindex": 2,
"arbitrators": [
"0306e4f...",
"0282d5a...",
"03a9b2c..."
]
},
"error": null
}
getarbiterpeersinfo
Returns network connection information for DPoS arbiter peers.
Parameters
None.
Result (array)
| Name | Type | Description |
|---|---|---|
| ownerpublickey | string | Owner public key |
| nodepublickey | string | Node public key |
| ip | string | Peer IP address |
| connstate | string | Connection state (e.g. "EstablishConnection", "NoneConnection") |
Example
// Request
{
"method": "getarbiterpeersinfo",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"ownerpublickey": "0306e4f...",
"nodepublickey": "0282d5a...",
"ip": "192.0.2.1",
"connstate": "EstablishConnection"
}
],
"error": null
}
getconfirmbyheight
Returns the block confirmation (DPoS consensus signature) at a given height.
Parameters
| Name | Type | Description |
|---|---|---|
| height | integer | Block height |
| verbosity | integer | 0 for hex, 1 for decoded JSON |
Result (verbosity 1)
| Name | Type | Description |
|---|---|---|
| sponsor | string | Public key of the confirm sponsor |
| viewoffset | integer | View offset in the consensus round |
| votes | array | Array of vote objects with signer and accept fields |
Example
// Request
{
"method": "getconfirmbyheight",
"params": {
"height": 171454,
"verbosity": 1
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"sponsor": "0306e4f...",
"viewoffset": 0,
"votes": [
{
"signer": "0282d5a...",
"accept": true
},
{
"signer": "03a9b2c...",
"accept": true
}
]
},
"error": null
}
getconfirmbyhash
Returns the block confirmation (DPoS consensus signature) for a given block hash.
Parameters
| Name | Type | Description |
|---|---|---|
| blockhash | string | Block hash |
| verbosity | integer | 0 for hex, 1 for decoded JSON |
Result
Same as getconfirmbyheight.
Example
// Request
{
"method": "getconfirmbyhash",
"params": {
"blockhash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e",
"verbosity": 1
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"sponsor": "0306e4f...",
"viewoffset": 0,
"votes": [
{
"signer": "0282d5a...",
"accept": true
}
]
},
"error": null
}
estimatesmartfee
Estimates the fee rate needed for a transaction to be confirmed within a given number of blocks.
Parameters
| Name | Type | Description |
|---|---|---|
| confirmations | integer | Target number of blocks for confirmation |
Result
| Name | Type | Description |
|---|---|---|
| fee | integer | Estimated fee rate in sela per KB |
Example
// Request
{
"method": "estimatesmartfee",
"params": {
"confirmations": 6
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": 10000,
"error": null
}
Mining
togglemining
Starts or stops CPU mining on the node.
Parameters
| Name | Type | Description |
|---|---|---|
| mining | bool | true to start mining, false to stop |
Result
| Name | Type | Description |
|---|---|---|
| result | string | Confirmation message |
Example
// Request
{
"method": "togglemining",
"params": {
"mining": true
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "mining started",
"error": null
}
discretemining
Mines a specified number of blocks instantly. Intended for regtest/testing environments.
Parameters
| Name | Type | Description |
|---|---|---|
| count | integer | Number of blocks to mine |
Result
| Name | Type | Description |
|---|---|---|
| result | array<string> | Array of mined block hashes |
Example
// Request
{
"method": "discretemining",
"params": {
"count": 3
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
"aabb1122...",
"ccdd3344...",
"eeff5566..."
],
"error": null
}
getmininginfo
Returns information about the node's mining state.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| blocks | integer | Current block height |
| currentblocktx | integer | Number of transactions in the current block template |
| difficulty | string | Current mining difficulty |
| networkhashps | string | Estimated network hash rate per second |
| pooledtx | integer | Number of transactions in the mempool |
| chain | string | Network name (e.g. "mainnet", "testnet", "regnet") |
Example
// Request
{
"method": "getmininginfo",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blocks": 171454,
"currentblocktx": 12,
"difficulty": "1234567.89012345",
"networkhashps": "98765432109876",
"pooledtx": 47,
"chain": "mainnet"
},
"error": null
}
createauxblock
Creates an auxiliary block for merged mining. A Bitcoin miner calls this to get work from the ELA node.
Parameters
| Name | Type | Description |
|---|---|---|
| paytoaddress | string | ELA address to receive the block reward |
Result
| Name | Type | Description |
|---|---|---|
| chainid | integer | Auxiliary chain ID |
| height | integer | Block height of the candidate block |
| coinbasevalue | integer | Block reward in sela |
| bits | string | Compact target for the block |
| hash | string | Hash of the candidate block |
| previousblockhash | string | Previous block hash |
Example
// Request
{
"method": "createauxblock",
"params": {
"paytoaddress": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"chainid": 1224,
"height": 171455,
"coinbasevalue": 150000000,
"bits": "1a016729",
"hash": "79c20b21ba5af617a0c147e7fc2c3b4bfb0c283a4d15a2e4624e0cda98e1a0d2",
"previousblockhash": "68692d63a8bfc8887553b97f99f09e523d34a2b599bf5b388436b2ddc85ed76e"
},
"error": null
}
submitauxblock
Submits a solved auxiliary proof-of-work block. Called by a Bitcoin miner after solving a block that includes the ELA auxiliary chain.
Parameters
| Name | Type | Description |
|---|---|---|
| blockhash | string | Hash of the auxiliary block (from createauxblock) |
| auxpow | string | Serialized auxiliary proof-of-work data |
Result
| Name | Type | Description |
|---|---|---|
| result | bool | true if accepted, error otherwise |
Example
// Request
{
"method": "submitauxblock",
"params": {
"blockhash": "79c20b21ba5af617a0c147e7fc2c3b4bfb0c283a4d15a2e4624e0cda98e1a0d2",
"auxpow": "02000000010000000000..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": true,
"error": null
}
CR (Elastos DAO)
listcrcandidates
Returns a paginated list of Cyber Republic (CR) council candidates.
Parameters
| Name | Type | Description |
|---|---|---|
| start | integer | Start index for pagination |
| limit | integer | Maximum number of results |
| state | string | Filter: "all", "pending", "active", "canceled", "returned" |
Result
| Name | Type | Description |
|---|---|---|
| code | string | Candidate code |
| cid | string | Candidate CID (CRC ID) |
| did | string | Candidate DID |
| nickname | string | Candidate name |
| url | string | Candidate info URL |
| location | integer | Location code |
| state | string | Current state |
| votes | string | Number of votes received |
| registerheight | integer | Block height of registration |
| cancelheight | integer | Block height of cancellation (0 if active) |
| index | integer | Index in result set |
| totalvotes | string | Total votes across all candidates |
| totalcounts | integer | Total number of candidates matching the filter |
Example
// Request
{
"method": "listcrcandidates",
"params": {
"start": 0,
"limit": 3,
"state": "all"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"crcandidatesinfo": [
{
"code": "21024f3a...",
"cid": "ihfb4V1u...",
"did": "igNBwC2P...",
"nickname": "CR Council Member A",
"url": "https://example.com/cr-a",
"location": 86,
"state": "Active",
"votes": "12500000.00000000",
"registerheight": 413568,
"cancelheight": 0,
"index": 0
}
],
"totalvotes": "75000000.00000000",
"totalcounts": 24
},
"error": null
}
getcrdepositcoin
Returns deposit coin information for a CR member.
Parameters
| Name | Type | Description |
|---|---|---|
| id | string | CRC ID or DID of the CR member |
| publickey | string | (alternative) Public key of the CR member |
Provide either id or publickey.
Result
| Name | Type | Description |
|---|---|---|
| available | string | Available (withdrawable) amount |
| deducted | string | Deducted penalty amount |
| deposit | string | Locked deposit amount |
| assets | array | Additional asset details |
Example
// Request
{
"method": "getcrdepositcoin",
"params": {
"id": "ihfb4V1u..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"available": "0.00000000",
"deducted": "0.00000000",
"deposit": "5000.00000000",
"assets": []
},
"error": null
}
getsecretarygeneral
Returns the public key of the current CR secretary general.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| secretarygeneral | string | Public key of the secretary general |
Example
// Request
{
"method": "getsecretarygeneral",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"secretarygeneral": "0306e4f..."
},
"error": null
}
listcurrentcrs
Returns the current active CR council members.
Parameters
| Name | Type | Description |
|---|---|---|
| state | string | Filter: "all", "elected", "impeached", "returned" |
Result
| Name | Type | Description |
|---|---|---|
| code | string | Member code |
| cid | string | CRC ID |
| did | string | DID |
| nickname | string | Member name |
| url | string | Member info URL |
| location | integer | Location code |
| impeachmentvotes | string | Votes cast for impeachment |
| depositamount | string | Deposit amount locked |
| depositaddress | string | Deposit address |
| penalty | string | Accumulated penalty amount |
| index | integer | Index in result set |
| totalcounts | integer | Total number of members matching the filter |
Example
// Request
{
"method": "listcurrentcrs",
"params": {
"state": "all"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"crmembersinfo": [
{
"code": "21024f3a...",
"cid": "ihfb4V1u...",
"did": "igNBwC2P...",
"nickname": "CR Council Member A",
"url": "https://example.com/cr-a",
"location": 86,
"impeachmentvotes": "0.00000000",
"depositamount": "5000.00000000",
"depositaddress": "8VYXVxKKSAxkmRrfmGpQR2Kc66XhG6m3ta",
"penalty": "0.00000000",
"index": 0
}
],
"totalcounts": 12
},
"error": null
}
listcrproposalbasestate
Returns a paginated list of CR proposal states.
Parameters
| Name | Type | Description |
|---|---|---|
| start | integer | Start index for pagination |
| limit | integer | Maximum number of results |
| state | string | Filter: "all", "registered", "cragreed", "voteragreed", "finished", "crcanceled", "votercanceled", "aborted" |
Result
| Name | Type | Description |
|---|---|---|
| proposalbasestates | array | Array of proposal state objects with proposalhash, title, status, instate |
| totalcounts | integer | Total number of proposals matching the filter |
Example
// Request
{
"method": "listcrproposalbasestate",
"params": {
"start": 0,
"limit": 5,
"state": "all"
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"proposalbasestates": [
{
"proposalhash": "ab12cd34...",
"title": "Community Development Fund",
"status": "VoterAgreed",
"instate": "Normal"
}
],
"totalcounts": 47
},
"error": null
}
getcrproposalstate
Returns detailed state information for a specific CR proposal.
Parameters
| Name | Type | Description |
|---|---|---|
| proposalhash | string | (option 1) Hash of the proposal |
| drafthash | string | (option 2) Hash of the proposal draft |
Provide either proposalhash or drafthash.
Result
| Name | Type | Description |
|---|---|---|
| status | string | Current proposal status |
| proposal | object | Full proposal details including title, sponsor, budget, etc. |
| proposalstate | object | State machine details: tracking numbers, review info |
Example
// Request
{
"method": "getcrproposalstate",
"params": {
"proposalhash": "ab12cd34..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": "VoterAgreed",
"proposal": {
"proposalhash": "ab12cd34...",
"type": "Normal",
"categorydata": "",
"ownerpublickey": "0306e4f...",
"drafthash": "ef56ab78...",
"budgets": [
{
"type": "Imprest",
"stage": 0,
"amount": "10000.00000000"
}
],
"recipient": "EXoXaT68VzPBRVpnqRFVkFMaTPmiiVzPqo"
},
"proposalstate": {
"registerheight": 500000,
"status": "VoterAgreed",
"votestartheight": 500010,
"votersagreeamount": "125000000.00000000"
}
},
"error": null
}
getproposaldraftdata
Returns the raw draft data for a CR proposal in hex format.
Parameters
| Name | Type | Description |
|---|---|---|
| drafthash | string | Hash of the proposal draft |
Result
| Name | Type | Description |
|---|---|---|
| data | string | Hex-encoded draft data |
Example
// Request
{
"method": "getproposaldraftdata",
"params": {
"drafthash": "ef56ab78..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0200010013313637...",
"error": null
}
getcrrelatedstage
Returns information about the current CR election and voting stage.
Parameters
None.
Result
| Name | Type | Description |
|---|---|---|
| onduty | bool | Whether the CR council is currently on duty |
| votingstartheight | integer | Block height when the current voting period started |
| votingendheight | integer | Block height when the current voting period ends |
| inelectionperiod | bool | Whether we are in an election period |
Example
// Request
{
"method": "getcrrelatedstage",
"params": {},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"onduty": true,
"votingstartheight": 500000,
"votingendheight": 510000,
"inelectionperiod": false
},
"error": null
}
Cross-Chain
submitsidechainillegaldata
Submits evidence of illegal activity detected on a sidechain. Used by arbiter nodes to report sidechain misbehavior to the main chain.
Parameters
| Name | Type | Description |
|---|---|---|
| illegaldata | string | Hex-encoded illegal data evidence |
Result
| Name | Type | Description |
|---|---|---|
| result | bool | true if accepted |
Example
// Request
{
"method": "submitsidechainillegaldata",
"params": {
"illegaldata": "02000100..."
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": true,
"error": null
}
getexistwithdrawtransactions
Checks which of the given withdrawal transaction hashes already exist on the main chain. Used to avoid duplicate cross-chain withdrawal processing.
Parameters
| Name | Type | Description |
|---|---|---|
| txs | array<string> | Array of withdrawal transaction hashes to check |
Result
| Name | Type | Description |
|---|---|---|
| result | array<string> | Subset of input hashes that already exist |
Example
// Request
{
"method": "getexistwithdrawtransactions",
"params": {
"txs": [
"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd",
"b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcdef"
]
},
"id": 1
}
// Response
{
"id": 1,
"jsonrpc": "2.0",
"result": [
"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6abcd"
],
"error": null
}
Resources
- ELA node source: github.com/elastos/Elastos.ELA
- Node operation guide: Run an ELA Full Node
- Network endpoints: Network Endpoints