Skip to main content

Configuration

BTX Node configuration reference: btx.conf options, network sections, and example setups.

BTX Node is configured through a combination of a configuration file and command-line flags. Command-line flags take precedence over values in the config file.


Config File Location

PlatformDefault path
Linux~/.btx/btx.conf
macOS~/Library/Application Support/BTX/btx.conf

Create the config file if it does not exist:

# Linux
mkdir -p ~/.btx
touch ~/.btx/btx.conf
chmod 600 ~/.btx/btx.conf

# macOS
mkdir -p ~/Library/Application\ Support/BTX
touch ~/Library/Application\ Support/BTX/btx.conf
chmod 600 ~/Library/Application\ Support/BTX/btx.conf

Set permissions to 600 because the file may contain RPC credentials.


File Format

The config file uses a simple key=value format, one option per line. Lines starting with # are comments.

# This is a comment
server=1
txindex=1
rpcuser=myuser
rpcpassword=mypassword

Network Sections

Options can be scoped to a specific network using section headers. Unscoped options apply to all networks. Network-specific values override global ones.

# Global — applies to all networks
server=1
txindex=1

[main]
rpcport=19334

[test]
rpcport=29334

[regtest]
rpcport=39334

Available sections:

  • [main] — mainnet (default)
  • [test] — testnet
  • [regtest] — regression test network

Key Options

OptionDefaultDescription
server0Accept JSON-RPC commands. Required for btx-cli to work.
daemon0Run in the background as a daemon.
listen1Accept incoming P2P connections.
txindex0Maintain a full transaction index. Enables getrawtransaction for any txid.
datadir(platform default)Override the data directory path.
rpcport19334Port for JSON-RPC connections.
rpcbind127.0.0.1IP address to bind for RPC. Use 0.0.0.0 to allow remote connections (use with rpcallowip).
rpcuserUsername for JSON-RPC authentication.
rpcpasswordPassword for JSON-RPC authentication.
rpcallowip127.0.0.1Allow RPC connections from this IP/subnet (e.g. 192.168.1.0/24).
port19335Port for P2P connections.
addnodeAdd a peer to connect to (can be specified multiple times).
maxconnections125Maximum number of peer connections.
dbcache450UTXO database cache size in MB. Larger values speed up sync.
prune0Reduce storage by pruning old blocks. Value in MB (minimum 550).
zmqpubrawblockZMQ endpoint for raw block notifications (e.g. tcp://127.0.0.1:28332).
zmqpubrawtxZMQ endpoint for raw transaction notifications.

For the complete list of options, run:

./build-btx/bin/btxd --help

Command-Line Flags vs Config File

Every config file option can also be passed as a command-line flag prefixed with -:

# These are equivalent:
./build-btx/bin/btxd -server -txindex -rpcport=19334

# ...to having this in btx.conf:
# server=1
# txindex=1
# rpcport=19334

Command-line flags override config file values. Boolean options accept 0/1 in the config file and can be toggled with -option / -nooption on the command line.


Example Configurations

Full Archive Node

A fully-indexed node suitable for block explorers and API services:

server=1
daemon=1
txindex=1
listen=1
maxconnections=64
dbcache=2048

rpcuser=btxrpc
rpcpassword=CHANGE_ME_TO_A_STRONG_PASSWORD
rpcport=19334
rpcbind=127.0.0.1

# ZMQ notifications
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

Mining Node

Optimized for solo mining with MatMul PoW:

server=1
daemon=1
listen=1
txindex=0
dbcache=1024

rpcuser=miner
rpcpassword=CHANGE_ME_TO_A_STRONG_PASSWORD
rpcport=19334
rpcbind=127.0.0.1

# Connect to known peers
addnode=100.85.221.75
addnode=100.115.222.45
addnode=100.123.243.104

RPC-Only (No Incoming Peers)

A node that syncs the chain but does not accept inbound P2P connections — useful for wallets and services behind a firewall:

server=1
daemon=1
listen=0
maxconnections=8

rpcuser=service
rpcpassword=CHANGE_ME_TO_A_STRONG_PASSWORD
rpcport=19334
rpcbind=127.0.0.1

Local Regtest Development

A local regression-test node for development and testing:

regtest=1
server=1

[regtest]
rpcuser=dev
rpcpassword=dev
rpcport=39334

Start it with:

./build-btx/bin/btxd -regtest -daemon

Security Notes

  • Always set chmod 600 on your btx.conf to prevent other users from reading RPC credentials.
  • Never bind RPC to 0.0.0.0 without restricting access via rpcallowip and a firewall.
  • Use strong, random passwords for rpcuser/rpcpassword. Consider using rpcauth for hashed credentials instead.
  • If you do not need RPC, omit server=1 entirely.