Repository navigation
Support signet and testnet4 deployments - #307
Conversation
sebsgent
left a comment
There was a problem hiding this comment.
Should:
- The warning in
docs/configuration.md("Use separate deployments to keep nodes on different networks … services such as Fulcrum, Mempool and BTCPay Server reuse their configured databases") is the main risk of this feature, but it reads as a closing remark after the compatibility list and is easy to miss. Switching an existing node'sservices.bitcoind.networkin place keeps those services' existing databases, e.g. mainnet BTCPay stores and xpubs carry over to signet, while Bitcoin Core, Core Lightning and electrs move to per-network dirs. Please make it stand out (the docs already use admonitions, e.g.> [!NOTE]indocs/install.md) and say what happens on an in-place switch. The release note could link to it too.
Tested: merged onto current master, checks.x86_64-linux.module-config passes; CI covers the new signet/testnet4 VM scenarios. Checked that the pinned lndinit's --network choices exclude signet/testnet4, and that mainnet config is unchanged apart from the explicit --network=mainnet on wallet init.
Assisted-by: Claude Code (Claude Opus 5.5)
e1223d6 to
cbc2310
Compare
|
@sebsgent Thanks for the review. In 678eff6 I moved the warning to the top of the Bitcoin network section, before the configuration example. It now recommends a separate deployment for each network and explains what happens if you change Bitcoin Core, Core Lightning and electrs switch to per-network directories. Fulcrum, Mempool, BTCPay Server and NBXplorer reuse their existing databases. I included your example explicitly: switching a BTCPay node from mainnet to signet leaves its mainnet stores and xpubs in the database used on signet. The 0.2.0 release note now links directly to the warning. I also checked that the warning appears in the built guide. Release note |
|
This overlaps with #305 in the bitcoind preStart. Both move the blocks chmod to the network dir, and #305 adds a local |
ostermayer
left a comment
There was a problem hiding this comment.
I checked each module that a signet or testnet4 node can now enable against the pinned upstream versions. That covers the network names, ports, data dirs, the NBXplorer cookie dir, the Mempool frontend, the lnd and plugin assertions with indirect enables, and the regtest onion notice. Those hold. Three things don't, and the first two are about the in-place switch that the warning describes.
- The backups follow only the current network, so an in-place switch puts the old network's data back in. modules/backups.nix excludes
lightningd.sqlite3only in the current network dir, but it includes all of /var/lib/clightning. On signet the file list excludes /var/lib/clightning/signet/lightningd.sqlite3 and keeps /var/lib/clightning/bitcoin/lightningd.sqlite3. The 0.2.0 backups change took that file out because a restored old copy can lose the channel funds. The bulk data has the same gap. On mainnet the list doesn't exclude signet/blocks or testnet4/blocks, so a node that ran signet before backs up the whole signet chain. Please exclude the Core Lightning database in every dir belowclightning.dataDir(a*for the network dir in the duplicity file list does that), and put the signet and testnet4 dirs inbulkDataDirson every network. - With
services.clightning.replication, an in-place switch overwrites the old network's replica. modules/clightning-replication.nix puts the replica at<dir>/lightningd.sqlite3on every network. On the first start on signet, Core Lightning finds a replica with anotherdata_versionand copies the new, empty database over it (db/db_sqlite3.c). So the mainnet replica is gone while the node runs signet. Please keep the replica apart per network, for examplelightningd-signet.sqlite3on the new networks, which keeps the mainnet path. Or add it to the warning. - The testnet4
blockexplorerlinkline in modules/btcpayserver.nix has no effect on a bitcoinix node. BTCPay sets it inBlockExplorerLinkStartupTaskand then callsRefreshTransactionLinkTemplates. OncePoliciesSettingsis stored, that call resets every link to the stored override or the built-in default.btcpayserver-admincreates the first admin through the Greenfield API, and that storesPoliciesSettingsbecausedisable-registrationdefaults to true. So every start falls back tohttps://mempool.space/testnet/tx/{0}. I checked this in the testnet4 VM. The store reports page lists the testnet3 link. When I delete the stored policies and restart BTCPay, it lists the testnet4 link. I'd drop the line and point testnet4 users to the block explorer setting in the server policies. The real fix is upstream inBitcoinPlugin.cs, which picks the testnet3 link for every chain that isn't mainnet or signet.
|
@ostermayer Thanks for tracing these. I addressed all three points in 60b01636.
|
60b0163 to
08e3af6
Compare
seberm
left a comment
There was a problem hiding this comment.
No must/should items. The earlier review points and the backup, replica and BTCPay points from ostermayer's review are resolved in 678eff6 and 60b0163.
Tested: merged onto current master, checks.x86_64-linux.module-config passes, and the clightning-replication VM test (not in CI) passes, including the new mainnet → signet → testnet4 replica checksum steps. Checked that the per-network P2P, RPC and onion ports match Bitcoin Core's defaults.
Assisted-by: Claude Code (Claude Opus 5.5)
Select public test networks through services.bitcoind.network and reject incompatible LND and Core Lightning plugin configurations at evaluation. Document which services reuse their databases on an in-place switch. Align the regtest onion target with Bitcoin Core and cover the override in the 0.2.0 upgrade notes. Assisted-by: OpenAI Codex (GPT-6.2 Astra)
Exclude inactive Core Lightning databases, SQLite sidecars and local replicas from backups. Apply the bulk-data setting to mainnet, signet and testnet4 regardless of the selected network. Give signet and testnet4 distinct live replica files. Exercise both network switches in the replication VM and check the contents of a duplicity archive. BTCPay reloads the block explorer from its stored server policies. Document the testnet4 policy setting and remove the ineffective config override. Assisted-by: OpenAI Codex (GPT-6.2 Astra)
08e3af6 to
0767104
Compare
Target release v0.2.0. Follows #253 and addresses #17 for signet and testnet4.
Set
services.bitcoind.networkto"signet"or"testnet4"to configure Bitcoin Core and its dependent services. Core Lightning, electrs, Fulcrum, Unbeholden Wallet, Mempool and BTCPay Server can use either network. Evaluation rejects LND on both because the packagedlndinitcannot initialize those wallets. CLBOSS and Trustedcoin are rejected on testnet4.The configuration guide warns that switching networks in place reuses the Fulcrum, Mempool, BTCPay Server and NBXplorer databases. Use separate deployments to keep their data apart.
On regtest, the generated Tor mapping now forwards port 18444 to local port 18445. Users who maintain their own mapping can update its target or keep
services.bitcoind.onionPort = 8334;. The 0.2.0 migration notice targets nodes using the default.Verification