Skip to main content

Command definitions

All RPC request/response structs are defined in:
Daemon-side RPC commands use COMMAND_RPC_ prefix. Wallet-side commands use WALLET_RPC_COMMAND_ prefix.

Adding a new daemon endpoint

1

Define command structs

Add COMMAND_RPC_YOUR_ENDPOINT with request and response inner structs to CoreRpcServerCommandsDefinitions.h. Use KV_SERIALIZE / KV_MEMBER macros for JSON serialization.
2

Declare handler in RpcServer.h

3

Register route in RpcServer.cpp

Add to the s_handlers map in RpcServer.cpp:
The false means the endpoint does not require a running blockchain (set true if it does).
4

Implement the handler

Follow existing handlers like on_get_fee_pool_info as a model. Access core state via m_core.

Key access patterns

Wallet RPC

Wallet-side RPC handlers live in:
  • src/Wallet/WalletRpcServer.h — declarations
  • src/Wallet/WalletRpcServer.cpp — implementations
Wallet RPC handlers access the wallet via m_wallet (a WalletGreen reference).

Serialization macros