Skip to content

Configuration Settings

Eric Voskuil edited this page Feb 11, 2015 · 30 revisions

Configuration Settings

Libbitcoin Server uses Boost's program_options library to bind configuration settings to strongly-typed application level properties.

The implementation supports a two level hierarchy of settings using "sections" to group settings, similar to an .ini file:

# Libbitcoin Server configuration file.

[general]
# The blockchain directory, defaults to 'blockchain'.
blockchain_path = blockchain
# The minimum height of the history database, defaults to 0.
history_height = 0
# The peer cache file path, defaults to 'hosts'.
hosts_file = hosts
# Enable the listening for incoming connections, defaults to true.
listener_enabled = true
# The maximum number of outgoing P2P network connections, defaults to 8.
out_connections = 8
# Enable the publisher, defaults to false.
publisher_enabled = false
# The maximum number of transactions in the pool, defaults to 2000.
tx_pool_capacity = 2000

[logging]
# The debug log file path, defaults to 'debug.log'.
debug_file = debug.log
# The error log file path, defaults to 'error.log'.
error_file = error.log
# Write service requests to the log, impacts performance, defaults to false.
log_requests = false

[endpoints]
# The query service endpoint, defaults to 'tcp://*:9091'.
service = tcp://*:9091
# The heartbeat endpoint, defaults to 'tcp://*:9092'.
heartbeat = tcp://*:9092
# The block publishing service endpoint, defaults to 'tcp://*:9093'.
block_publish = tcp://*:9093
# The transaction publishing service endpoint, defaults to 'tcp://*:9094'.
tx_publish = tcp://*:9094

[identity]
# The path to the ZPL-encoded server private certificate file.
# cert_file = 
# The directory for ZPL-encoded client public certificate files, allows anonymous clients if not set.
# client_certs_path = 
# Allowed client IP address, all clients allowed if none set, multiple entries allowed.
# client = 127.0.0.1
# client = 
# Node to augment peer discovery, formatted as host:port, multiple entries allowed.
# peer = obelisk.airbitz.co:8333
# peer = 
# The server name, must be unique if specified.
# unique_name = 

The path to the configuration settings file is specified by the --config command line option, the BX_CONFIG environment variable, or by default as follows:

  • Linux/OSX (prefix): <prefix>/etc/libbitcoin/bx.cfg
  • Linux/OSX (default): /usr/local/etc/libbitcoin/bx.cfg
  • Windows: %ProgramData%\libbitcoin\bx.cfg

The Windows directory is hidden by default. If the file is not found default values are loaded. If the file is contains invalid settings an error is returned via STDERR. If any setting is not specified its default is loaded.

The $ bitcoin_server --settings command option the definition for all configuration settings.

Environment Variables

Libbitcoin Server uses Boost's program_options library to bind environment variables. All environment variables are prefixed with BS_. BS_CONFIG is the only bound environment variable.

Clone this wiki locally