Skip to content

Configuration

Complete reference for all blockd configuration settings.

All deployments require a configuration file. The default path is conf/blockd.yml — the file must use .yml or .yaml format.


A minimal working configuration:

server:
log_path: "var/log"
api:
enabled: true
key: "REPLACE_ME_secret_token"
bitcoind:
host: "127.0.0.1"
port: 28256
user: "rpcuser"
pass: "rpcpassword"
zmq:
hashtx: 9500
rawtx: 9501
hashblock: 9502
rawblock: 9503
sequence: 9504
electrum:
host: "127.0.0.1"
port: 50001
data_stores:
rocks:
path: "var/rocks"
blocks:
path: "var/blocks"

blockd supports two categories of environment variable: startup variables that control blockd’s own behavior, and BLOCKD__ prefixed variables that override individual values within the configuration file.

Startup variables:

VariableDescription
BLOCKD_CONFPath to the configuration file. Default: conf/blockd.yml
BLOCKD_DEBUGIf set to any value, prints log_path to the console on startup — useful for troubleshooting log path issues before the logger is initialized

Override variables:

Any value in the configuration file can be overridden using the BLOCKD__ prefix and __ as the separator for nested keys. Environment variables take precedence over values in the configuration file.

Terminal window
BLOCKD__BITCOIND__USER=myusername
BLOCKD__BITCOIND__PASS=mypassword
BLOCKD__ELECTRUM__HOST=192.168.1.50

Environment variable overrides are useful for keeping secrets out of the configuration file. Rather than storing sensitive values like API keys and RPC credentials in blockd.yml, set placeholder values in the file and supply the real values via environment variables at runtime:

# blockd.yml — safe to commit
api:
key: "REPLACE_ME"
bitcoind:
user: "REPLACE_ME"
pass: "REPLACE_ME"
Terminal window
# Supply real values at runtime
BLOCKD__API__KEY=my_secret_key
BLOCKD__BITCOIND__USER=myusername
BLOCKD__BITCOIND__PASS=mypassword

This keeps secrets out of version control and configuration backups without requiring a separate secrets management system. Environment variables can be set in a systemd unit, a Docker environment, or any other mechanism your deployment uses.


Controls the HTTP server, logging, and developer tooling.

server:
name: "node-12345"
host: "127.0.0.1"
port: 21000
log_path: "var/log"
log_level: "info"
console: false
cors:
enabled: false
origins: []
ParameterTypeDefaultDescription
namestringnullServer identifier returned in the version response
hoststring"127.0.0.1"Network interface to bind to. Use "0.0.0.0" to accept external connections
portinteger21000Listening port
log_pathstring | nullnullDirectory for log files. Set to null to log to stdout only (recommended for Docker)
log_levelstring"info"Log verbosity: off, error, warn, info, debug, trace
consolebooleanfalseEnable tokio-console on port 6669 for async task inspection. Development only — adds performance overhead. When enabled, log_level is forced to trace
server:
cors:
enabled: true
origins:
- "http://localhost:3000"
ParameterTypeDefaultDescription
enabledbooleanfalseEnable CORS headers
debugbooleanfalseEnable CORS headers logging for debugging
originsstring[] | nullnullAllowed origins. See below.

origins accepts a list of allowed origin URLs. Set to null (YAML null) or [] to allow all origins.

# Inline
origins: ["https://myapp.com", "https://www.myapp.com"]
# Block sequence
origins:
- "https://myapp.com"
- "https://www.myapp.com"

Development:

server:
cors:
enabled: true
debug: true
origins: []

Production:

server:
cors:
enabled: true
origins:
- "https://myapp.com"
- "https://www.myapp.com"

Controls the user-facing API key.

api:
enabled: true
key: "your-api-key-here"
ParameterTypeDefaultDescription
enabledbooleanrequiredEnable API key authentication. Must be present in the config file or blockd will not start
keystring | nullnullAPI key. Can be omitted from the config file and supplied via the BLOCKD__API__KEY environment variable instead. The final resolved value must be 16–64 characters

Connection and permission settings for Bitcoin Core.

bitcoind:
host: "127.0.0.1"
port: 8332
user: "rpcuser"
pass: "rpcpassword"
zmq:
hashtx: 9500
rawtx: 9501
hashblock: 9502
rawblock: 9503
sequence: 9504
rpc_permissions:
opt_in: [ "getblocktemplate" ]
deny: [ "getblock", "getblockchaininfo" ]
ParameterTypeDescription
hoststringBitcoin Core RPC host
portintegerBitcoin Core RPC port
userstringRPC username
passstringRPC password
zmqmapZMQ topic-to-port mappings — see below
rpc_permissionsobjectMethod allow/deny overrides — see below

Maps ZMQ notification topics to ports. blockd connects to tcp://{host}:{port} for each topic. All five topics are required — blockd will not function correctly if any are missing.

