Skip to content

Configuration Settings

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

Configuration Settings

BS 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.

[node]
# The number of threads in the database threadpool, defaults to 6.
database_threads = 6
# The number of threads in the network threadpool, defaults to 4.
network_threads = 4
# The number of threads in the memory threadpool, defaults to 4.
memory_threads = 4
# The maximum number of peer hosts in the pool, defaults to 1000.
host_pool_capacity = 1000
# The maximum number of orphan blocks in the pool, defaults to 50.
block_pool_capacity = 50
# The maximum number of transactions in the pool, defaults to 2000.
tx_pool_capacity = 2000
# The minimum height of the history database, defaults to 0.
history_height = 0
# The height of the checkpoint hash, defaults to 0.
checkpoint_height = 0
# The checkpoint hash, defaults to a null hash (no checkpoint).
checkpoint_hash = 0000000000000000000000000000000000000000000000000000000000000000
# The port for incoming connections, set to 0 to disable, defaults to 8333 (18333 for testnet).
# listen_port = 0
# The maximum number of outgoing P2P network connections, defaults to 8.
outbound_connections = 8
# The peer cache file path, defaults to 'peers'.
hosts_file = peers
# The blockchain directory, defaults to 'blockchain'.
blockchain_path = blockchain

[server]
# The query service endpoint, defaults to 'tcp://*:9091'.
query_endpoint = tcp://*:9091
# The heartbeat service endpoint, defaults to 'tcp://*:9092'.
heartbeat_endpoint = tcp://*:9092
# The block publishing service endpoint, defaults to 'tcp://*:9093'.
block_publish_endpoint = tcp://*:9093
# The transaction publishing service endpoint, defaults to 'tcp://*:9094'.
tx_publish_endpoint = tcp://*:9094
# Enable the publisher, defaults to false.
publisher_enabled = false

[identity]
# The server name, must be unique if specified.
# unique_name = 
# 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 = 

[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

The --version command line option displays the current version number of the server and dependent libraries.

The path to the configuration settings file is specified by the CONFIG command line argument, the BS_CONFIG environment variable, or by default as follows:

  • Linux/OSX (prefix): <prefix>/etc/libbitcoin/bs.cfg
  • Linux/OSX (default): /usr/local/etc/libbitcoin/bs.cfg
  • Windows: %ProgramData%\libbitcoin\bs.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 $ bs --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