1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-24 23:08:39 +01:00
electrs/internal/config_specification.toml
Martin Habovstiak 577f54195b Auto reindex when old database is detected
This implements automatic reindexing of old database, turned on by
default. When an old database is detected and `auto_reindex` is turned
on the database will be destroyed so that `electrs` can re-sync. The
user can still turn this off to check db format.

The help message says "or inconsistent" - this is not implemented but we
could in the future and it seems reasonable to explicitly state that
this option will control that thing as well.

Note: 0.8.x versions of `electrs` didn't contain format information -
so we check if the database is empty and assuming it's legacy if it's
not empty but without format information.

The code is also restructured a bit and a few tests are added.
2021-09-17 15:20:54 +03:00

107 lines
3.9 KiB
TOML

[general]
env_prefix = "ELECTRS"
conf_file_param = "conf"
conf_dir_param = "conf_dir"
doc = """
An efficient re-implementation of Electrum Server, inspired by ElectrumX, Electrum Personal Server and bitcoincore-indexd.
The motivation behind this project is to enable a user to run his own Electrum server, with required hardware resources not much beyond those of a full node. The server indexes the entire Bitcoin blockchain, and the resulting index enables fast queries for any given user wallet, allowing the user to keep real-time track of his balances and his transaction history using the Electrum wallet. Since it runs on the user's own machine, there is no need for the wallet to communicate with external Electrum servers, thus preserving the privacy of the user's addresses and balances."""
[[switch]]
name = "verbose"
abbr = "v"
doc = "Increase logging verbosity"
count = true
[[switch]]
name = "timestamp"
doc = "Prepend log lines with a timestamp"
[[switch]]
name = "auto_reindex"
doc = "Automatically reindex the database if it's inconsistent or in old format"
default = true
[[param]]
name = "db_dir"
type = "std::path::PathBuf"
doc = "Directory to store index database (default: ./db/)"
default = "\"./db\".into()"
[[param]]
name = "daemon_dir"
type = "std::path::PathBuf"
doc = "Data directory of Bitcoind (default: ~/.bitcoin/)"
default = "crate::config::default_daemon_dir()"
[[param]]
name = "auth"
type = "String"
doc = "JSONRPC authentication ('USER:PASSWORD', default: use cookie file)"
# Force the user to use config file in order to avoid password leaks
argument = false
env_var = false
[[param]]
name = "cookie_file"
type = "std::path::PathBuf"
doc = "JSONRPC authentication cookie file (default: ~/.bitcoin/.cookie)"
# This is safe to configure on command line.
[[param]]
name = "network"
type = "crate::config::BitcoinNetwork"
convert_into = "::bitcoin::network::constants::Network"
doc = "Select Bitcoin network type ('bitcoin', 'testnet', 'regtest' or 'signet')"
default = "Default::default()"
[[param]]
name = "electrum_rpc_addr"
type = "crate::config::ResolvAddr"
doc = "Electrum server JSONRPC 'addr:port' to listen on (default: '127.0.0.1:50001' for mainnet, '127.0.0.1:60001' for testnet, '127.0.0.1:60401' for regtest and '127.0.0.1:60601' for signet)"
[[param]]
name = "daemon_rpc_addr"
type = "crate::config::ResolvAddr"
doc = "Bitcoin daemon JSONRPC 'addr:port' to connect (default: 127.0.0.1:8332 for mainnet, 127.0.0.1:18332 for testnet, 127.0.0.1:18443 for regtest and 127.0.0.1:18554 for signet)"
[[param]]
name = "daemon_p2p_addr"
type = "crate::config::ResolvAddr"
doc = "Bitcoin daemon p2p 'addr:port' to connect (default: 127.0.0.1:8333 for mainnet, 127.0.0.1:18333 for testnet, 127.0.0.1:18444 for regtest and 127.0.0.1:38333 for signet)"
[[param]]
name = "monitoring_addr"
type = "crate::config::ResolvAddr"
doc = "Prometheus monitoring 'addr:port' to listen on (default: 127.0.0.1:4224 for mainnet, 127.0.0.1:14224 for testnet, 127.0.0.1:24224 for regtest and 127.0.0.1:34224 for regtest)"
[[param]]
name = "wait_duration_secs"
type = "u64"
doc = "Duration to wait between bitcoind polling"
default = "10"
[[param]]
name = "index_batch_size"
type = "usize"
doc = "Number of blocks to get in one JSONRPC request from bitcoind"
default = "10"
[[switch]]
name = "ignore_mempool"
doc = "Don't sync mempool - queries will show only confirmed transactions."
[[switch]]
name = "sync_once"
doc = "Exit after the initial sync is over (don't start Electrum server)."
[[param]]
name = "index_lookup_limit"
type = "usize"
doc = "Number of transactions to lookup before returning an error, to prevent 'too popular' addresses from causing the RPC server to get stuck (0 - disable the limit)"
default = "200"
[[param]]
name = "server_banner"
type = "String"
doc = "The banner to be shown in the Electrum console"
default = "concat!(\"Welcome to electrs \", env!(\"CARGO_PKG_VERSION\"), \" (Electrum Rust Server)!\").to_owned()"