Skip to main content

Mainnet RPC

info

For latest RPC implementation, see Mixin's source.

Send RPC Request#

Mixin 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

ParameterTypeDescription
methodStringSupported methods, please see the section below
paramsArrayThe 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#

getinfo#

params:

[]

return: the information of current node

dumpgraphhead#

params:

[]

return: the graph head of current node

sendrawtransaction#

params:

[  the hex format of transaction:string]

return:

{  "hash": the hash of the transcation}

gettransaction#

params:

[  the hash of the transaction:string]

return:

{  the transaction}

getcachetransaction#

params:

[  the hash of the transaction:string]

return:

{  the transaction}

getutxo#

params:

[  the hash of the utxo:string,  the index:string formed uint64]

return:

{  the utxo}

getsnapshot#

params:

[  the hash of the snapshot:string,]

return:

{  the snapshot}

listsnapshots#

params:

[  offset:string formed uint64,  count:string formed uint64,  sig:string formed bool,  tx:string formed bool,]

return:

{  snapshots: [ the snapshot ... ],}

listmintworks#

params:

[  offset:string formed uint64,]

return:

{  node_hash_id: work,  ...}

listmintdistributions#

params:

[  offset:string formed uint64,  count:string formed uint64,  tx:string formed bool,]

return:

{  mints: [ the mint ... ],}

listallnodes#

params:

[  threshold:string formed uint64,  state:string formed bool,]

return:

{  nodes: [ the node ... ],}

getroundbynumber#

params:

[  node:string formed uint64,  number:string formed uint64,]

return:

{  "node":       node,  "hash":       hash,  "start":      start,  "end":        end,  "number":     number,  "references": references,  "snapshots":  snapshots,}

getroundbyhash#

params:

[  round_hash:string,]

return:

{  "node":       node,  "hash":       hash,  "start":      start,  "end":        end,  "number":     number,  "references": references,  "snapshots":  snapshots,}

getroundlink#

params:

[  from:string,  to:string,]

return:

{  "link": link,}