Mainnet RPC
info
For latest RPC implementation, see Mixin's source.
#
Send RPC RequestMixin Mainnet Node will public a port for RPC, you can use it to interact with Mixin Mainnet Node.
The default RPC port is the service port + 1000. For example, if the public port is 8001
, the RPC port is 9001
.
RPC Base
The RPC base is formed by http://<node_host>:<rpc_port>/
. For example, http://127.0.0.1:9001/
.
Payload
Parameter | Type | Description |
---|---|---|
method | String | Supported methods, please see the section below |
params | Array | The parameters of the methods |
Example
curl -X POST -H "Content-Type: application/json" \ -d '{"method":"getinfo","params":[],"id":1}' http://127.0.0.1:9001
#
RPC Methods#
getinfoparams:
[]
return: the information of current node
#
dumpgraphheadparams:
[]
return: the graph head of current node
#
sendrawtransactionparams:
[ the hex format of transaction:string]
return:
{ "hash": the hash of the transcation}
#
gettransactionparams:
[ the hash of the transaction:string]
return:
{ the transaction}
#
getcachetransactionparams:
[ the hash of the transaction:string]
return:
{ the transaction}
#
getutxoparams:
[ the hash of the utxo:string, the index:string formed uint64]
return:
{ the utxo}
#
getsnapshotparams:
[ the hash of the snapshot:string,]
return:
{ the snapshot}
#
listsnapshotsparams:
[ offset:string formed uint64, count:string formed uint64, sig:string formed bool, tx:string formed bool,]
return:
{ snapshots: [ the snapshot ... ],}
#
listmintworksparams:
[ offset:string formed uint64,]
return:
{ node_hash_id: work, ...}
#
listmintdistributionsparams:
[ offset:string formed uint64, count:string formed uint64, tx:string formed bool,]
return:
{ mints: [ the mint ... ],}
#
listallnodesparams:
[ threshold:string formed uint64, state:string formed bool,]
return:
{ nodes: [ the node ... ],}
#
getroundbynumberparams:
[ node:string formed uint64, number:string formed uint64,]
return:
{ "node": node, "hash": hash, "start": start, "end": end, "number": number, "references": references, "snapshots": snapshots,}
#
getroundbyhashparams:
[ round_hash:string,]
return:
{ "node": node, "hash": hash, "start": start, "end": end, "number": number, "references": references, "snapshots": snapshots,}
#
getroundlinkparams:
[ from:string, to:string,]
return:
{ "link": link,}