BSV blockchainBSV blockchain

RPC Service Settings

Related Topic: RPC Service

Configuration Settings

SettingTypeDefaultEnvironment VariableUsage
RPCUserstring""rpc_userFull access authentication username
RPCPassstring""rpc_passFull access authentication password
RPCLimitUserstring""rpc_limit_userLimited access authentication username
RPCLimitPassstring""rpc_limit_passLimited access authentication password
RPCMaxClientsint1 (Code default; settings.conf ships with 3)rpc_max_clientsMaximum concurrent RPC connections
RPCQuirksbooltruerpc_quirksLegacy client compatibility behavior
RPCListenerURL*url.URL""rpc_listener_urlCRITICAL - RPC server network binding
CacheEnabledbooltruerpc_cache_enabledCRITICAL - Response caching for performance
RPCTimeouttime.Duration30srpc_timeoutCRITICAL - RPC call execution timeout
ClientCallTimeouttime.Duration5srpc_client_call_timeoutCRITICAL - Service client call timeout
RPCMaxRequestSizeint10485760 (10MB)rpc_maxRequestSizeMaximum RPC request body size in bytes (prevents OOM on oversized requests)

Configuration Dependencies

Authentication System

  • RPCUser and RPCPass provide full access to all RPC commands
  • RPCLimitUser and RPCLimitPass provide limited access to subset of commands
  • Two-tier authentication system with different access levels

Response Caching

  • When CacheEnabled = true, caches responses for getbestblockhash, getpeerinfo, getblockchaininfo, getinfo, and getchaintips
  • Improves performance for frequently accessed data

Timeout Management

  • RPCTimeout controls overall RPC call duration with context timeout
  • ClientCallTimeout controls calls to P2P and Legacy services
  • Prevents hung requests and service calls

Network Binding

  • RPCListenerURL determines server binding interface and port
  • RPCMaxClients limits concurrent connections

Service Dependencies

DependencyInterfaceUsage
UTXOStoreutxo.StoreCRITICAL - UTXO operations and transaction validation
TxStoreblob.StoreCRITICAL - Transaction data access
BlockchainClientblockchain.ClientICRITICAL - Blockchain operations and data retrieval
BlockValidationClientblockvalidation.InterfaceCRITICAL - Block validation operations
BlockAssemblyClientblockassembly.ClientICRITICAL - Mining operations and block templates
P2PClientp2p.ClientICRITICAL - Peer information and network operations
LegacyPeerClientpeer.ClientICRITICAL - Legacy peer information
ValidatorClientvalidator.ClientICRITICAL - Transaction validation

Validation Rules

SettingValidationImpactWhen Checked
RPCListenerURLMust be valid URL formatServer bindingDuring service initialization
CacheEnabledControls response caching behaviorPerformanceDuring RPC method execution
RPCTimeoutMust be positive durationRequest handlingDuring RPC call execution
ClientCallTimeoutMust be positive durationService callsDuring client service calls

Configuration Examples

Basic Configuration

rpc_listener_url = "http://localhost:9292"
rpc_max_clients = 10

Authentication Setup

rpc_user = "admin"
rpc_pass = "secure_password"
rpc_limit_user = "readonly"
rpc_limit_pass = "readonly_password"

Performance Tuning

rpc_cache_enabled = true
rpc_timeout = 60s
rpc_client_call_timeout = 10s