Test Mode Configuration
The bitcoin node is configured via a file called bitcoind.conf. This file is expected to reside in the data folder of your bitcoin node installation. This folder is located at $BITCOIN_HOME/data; and the config file should be located at $BITCOIN_HOME/data/bitcoind.conf. This configuration file should be created if it does not exists.
For our Regression Test Node setup, we will configure the following parameters :
Setting | Description | value |
---|---|---|
daemon | Set to (1) if we want to run in daemon mode (background) | 0 |
regtest | Set to (1) to run a regression test node | 1 |
txindex | Maintain a full transaction index,used by the getrawtransaction rpc call | 1 |
rpcbind | IP address for JSON-RPC Server to bind to | 1 |
rpcport | TCP port where JSON-RPC Server will listen for requests | 1 |
whitelist | Do not require local clients to authenticate to the JSON-RPC Server | 127.0.0.1 |
debug | More verbose logging. Useful. | 1 |
excessiveblocksize | Maximum block size that the node will accept | 2000000000 |
maxstackmemoryusageconsensus | Maximum amount of memory that a Script can consume during evaluation. | 200000000 |
NOTE: BitcoinSV Node software has moved a consensus model wherein the block sizes are completed uncapped, and the maximum sizes are determined through miner-consensus. These settings are documented at the Choosing Consensus Settings page of the Bitcoin SV client node website.
Our bitcoind.conf will look as follows:
# Use the regtest network, because we can generate blocks as needed.
regtest=1
# The use of bitcoin cash address format is deprecated. Disable.
usecashaddr=0
# In this example, we will keep bitcoind running in one terminal window.
# So we don't need it to run as a daemon.
daemon=1
# Have our local node generate a transaction index to allow for faster queries
txindex=1
# RPC settings (inbound RPC connections)
rpcbind=127.0.0.1
rpcport=18332
whitelist=127.0.0.1
debug=1
rpcworkqueue=128
rpcthreads=128
rpctimeout=220
# Enable the JSON-RPC Server. This is required by bitcoin-cli.
server=1
# In this example we are only interested in receiving raw transactions.
# The address here is the URL where bitcoind will listen for new ZeroMQ connection requests.
#zmqpubrawtx=tcp://127.0.0.1:28332
#zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubhashtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
#See https://bitcoinsv.io/choosing-consensus-settings/
# 2Gb execessive block size
# 200Mb max stack memory
excessiveblocksize=2000000000
maxstackmemoryusageconsensus=200000000
Set the environment variable $BITCOIN_HOME to the directory where you installed the bitcoin client node.
export BITCOIN_HOME=~/bin/bitcoin-sv-1.0.3
We can now start our node by running the following command:
$BITCOIN_HOME/bin/bitcoind -datadir=$BITCOIN_HOME/data
You can monitor the log for the Regression Test Mode as follows :
tail -f $BITCOIN_HOME/data/regtest/bitcoind.log