feat: add support for bitcoin regtest

This commit is contained in:
fusion44 2022-08-18 20:13:50 +02:00
parent ecfaadd0c1
commit 268bcf5072
2 changed files with 9 additions and 1 deletions

View file

@ -57,17 +57,21 @@ shell_script_path = /home/admin
# leave commented if no password is used
# redis_password=my_password
# mainnet or testnet
# mainnet, testnet or regtest
network=testnet
bitcoind_ip_mainnet=192.168.1.18
bitcoind_ip_testnet=192.168.1.18
bitcoind_ip_regtest=192.168.1.18
bitcoind_port_rpc_mainnet=8332
bitcoind_port_rpc_testnet=18332
bitcoind_port_rpc_regtest=28332
# The API can either hashblock OR rawblock to be notified of new blocks.
# Hashblock is a bit faster, so it should be used if possible.
bitcoind_zmq_block_rpc="hashblock"
bitcoind_zmq_block_port_mainnet=28332
bitcoind_zmq_block_port_testnet=28332
bitcoind_zmq_block_port_regtest=28332
bitcoind_user=raspibolt
bitcoind_pw=please_please_update_me_please

View file

@ -18,6 +18,10 @@ class _BitcoinConfig:
self.ip = config("bitcoind_ip_testnet")
self.rpc_port = config("bitcoind_port_rpc_testnet")
self.zmq_port = config("bitcoind_zmq_block_port_testnet")
elif self.network == "regtest":
self.ip = config("bitcoind_ip_regtest")
self.rpc_port = config("bitcoind_port_rpc_regtest")
self.zmq_port = config("bitcoind_zmq_block_port_regtest")
else:
self.ip = config("bitcoind_ip_mainnet")
self.rpc_port = config("bitcoind_port_rpc_mainnet")