From 0d4ffc2dc0911ea04351ae6b6746fedbd6eb8423 Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Mon, 14 Feb 2022 20:38:13 +0100 Subject: [PATCH] add signet support, fix network section for testnet --- scripts/backup/backup | 7 +++++++ scripts/configure | 20 +++++++++++++++----- templates/bitcoin-sample.conf | 5 +++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/scripts/backup/backup b/scripts/backup/backup index 8f3a85b..a0be32d 100755 --- a/scripts/backup/backup +++ b/scripts/backup/backup @@ -140,6 +140,13 @@ cat < ${BACKUP_STATUS_FILE} EOF exit fi +if [[ $BITCOIN_NETWORK == "signet" ]]; then +rm -rf "${BACKUP_ROOT}" +cat < ${BACKUP_STATUS_FILE} +{"status": "skipped", "timestamp": $(date +%s000)} +EOF + exit +fi if [[ $BITCOIN_NETWORK == "regtest" ]]; then rm -rf "${BACKUP_ROOT}" cat < ${BACKUP_STATUS_FILE} diff --git a/scripts/configure b/scripts/configure index f918fd4..c1f5089 100755 --- a/scripts/configure +++ b/scripts/configure @@ -75,14 +75,14 @@ if os.path.isfile('../.citadel'): status_dir = os.path.join(CITADEL_ROOT, '..', 'statuses') updating = True -# Configure for mainnet or testnet or regtest depending +# Configure for appropriate network depending # upon the user-supplied value of $NETWORK # If the network is not specified, then use the mainnet BITCOIN_NETWORK=os.environ.get('NETWORK') or 'mainnet' # Check if network neither mainnet nor testnet nor regtest -if BITCOIN_NETWORK not in ['mainnet', 'testnet', 'regtest']: - print('Error: Network must be either mainnet, testnet, or regtest!') +if BITCOIN_NETWORK not in ['mainnet', 'testnet', 'signet', 'regtest']: + print('Error: Network must be either mainnet, testnet, signet or regtest!') exit(1) with open(os.path.join(CITADEL_ROOT, "info.json"), 'r') as file: @@ -155,8 +155,8 @@ if reconfiguring: BITCOIN_NETWORK=os.environ.get('OVERWRITE_NETWORK') or dotenv['BITCOIN_NETWORK'] # Check if network neither mainnet nor testnet nor regtest - if BITCOIN_NETWORK not in ['mainnet', 'testnet', 'regtest']: - print('Error: Network must be either mainnet, testnet, or regtest!') + if BITCOIN_NETWORK not in ['mainnet', 'testnet', 'signet', 'regtest']: + print('Error: Network must be either mainnet, testnet, signet or regtest!') exit(1) print("Using {} network".format(BITCOIN_NETWORK)) print() @@ -239,6 +239,14 @@ elif BITCOIN_NETWORK == "testnet": NEUTRINO_PEERS=''' [neutrino] neutrino.addpeer=testnet1-btcd.zaphq.io +neutrino.addpeer=testnet2-btcd.zaphq.io + ''' +elif BITCOIN_NETWORK == "signet": + BITCOIN_RPC_PORT=38332 + BITCOIN_P2P_PORT=38333 + NEUTRINO_PEERS=''' +[neutrino] +neutrino.addpeer=testnet1-btcd.zaphq.io neutrino.addpeer=testnet2-btcd.zaphq.io ''' elif BITCOIN_NETWORK == "regtest": @@ -251,6 +259,8 @@ else: NETWORK_SECTION="" if BITCOIN_NETWORK != "mainnet": NETWORK_SECTION = "[{}]".format(BITCOIN_NETWORK) +if BITCOIN_NETWORK == "testnet": + NETWORK_SECTION = "[test]" # IP addresses for services NETWORK_IP="10.21.21.0" diff --git a/templates/bitcoin-sample.conf b/templates/bitcoin-sample.conf index b1b5966..f137f9d 100644 --- a/templates/bitcoin-sample.conf +++ b/templates/bitcoin-sample.conf @@ -9,7 +9,7 @@ proxy=: listen=1 -# Mainnet/Testnet/regtest +# Mainnet/Testnet/Signet/regtest =1 # Connections @@ -21,7 +21,6 @@ rpcauth= dbcache=200 maxmempool=300 - # zmq zmqpubrawblock=tcp://0.0.0.0: zmqpubrawtx=tcp://0.0.0.0: @@ -40,6 +39,8 @@ peerblockfilters=1 +# NOTE: The options addnode, connect, port, bind, rpcport, rpcbind and wallet +# only apply to mainnet unless they appear in the appropriate section below. bind= port=