Configuration parameters
You can specify options via command-line parameters, environment variables or using config files.
Configuration files and environment variables
The config files must be in the Toml format. These config files are (from lowest priority to highest): /etc/rostrum/config.toml
, ~/.rostrum/config.toml
, ./rostrum.toml
.
The options in highest-priority config files override options set in lowest-priority config files. Environment variables override options in config files and finally arguments override everythig else.
For each argument an environment variable of the same name with ROSTRUM_
prefix, upper case letters and underscores instead of hypens exists (e.g. you can use ROSTRUM_ELECTRUM_RPC_ADDR
instead of --electrum-rpc-addr
). Similarly, for each argument an option in config file exists with underscores instead o hypens (e.g. electrum_rpc_addr
). In addition, config files support cookie
option to specify cookie - this is not available using command line or environment variables for security reasonns (other applications could read it otherwise).
Finally, you need to use a number in config file if you want to increase verbosity (e.g. verbose = 3
is equivalent to -vvv
) and true
value in case of flags (e.g. timestamp = true
)
Parameters
Parameter name | Description | Default value |
---|---|---|
--announce |
Enable peer discovery. This server will connect to other electrum servers to collect peers and also announce its own existance. Default on if electrum-rpc-addr is not set or set to a globally routable IP. Disabled if electrum-rpc-addr is set to a local IP. | True |
--announce-hostname |
For peer discovery. If this server has a hostname that resolves to its IP, set this to announce it to other servers. (Example: rostrum.bitcoincash.network). If this is not set and announcements are enabled, then rostrum will attempt to identify it's own public IP. | String::default() |
--announce-ssl-port |
For peer discovery. If this server is set up with SSL support, set this argument to announce it to other servers. (Example: 50002 for BCH mainnet) | 0 |
--announce-wss-port |
For peer discovery. If this server set up with WebSocket SSL support, set this argument to announce it to other servers. (Example: 50004 for BCH mainnet) | 0 |
--auth |
JSONRPC authentication ('USER:PASSWORD', default: use cookie file) | |
--blocktxids-cache-size-mb |
Total size of block transactions IDs to cache (in MB) | 50.0 |
--cashaccount-activation-height |
The activation blockheight for cashaccount. Set to 563720 to activate on Bitcoin Cash. | 0 |
--cookie |
DEPRECATED: use cookie_file or auth instead! | |
--cookie-file |
JSONRPC authentication cookie file (default: ~/.bitcoin/.cookie or ~/.nexa/.cookie) | |
--daemon-dir |
Data directory of full node (default: ~/.bitcoin/ or ~/.nexa) | crate::config::default_daemon_dir() |
--daemon-p2p-addr |
Bitcoin daemon P2P 'addr:port' to connect to (defaults to 127.0.0.1: |
|
--daemon-rpc-addr |
Bitcoin daemon JSONRPC 'addr:port' to connect (default: 127.0.0.1:8332 or 7227 for mainnet, 127.0.0.1:18332 or 7229 for testnet, 28332 for testnet4 (BCH only), 38332 for scalenet (BCH only), 48332 for chipnet (BCH only) and 127.0.0.1:18443 or 18332 for regtest) | |
--daemon-rpc-connections |
Number of concurrent connections to the full node's RPC interface. More connections will reduce lock contention (improve performance). Most nodes accept at most 4 by default, if increased above that, then also configure the node to accept more connections. | 3 |
--db-dir |
Directory to store index database (default: ./db/) | "./db".into() |
--db-write-cache-entries |
How many database entries to cache in memory before flushing to disk during indexing. If low_memory is enabled, then this cache is disabled. |
500_000 |
--donation-address |
Server donation address | |
--electrum-rpc-addr |
Electrum server JSONRPC 'addr:port' to listen on (default: '0.0.0.0:50001' or 20001 (NEXA) for mainnet, '0.0.0.0:60001' or 30001 for testnet and '0.0.0.0:60401' or 30401 for regtest) | |
--electrum-ws-addr |
Electrum websocket server 'addr:port' to listen on (default: '0.0.0.0:50003' or 20003 for mainnet, '0.0.0.0:60003' or 30003 for testnet and '0.0.0.0:60403' or 30403 for regtest) | |
--index-batch-size |
Buffer size for blocks (# of blocks) fetched via RPC from bitcoind | 100 |
--low-memory |
Indicate preference to less memory usage over performance | False |
--metrics |
Enable prometheus metrics server | True |
--monitoring-addr |
Prometheus monitoring 'addr:port' to listen on (default: 127.0.0.1:4224 or 3224 for mainnet, 127.0.0.1:14224 or 13224 for testnet, 127.0.0.1:34224 or 23224 for testnet4, 127.0.0.1:44224 for scalenet 127.0.0.1:54224 for chipnet and 127.0.0.1:24224 for regtest) | |
--network |
Select Bitcoin network type ('bitcoin' for mainnet, 'testnet', 'testnet4' BCH only, 'scalenet' BCH only, 'chipnet' BCH only or 'regtest') | Default::default() |
--reindex |
Rebuild full rostrum index at startup | False |
--reindex-last-blocks |
Number of last blocks to reindex (used for testing) | 0 |
--rpc-buffer-size |
Size of the message queue for each peer. If set too small, subscription notifications may drop | 2000 |
--rpc-idle-timeout |
Duration, in seconds, to wait before disconnecting a client due to inactivity. If a client remains idle and doesn't send any request within this time frame, it will be automatically disconnected. | 200 |
--rpc-max-connections |
Maximum number of simultaneous RPC connections. | 2000 |
--rpc-max-connections-shared-prefix |
Maximum number of simultaneous RPC connections from IP's sharing first two octets (255.255.0.0 for IPv4). | 500 |
--rpc-timeout |
Maximum burst time in seconds RPC calls may make. Uses leaky bucket algorithm which refills 0.5 sec per second. | 10 |
--scripthash-alias-bytes-limit |
The maximum number of bytes stored for scripthash aliases. A bitcoincash address alias is 54 bytes, making the default allow ~1800 blockchain.address subscriptions. | 100000 |
--scripthash-subscription-limit |
The maximum number of scripthash subscriptions per connection | 250000 |
--server-banner |
The banner to be shown in the Electrum console | concat!("Welcome to Rostrum ", env!("CARGO_PKG_VERSION"), " (Electrum Rust Server)!").to_owned() |
--timestamp |
Prepend log lines with a timestamp | |
--tx-cache-size-mb |
Total size of transactions to cache (MB) | 250.0 |
--txid-limit |
DEPRECATED. Not used. Number of transactions to lookup before returning an error. | 0 |
--verbose , --v |
Increase logging verbosity | |
--version |
Print rostrum version and exit | False |
--wait-duration-secs |
Duration to wait between bitcoind polling | 5 |
--websocket |
Enable websocket server | True |