Daemon RPC Overview
Implementation: src/rpc/RpcServer.cpp, src/rpc/RpcServer.h
The daemon exposes:
- JSON-RPC at
/json_rpc(GET and POST) - HTTP-style endpoints (
/info,/height, and others)
RPC availability depends on daemon RPC mode:
DefaultMiningEnabledBlockExplorerEnabledAllMethodsEnabled
Permissions are enforced in middleware before handlers run.
Main runtime options
Defined in src/daemon/DaemonConfiguration.h and parsed in src/daemon/DaemonConfiguration.cpp:
rpc-bind-iprpc-bind-portrpc-access-tokenrpc-read-timeoutrpc-write-timeoutrpc-max-body-bytesrpc-max-rpmrpc-max-global-index-rangerpc-max-block-countrpc-trust-proxy
See the other daemon RPC pages for auth, limits, and method lists.
Quick Examples
Set shared environment variables:
export DAEMON_RPC_URL="http://127.0.0.1:11898"
export DAEMON_RPC_TOKEN="replace-me"
Get daemon info:
curl -s "$DAEMON_RPC_URL/info"
Get peers with token auth:
curl -s \
-H "X-API-Key: $DAEMON_RPC_TOKEN" \
"$DAEMON_RPC_URL/peers"
Call JSON-RPC (getblockcount):
curl -s \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"getblockcount","params":{}}' \
"$DAEMON_RPC_URL/json_rpc"