Conversation
There was a problem hiding this comment.
This runs as is on regtest, which is a great start, but I noticed some issues when attempting to switch it back to testnet.
Stretch goal: it would be very nice if just could detect the network via an environment variable and fail fast with an error message like error: generate-blocks is only valid in regtest. current network: testnet4.
I restated this issue more clearly below, with precise instructions on how to implement it.
|
Ok, given that some just recipes need to know the bitcoin network I think the best way to approach this change is to set the Then validate it like so: This prevents users from entering invalid networks like typos ( Then set it as an env var like this: Access it within devenv.nix like this: Use it to fail fast in the |
|
Rebase from master. I just added the var and env var to |
|
I've done suggested changes (camelcase naming), and also:
Other potential issues:
|
vnprc
left a comment
There was a problem hiding this comment.
It works with regtest but when I switch to testnet4 the cln and jd-server processes both die trying to connect to the bitcoind RPC interface.
I was able to get jd-server running by changing the port in roles/jd-server/config-examples/jds-config-local-example.toml. In order to dynamically set this value we need to pass it via command line. If that is not an option it may require a code change in the rust module to add this cli parameter.
CLN is failing because testnet4 is not the right setting. CLN expects testnet and converts it to testnet4 on the backend. Once I hard coded this fix it failed again on the bcli plugin with is also misonfigured now. I'll leave it to you to continue troubleshooting.
Please test that both regtest and testnet4 work before requesting another review. I'm happy to set up some pair coding time if you'd like to go that route.
|
Sorry for all the back and forth. This task is deceptively difficult. That's just how it works out sometimes. ¯\_(ツ)_/¯ |
I haven't experienced this, I have tested several times with
I've mentioned in the previous comment that this is not yet done, in fact you mentioned "This file should be copied to /config and the processes definition updated, but that is outside of the scope of this PR.". Copying the file as setup time, and changing the port in it (via sed) may be another solution. In the previous comment I mentioned concerns about the Template Providers, could you also comment on those? |
|
Oh, you are probably running CLN v24, which does not support |
vnprc
left a comment
There was a problem hiding this comment.
Ok I have tested this PR with both networks. It works! It's rough around the edges but in the name of progress I declare this PR approved. We can roll forward and clean up the rough edges.
My issues with cln were caused by an apparent bug where it calls out to bitcoin-cli and sucks in the config file located at ~/.bitcoin/bitcoin.conf, which on my machine specified regtest when the nix daemon was running testnet4.
CLN should not behave this way because conf and dir are specified on the command line, but here we are. WYGD. I "fixed" the issue in this commit which just throws up a warning about this conflict if the config file is detected when starting up the devenv shell.
|
To address you previous questions:
addressed in one of your subsequent commits. nice!
Yeah I saw that too. It's kind of weird but this is in test code so I don't think it's an issue.
These are all test and example configs. Repurposing the example configs was a quick and dirty way to get started in this repo but we should be migrating away from these to our own configs in the top level |

More centralized control of the bitcoin network used. Currently it's
regtest, but can be switched easily totestnet4, by changing the config at the top ofdevenv.nix.Fixes #58
I'm not sure if
signetmakes sense, as there is no POW-based mining in signet.As for mainnet, it's a bit further down the road :)