Skip to content

Commit 9b0c00a

Browse files
authored
Add an option to specify a custom signet tx to check (#3088)
This change enables custom signets by allowing the user to specify the txid of a transaction to check or "" to skip this check for signet. See issue #3078.
1 parent fdc2077 commit 9b0c00a

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,12 @@ eclair.chain = "regtest"
284284
eclair.bitcoind.rpcport=18443
285285
```
286286

287-
For signet, add `signet=1` in `bitcoin.conf` or start with `-signet`, and modify `eclair.conf`:
287+
For signet, add `signet=1` in `bitcoin.conf` or start with `-signet`, and modify `eclair.conf` as follows. The `signet-check-tx` config parameter should be the txid of a transaction that exists in your signet, "" to skip this check, or if not specified, the default signet txid value will be used.
288288

289289
```conf
290290
eclair.chain = "signet"
291291
eclair.bitcoind.rpcport=38332
292+
eclair.bitcoind.signet-check-tx=<txid of signet tx>
292293
```
293294

294295
You may also want to take advantage of the new configuration sections in `bitcoin.conf` to manage parameters that are network specific,

docs/release-notes/eclair-vnext.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ This removes the need for increasing the commitment feerate based on mempool con
2222

2323
- The default for `eclair.features.option_channel_type` is now `mandatory` instead of `optional`. This change prepares nodes to always assume the behavior of `option_channel_type` from peers when Bolts PR [#1232](https://github.com/lightning/bolts/pull/1232) is adopted. Until [#1232](https://github.com/lightning/bolts/pull/1232) is adopted you can still set `option_channel_type` to `optional` in your `eclair.conf` file for specific peers that do not yet support this option, see `Configure.md` for more information.
2424

25+
- We added a configuration parameter to facilitate custom signet use. The parameter `eclair.bitcoind.signet-check-tx` should be set to the txid of a transaction that exists in your signet or set to "" to skip this check. See issue [#3079](https://github.com/ACINQ/eclair/issues/3078) for details.
26+
2527
### Miscellaneous improvements and bug fixes
2628

2729
#### Remove confirmation scaling based on funding amount

eclair-core/src/main/resources/reference.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ eclair {
4242
final-pubkey-refresh-delay = 3 seconds
4343
// If true, eclair will poll bitcoind for 30 seconds at start-up before giving up.
4444
wait-for-bitcoind-up = true
45+
// The txid of a transaction that exists in your custom signet network or "" to skip this check.
46+
signet-check-tx = "ff1027486b628b2d160859205a3401fb2ee379b43527153b0b50a92c17ee7955" // coinbase of block #5000 of default signet
4547
}
4648

4749
node-alias = "eclair"

eclair-core/src/main/scala/fr/acinq/eclair/Setup.scala

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ class Setup(val datadir: File,
9898
val config = system.settings.config.getConfig("eclair")
9999
val Seeds(nodeSeed, channelSeed) = seeds_opt.getOrElse(NodeParams.getSeeds(datadir))
100100
val chain = config.getString("chain")
101+
val chainCheckTx = chain match {
102+
case "mainnet" => Some("2157b554dcfda405233906e461ee593875ae4b1b97615872db6a25130ecc1dd6") // coinbase of #500000
103+
case "testnet" => Some("8f38a0dd41dc0ae7509081e262d791f8d53ed6f884323796d5ec7b0966dd3825") // coinbase of #1500000
104+
case "testnet4" => Some("5c50d460b3b98ea0c70baa0f50d1f0cc6ffa553788b4a7e23918bcdd558828fa") // coinbase of #40000
105+
case "signet" => if (config.hasPath("bitcoind.signet-check-tx") && config.getString("bitcoind.signet-check-tx").nonEmpty) Some(config.getString("bitcoind.signet-check-tx")) else None
106+
case "regtest" => None
107+
}
101108

102109
val chaindir = new File(datadir, chain)
103110
chaindir.mkdirs()
@@ -157,12 +164,9 @@ class Setup(val datadir: File,
157164
.filter(value => (value \ "spendable").extract[Boolean])
158165
.map(value => (value \ "address").extract[String])
159166
}
160-
_ <- chain match {
161-
case "mainnet" => bitcoinClient.invoke("getrawtransaction", "2157b554dcfda405233906e461ee593875ae4b1b97615872db6a25130ecc1dd6") // coinbase of #500000
162-
case "testnet" => bitcoinClient.invoke("getrawtransaction", "8f38a0dd41dc0ae7509081e262d791f8d53ed6f884323796d5ec7b0966dd3825") // coinbase of #1500000
163-
case "testnet4" => bitcoinClient.invoke("getrawtransaction", "5c50d460b3b98ea0c70baa0f50d1f0cc6ffa553788b4a7e23918bcdd558828fa") // coinbase of #40000
164-
case "signet" => bitcoinClient.invoke("getrawtransaction", "ff1027486b628b2d160859205a3401fb2ee379b43527153b0b50a92c17ee7955") // coinbase of #5000
165-
case "regtest" => Future.successful(())
167+
_ <- chainCheckTx match {
168+
case Some(txid) => bitcoinClient.invoke("getrawtransaction", txid)
169+
case None => Future.successful(())
166170
}
167171
} yield BitcoinStatus(bitcoinVersion, chainHash, ibd, progress, blocks, headers, unspentAddresses)
168172

0 commit comments

Comments
 (0)