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=8197If 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=8197Having 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_rpcAvailable commands
getblockcount - returns current chain height
getblockcount - returns current chain heightURL:
/json_rpcInput 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
getblockhash - Returns block hash by its heightURL:
Input arguments:
Return value schema:
getblocktemplate - Returns blocktemplate with an empty “hole” for nonce
getblocktemplate - Returns blocktemplate with an empty “hole” for nonceURL:
Input arguments:
Return value schema
submitblock - Submits mined block
submitblock - Submits mined blockURL:
Input arguments:
Return value schema:
getlastblockheader - Returns last block header
getlastblockheader - Returns last block headerURL:
Input arguments:
Return value schema:
getblockheaderbyhash - Returns last block header by given hash.
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.
getblockheaderbyheight - Returns block header by given block height.URL:
Input arguments:
Return value schema:
See getlastblockheader above
getcurrencyId - Returns unique currency identifier
getcurrencyId - Returns unique currency identifierURL:
Input arguments:
Return value schema:
Examples
getblockcount
getblockcountInput:
Output:
getblockhash
getblockhashInput:
Output:
getblocktemplate
getblocktemplateInput:
Output:
submitblock
submitblockInput:
Output:
getlastblockheader
getlastblockheaderInput:
Output:
getblockheaderbyhash
getblockheaderbyhashInput:
Output:
getblockheaderbyheight
getblockheaderbyheightInput:
Output:
getcurrencyId
getcurrencyIdInput:
Output:
Last updated
Was this helpful?