Skip to main content

Arbiter JSON-RPC

Instructions

The ELA JSON RPC interfaces follow conform to the json-rpc 2.0 protocol but also remain compatible with 1.0 version. That means both named params and positional params are acceptable.

info

"id" is optional, which will be sent back in the result samely if you add it in a request. It is needed when you want to distinguish different requests.

"jsonrpc" is also optional. It tells which version this request uses. In version 2.0 it is required, while in version 1.0 it does not exist.

getinfo

description: return part of parameters of current arbiter

parameters: none

result:

nametypedescription
versionintthe version of arbiter
SideChainMonitorScanIntervalintthe interval of side chain monitor scan
ClearTransactionIntervalintthe interval of clear exist cross chain transaction
MinOutboundintthe min connections of neighbor arbiters
MaxConnectionsintthe max connections of neighbor arbiters
SideAuxPowFeeintthe side mining fee
MinThresholdintthe min amount need in side mining account
DepositAmountintthe amount deposit to side mining account each time

arguments sample:

{
"method": "getinfo"
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": {
"version": 0,
"SideChainMonitorScanInterval": 1000,
"ClearTransactionInterval": 60000,
"MinOutbound": 3,
"MaxConnections": 8,
"SideAuxPowFee": 50000,
"MinThreshold": 10000000,
"DepositAmount": 10000000
}
}

getsidemininginfo

description: return last side mining height

parameters:

nametypedescription
hashstringthe genesis block hash of one side chain

result:

nametypedescription
LastSendSideMiningHeightintthe height of last send side mining height
LastNotifySideMiningHeightintthe height of last notify side mining height
LastSubmitAuxpowHeightintthe height of last submit auxpow height

arguments sample:

{
"method": "getsidemininginfo",
"params": {
"hash": "56be936978c261b2e649d58dbfaf3f23d4a868274f5522cd2adb4308a955c4a3"
}
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": {
"LastSendSideMiningHeight": 6008,
"LastNotifySideMiningHeight": 6006,
"LastSubmitAuxpowHeight": 6006
}
}

getmainchainblockheight

description: return current main chain block height of arbiter

parameters: none

arguments sample:

{
"method": "getmainchainblockheight"
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": 6038
}

getsidechainblockheight

description: return current side chain block height of arbiter

parameters:

nametypedescription
hashstringthe genesis block hash of one side chain

arguments sample:

{
"method": "getsidechainblockheight",
"params": {
"hash": "56be936978c261b2e649d58dbfaf3f23d4a868274f5522cd2adb4308a955c4a3"
}
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": 70
}

getfinisheddeposittxs

description: return finished deposit transactions

parameters:

nametypedescription
succeedboolset to get succed or failed deposit transactions

result:

nametypedescription
Transactionsstringthe transaction struct of deposit transactions
TransactionHashstringthe deposit transaction from main chain
GenesisAddressstringthe genesis address of side chain

arguments sample:

{
"method": "getfinisheddeposittxs",
"params": {
"succeed": "false"
}
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": {
"Transactions": [
{
"Hash": "2aa0dcd14fd517771b14e4f863a6891bf74b22863b44923625f24f04c2b6029e",
"GenesisBlockAddress": "XKUh4GLhFJiqAMTF6HyWQrV9pK9HcGUdfJ"
},
{
"Hash": "760908ddc28893163a9de4c4bc5edd8f597c2c9e0607c23bebff489b741e2cb0",
"GenesisBlockAddress": "XKUh4GLhFJiqAMTF6HyWQrV9pK9HcGUdfJ"
},
{
"Hash": "efc91df2d8667d260bb2d260a002a50003cc13b79b80ad8fbb327665e0ea36cd",
"GenesisBlockAddress": "XKUh4GLhFJiqAMTF6HyWQrV9pK9HcGUdfJ"
},
{
"Hash": "c4e58aa5c9f624f7964ae14d260cb1ff8c227e93d016e35b56fd96cec8d8bcb6",
"GenesisBlockAddress": "XKUh4GLhFJiqAMTF6HyWQrV9pK9HcGUdfJ"
}
]
}
}

getfinishedwithdrawtxs

description: return finished withdraw transactions

parameters:

nametypedescription
succeedboolset to get succed or failed withdraw transactions

result:

nametypedescription
Transactionsstringthe transaction hashes of withdraw transactions

arguments sample:

{
"method": "getfinishedwithdrawtxs",
"params": {
"succeed": "false"
}
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": {
"Transactions": [
"2aa0dcd14fd517771b14e4f863a6891bf74b22863b44923625f24f04c2b6029e",
"760908ddc28893163a9de4c4bc5edd8f597c2c9e0607c23bebff489b741e2cb0"
]
}
}

getgitversion

description: return git version of current arbiter

parameters: none

result:

nametypedescription
versionstringthe git version of current arbiter

arguments sample:

{
"method": "getgitversion"
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": "ea51-dirty"
}

getspvheight

description: return current main chain height of spv

parameters: none

arguments sample:

{
"method": "getspvheight"
}

result sample:

{
"error": null,
"id": null,
"jsonrpc": "2.0",
"result": 2509
}