Daemon JSON RPC API

Daemon JSON RPC API

To start Daemon JSON RPC API server you should specify a port on which server binds (additionally to standard daemon's arguments). You can choose any free port. To do that execute the following command from the command line:

./Qwertycoind --rpc-bind-port=8197

If you want Daemon to be accessed from other computer not only yours you should also use a --rpc-bind-ip 0.0.0.0 command. To do that execute the following command from the command line:

./Qwertycoind --rpc-bind-ip=0.0.0.0 --rpc-bind-port=8197

Having done that you're ready to operate with the daemon through the following API URLs (e.g., your IP address is 126.0.1.100):

 http://126.0.1.100:8197/json_rpc
 http://localhost:8197/json_rpc

Available commands

getblockcount - returns current chain height

URL:

 /json_rpc

Input arguments:

 {
   "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "QWC JSON RPC API",
   "description": "Schema for transfer method in Qwertycoin wallet",
   "type": "object",

   "properties" : {
      "jsonrpc" : {
         "type" : "string"
      },
      "method" : {
         "type" : "string"
      }
   },
   "required" : ["jsonrpc", "method"]
 }

Return value schema:

getblockhash - Returns block hash by its height

URL:

Input arguments:

Return value schema:

getblocktemplate - Returns blocktemplate with an empty “hole” for nonce

URL:

Input arguments:

Return value schema

submitblock - Submits mined block

URL:

Input arguments:

Return value schema:

getlastblockheader - Returns last block header

URL:

Input arguments:

Return value schema:

getblockheaderbyhash - Returns last block header by given hash.

URL:

Input arguments:

Return value schema:

See getlastblockheader above

getblockheaderbyheight - Returns block header by given block height.

URL:

Input arguments:

Return value schema:

See getlastblockheader above

getcurrencyId - Returns unique currency identifier

URL:

Input arguments:

Return value schema:

Examples

getblockcount

Input:

Output:

getblockhash

Input:

Output:

getblocktemplate

Input:

Output:

submitblock

Input:

Output:

getlastblockheader

Input:

Output:

getblockheaderbyhash

Input:

Output:

getblockheaderbyheight

Input:

Output:

getcurrencyId

Input:

Output:

Last updated

Was this helpful?