bitcoind:
zmq:
hashtx: 9500
rawtx: 9501
hashblock: 9502
rawblock: 9503
sequence: 9504

Multiple topics can share a port, though separate ports are recommended. For example, to consolidate onto three ports:

bitcoind:
zmq:
hashtx: 9500
rawtx: 9500
hashblock: 9500
rawblock: 9501
sequence: 9502

Ports must match the ZMQ configuration in your bitcoin.conf:

zmqpubhashtx=tcp://0.0.0.0:9500
zmqpubrawtx=tcp://0.0.0.0:9501
zmqpubhashblock=tcp://0.0.0.0:9502
zmqpubrawblock=tcp://0.0.0.0:9503
zmqpubsequence=tcp://0.0.0.0:9504

blockd proxies a subset of Bitcoin Core RPC methods. Most read-only methods are allowed by default. Use opt_in and deny to adjust access.

Permission resolution order:

  1. Start with the set of Default-allowed methods (others are restricted)
  2. opt_in promotes a restricted method to allowed
  3. deny overrides everything — it blocks a method even if it would otherwise be allowed
bitcoind:
rpc_permissions:
opt_in: [ "getblocktemplate" ]
deny: [ "getblock", "getblockchaininfo" ]

For the full list of supported methods, default permissions, and the reasoning behind each restriction, see Core RPC Methods.


Connection settings for an Electrum-compatible server (e.g. Fulcrum).

electrum:
host: "127.0.0.1"
port: 50001
ParameterTypeDescription
hoststringElectrum server hostname or IP
portintegerElectrum server port
tlsobject | nullTLS settings. Omit for plain TCP
electrum:
host: "192.168.1.100"
port: 50002
tls:
enabled: true
ca:
verify: false
client_cert:
cert_path: "certs/client.crt"
key_path: "certs/client.key"
ParameterTypeDefaultDescription
enabledbooleantrueEnable TLS
ca.verifybooleantrueVerify the server certificate against system CAs. Set to false for self-signed certificates
ca.pathstring | nullnullPath to a custom CA certificate file
client_cert.cert_pathstring | nullnullPath to client certificate (mTLS)
client_cert.key_pathstring | nullnullPath to client private key (mTLS)

ca.verify defaults to true, requiring explicit opt-out for self-signed certificates.


The workflow engine retains a history of finished workflows. A finished workflow will have a state of completed, cancelled, or failed.

Workflow results are retrieved by the endpoints GET /workflows and GET /workflows/{id}.

Default values are suitable for most use cases but can be tuned if needed.

engine:
history_ttl: 120
history_max: 200
ParameterTypeDefaultDescription
history_ttlinteger120How long (in seconds) a finished workflow remains visible in the history
history_maxinteger200Maximum number of finished workflows to retain. Oldest are evicted first when the limit is reached

Operational Notes:

  • A workflow is added to history the moment it reaches a terminal state — completed, cancelled, or failed
  • Once history_max is reached, the oldest entry is evicted to make room for the newest, regardless of its age
  • Once history_ttl expires, a workflow will no longer appear in query results even if it is still within the history_max limit

RocksDB is the primary persistent store for workflow results and cached wallet data.

data_stores:
rocks:
path: "var/rocks"
cache_size: "8MB"
ParameterTypeDefaultDescription
pathstring"var/rocks"Directory for the RocksDB database
cache_sizestring"8MB"Block cache size allocated to RocksDB

cache_size accepts human-readable byte sizes: B, KB / K, MB / M, GB / G, TB / T. For example: "64MB", "1GB", "512M".

A filesystem-backed cache for raw block data retrieved via core.getblock. Cached blocks expire after time_to_live seconds. A cleanup task runs periodically to remove expired entries.

data_stores:
blocks:
path: "var/blocks"
time_to_live: 180
cleanup_interval: 5
cleanup_batch: 1000
ParameterTypeDefaultDescription
pathstring"var/blocks"Directory for cached block data
time_to_liveinteger180Seconds before a cached block expires
cleanup_intervalinteger5Seconds between cleanup runs
cleanup_batchinteger1000Maximum entries removed per cleanup run

Named in-memory cache instances backed by Moka. Three instances are used internally — workflow_data, core_batches, and core_results — and all default to sensible values. Most deployments will not need to adjust these.

data_stores:
cache:
workflow_data:
max_capacity: 10000
time_to_live: 900
time_to_idle: 300
core_batches:
max_capacity: 10000
time_to_live: 900
time_to_idle: 300
core_results:
max_capacity: 10000
time_to_live: 900
time_to_idle: 300
ParameterTypeDefaultDescription
max_capacityinteger10000Maximum number of entries
time_to_liveinteger900Seconds before an entry expires after creation
time_to_idleinteger300Seconds before an entry expires after last access