-
Notifications
You must be signed in to change notification settings - Fork 872
Adds the ability to register custom Bitcoin signets #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Aaron Clauson <aaron@sipsorcery.com>
|
Does #1222 help you? |
|
Thanks for the follow-up.
I don't think so. Isn't MutinyNet just hard coding another signet variation? This PR is so the hard coded parameters are not required and NBitcoin can be used with any arbitrary signet challenge. |
|
@sipsorcery concept ACK, but can you rebase as I merged #1222 which moved some stuff around |
|
@Kukks I was looking at the signet and mutinynet initialisation and the only differences are:
One thing not different, that I suspect should be, is the genesis block. I think NBXplorer uses it to detect the start of the chain. MutinyNet can't be using the same genesis block as the default signet chain given they have different block signing keys. Might not matter if NBXplorer is not being used. I could add another partial class to initialise a custom signet but it would seem better to create a single bitcoin signet class that can be initialised with different options for the parameters above. wdyt? |
|
ACK good idea, we also use a custom signet. |
d114a5d to
e4c0829
Compare
725a14b to
bbcaf18
Compare
|
I believe this should be possible now without this PR. Could you check? |
|
@Kukks unless I've missed something there's still no way to register a I'm running a set of signet nodes that aren't using the default signet or mutinynet signing key. The idea bheind this PR was to be bale to register a network with an arbitrary signet challenge and genesis block. The approach in this PR is outdated. It would now be better to either use a new Bitcoin.SignetCustom class or avoid a lot of repeated code and combine Bitcoin.Signet, Bitcoin.MutinyNet and BitcoinSignetCustom into a common class with some way to set the different properties, e.g. block spacing, name, challenge and genesis block. |
|
I would like to add a BtcPayServer service to my signet-playground Docker stack, but doesn't seem possible without this PR. The other option seem to be hacking at the code in personal forks of NBitcoin, NBXplorer and BtcPayServer, which I'm not willing to do :( |
|
@NicolasDorier @Kukks I just ended up using my own build for NBitcoin so I could run a custom signet. I'm happy to update this PR if you think it's of value? |
|
@sipsorcery I think that would be nice yes. |
|
@sipsorcery there seems to have still conflict |
|
@NicolasDorier the new PR is #1293. This one is redundant now. |
|
@sipsorcery but CI is broken in that one. |
|
@knocte I spotted the broken tests as well. The tests all fail locally as well and as best I can tell are unrelated to the PR. The two new tests added for the custom signet do pass. |
|
But master branch is passing CI recently: https://github.com/MetacoSA/NBitcoin/actions?query=branch%3Amaster Are you sure they are unrelated? |
|
Mmm you're right, i just pushed master to my fork and there's a lot of tests failing because of 404s. Maybe because tests rely on some BtcCore version that was taken down from the releases page? I recall there was a security bug recently. Ideally we should fix this before merging any PR. |
|
This should do it: #1295 |


With testnet full of spam a custom sigent has become more appealing.
This PR is an attempt at allowing NBitcoin to initialise a signet with a custom challenge (no more flakey faucets).
I got this approach to work with nbxplorer to index my custom signet blockchain but despite that I'm not sure if this is the ideal approach or not. Happy to take any advice on alternatives.