Skip to content
sjl623 edited this page Nov 21, 2019 · 3 revisions

Summary

Protocol: websocket(Reference)
Serialization: fastjson(Reference)

API reference

connect

describe

Connect a node(full node or light node)

parameter

  • versionID

response

  • success
    0:connect success
    1:connect failed

disconnect

describe

Disconnect from a node.

parameter

none

response

  • success
    0: success
    1: failed

ping

describe

Check whether a node is alive.

parameter

none

response

  • success
    0: success

sendChainHead

describe

To receive the chain head info that sent by other node initiatively.(For example,when a miner pack a block successful,he would call the method to announce to other node).

parameter

  • content: Chain Head's Json format string.

response

  • success
    0: success
    1: rejected

getChainHead

describe

When a node enter the network first time,it could call the method the get the full chain head now.

parameter

  • beginID
    The strat of chain head(start from 0)

response

  • status
    0: success
    1: failed
  • content:Chain Head's Json format string.

getBlockDetail

describe

Call the interface to get block detail.

parameter

  • blockID

response

  • status
    0: success
    1: failed
  • content: Block detail's Json format string.Included each entry in the block.

sendNewEntry

describe

Call the interface to broadcast new transactions.

parameter

  • entry Included the new entries