ion Developer Reference

The Developer Reference aims to provide technical details and API information to help you start building ion-based applications, but it is not a specification.

Remote Procedure Calls (RPCs)

ion Core provides a remote procedure call (RPC) interface for various administrative tasks, wallet operations, and queries about network and block chain data.

GetBlockCount

The getblockcount RPC returns the number of blocks in the local best block chain.

Returns

The number of blocks in the local best block chain. For a new node with only the hardcoded genesis block, this number will be 0.

Example Request
iond getblockcount
Example Response
315280
GetBlockHash

The getblockhash RPC returns the header hash of a block at the given height in the local best block chain.

Arguments
Block Height
number (int)
REQUIRED
The height of the block whose header hash should be returned. The height of the hardcoded genesis block is 0.
Returns

The hash of the block at the requested height, encoded as hex in RPC byte order, or JSON null if an error occurred.

Example Request
iond getblockhash 240886
Example Response
510f5ff2667f27ff8583554b513a37b9ae6ae755aa8a9f2f841280e6ab005b2a
GetDifficulty

The getdifficulty RPC.

Returns

The difficulty of creating a block with the same target threshold (nBits) as the highest-height block in the local best block chain. The number is a a multiple of the minimum difficulty.

Example Request
iond getdifficulty
Example Response
1.00000000
Stop

The stop RPC safely shuts down the ion Core server.

Returns

The string "Ion server stopping”.

Example Request
iond stop
Example Response
Ion server stopping