-
Notifications
You must be signed in to change notification settings - Fork 847
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
Add TestNet4 for Bitcoin #1216
Add TestNet4 for Bitcoin #1216
Conversation
These are the only two I am aware of for the vSeeds right now:
You can verify this here: https://github.com/fjahr/bitcoin/blob/2024-04-testnet-4-fix/src/kernel/chainparams.cpp#L350 |
I added a PR to yours, so you can merge in if you want. |
Thanks!! Not sure why I missed that. |
ACK. It connects to the p2p network and interacts with it flawlessly. What else should I test? @NicolasDorier ? |
Do not add |
NBitcoin/Bitcoin.cs
Outdated
public Network Regtest => Network.RegTest; | ||
|
||
public string CryptoCode => "BTC"; | ||
|
||
public static readonly ChainName TestNet4Name = new ChainName("TestNet4"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is why I took so long to push: I'm not sure if it's correct to have this public
. I tried another approach and move TestNet4
to Bitcoin
class but ended up with a similar (worse probably) problem, see
@lontivero Can you check at last commit please? 9b4a9aa |
I don't have context. Why is not okay to have a ChainName for testnet4? |
@lontivero testnet4 is only for Bitcoin. Other blockchains (Litecoin, Dash etc.) don't have that. @turbolay do you have any blocker to have progress with this, is it ready to be reviewed? Relevant change is already merged to Bitcoin Core. |
@farukterzioglu I think it's OK, even if the solution doesn't look like the best Please also considerate this alternative, that makes other kind of compromises: turbolay@abc2aec#diff-12355e5baf374196ed9c5a0708f16632568b4bfc9139c8daff9aca066fd9f8e1 Feel free to request changes, I would apply fast, or take over the PR. |
@NicolasDorier, above lontivero confirmed it can connect to the new testnet. And it is refactored as you suggested above. |
Can you rebase? We moved things around to get everything cleaner |
Sorry I am busy lately, thank you for the refactor, it looks good indeed. I will rebase tonight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this is a horrible converter with so many hardcoded stuff. It should use Network natively..
Fixes #1216
This PR doesn't replace
TestNet
byTestNet4
, it simply adds toNetwork
andBitcoin
the fieldTestNet4
. Most interesting file to look at is Network.csI also replicated some of the tests we have for
TestNet
toTestNet4
I used @jlopp 's value for network magic.
I however don't know what to use as
vSeeds
:NBitcoin/NBitcoin/Network.cs
Lines 2288 to 2295 in 828b7d9