Skip to content

network flag to support testnet4 #1120

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

Merged

Conversation

bitcoin-coder-bob
Copy link
Contributor

@bitcoin-coder-bob bitcoin-coder-bob commented Jul 27, 2025

testnet4 was not a supported option for the network flag. This PR adds testnet4 as an option and supports its usage in setNetwork.

I ran this and the node now connects to testnet4.

thank you @jharveyb who discovered this during the PlebFi hackathon

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @bitcoin-coder-bob, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for testnet4 as a network option. It enables the application's UI and components to operate seamlessly on testnet4 by allowing it to be specified via the network flag and ensuring the underlying LND Bitcoin configuration is correctly applied for this network.

Highlights

  • Network Configuration Expansion: I've expanded the supported options for the network command-line flag to include testnet4. This allows users to specify testnet4 directly when launching the application.
  • LND Testnet4 Support: I've updated the setNetwork function to correctly configure the LND Bitcoin settings for testnet4. When testnet4 is selected, cfg.Lnd.Bitcoin.TestNet4 will now be set to true.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request correctly adds support for testnet4. My review includes a suggestion to alias the testnet flag to testnet4 to improve usability.

@bitcoin-coder-bob bitcoin-coder-bob force-pushed the testnet4-network-option branch from b7a79ec to 4d506da Compare July 27, 2025 01:51
@bitcoin-coder-bob bitcoin-coder-bob marked this pull request as ready for review July 27, 2025 01:53
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@guggero guggero requested a review from ViktorTigerstrom July 28, 2025 05:52
Copy link
Contributor

@ViktorTigerstrom ViktorTigerstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a for the contribution @bitcoin-coder-bob 🙏!

There are some small additional changes that you'd would be need to add to this PR prior to us being able to merge it:

  1. We would need to add a release note entry for this change, similar to how one was added for the signet flag in docs/release-notes/release-notes-0.14.0.md. However, since there haven't been any docs/release-notes/release-notes-0.15.2.md file added to the master branch yet, you would need to add that file and add an entry for this change.
    If you are unsure of how to add that file, I can create a PR that just adds the file and merge it prior to merging this, whereby you'd rebase this PR on that merged change and just add an entry for this PR to that file. Let me know if you'd prefer that, or if you feel comfortable adding the full file to this PR!

  2. In itest/litd_node.go on line 292, you'd need to add a case for testnet4.

@bitcoin-coder-bob bitcoin-coder-bob force-pushed the testnet4-network-option branch from 4d506da to 5047e2d Compare July 28, 2025 20:17
@bitcoin-coder-bob
Copy link
Contributor Author

Thanks a for the contribution @bitcoin-coder-bob 🙏!

There are some small additional changes that you'd would be need to add to this PR prior to us being able to merge it:

  1. We would need to add a release note entry for this change, similar to how one was added for the signet flag in docs/release-notes/release-notes-0.14.0.md. However, since there haven't been any docs/release-notes/release-notes-0.15.2.md file added to the master branch yet, you would need to add that file and add an entry for this change.
    If you are unsure of how to add that file, I can create a PR that just adds the file and merge it prior to merging this, whereby you'd rebase this PR on that merged change and just add an entry for this PR to that file. Let me know if you'd prefer that, or if you feel comfortable adding the full file to this PR!
  2. In itest/litd_node.go on line 292, you'd need to add a case for testnet4.

Please let me know if I added the new release notes file correctly @ViktorTigerstrom

Copy link
Contributor

@ViktorTigerstrom ViktorTigerstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the updates and the addition of the release notes file, looks great 🎉! LGTM 🔥!

Leaving one tiny nit that I'd appreciate if you can address prior to us merging this.

Comment on lines 20 to 22
* Add support for connecting LiT to [testnet4](https://github.com/lightninglabs/lightning-terminal/pull/1120).
This can be done using the `--network=testnet4` config option.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
* Add support for connecting LiT to [testnet4](https://github.com/lightninglabs/lightning-terminal/pull/1120).
This can be done using the `--network=testnet4` config option.
* Add support for connecting LiT to the [testnet4
network](https://github.com/lightninglabs/lightning-terminal/pull/1120). This
can be done using the `--network=testnet4` config option.

The reasoning behind this suggested change is that we try to keep lines to 80 characters if possible, even in the release-notes.

@bitcoin-coder-bob bitcoin-coder-bob force-pushed the testnet4-network-option branch 2 times, most recently from 5bfa75d to 0eb9294 Compare July 29, 2025 16:03
Copy link
Contributor

@ViktorTigerstrom ViktorTigerstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the change @bitcoin-coder-bob!

Appologies though, I noticed that my previous suggestion lead to that the docs in the config.go file now exceeds 80chars, which we have maintained in that file so far.
Would you have the possibility to just fix that and I'll proceed to merge this 🚀?

Feel no need to re-request a review after that, just push the change and I'll proceed to merge as soon as CI passes :).

config.go Outdated
Comment on lines 181 to 182
// `lnd.bitcoin.mainnet|testnet|testnet4|regtest|signet` and also for the other
// daemons. That way only one global network flag is needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// `lnd.bitcoin.mainnet|testnet|testnet4|regtest|signet` and also for the other
// daemons. That way only one global network flag is needed.
// `lnd.bitcoin.mainnet|testnet|testnet4|regtest|signet` and also for
// the other daemons. That way only one global network flag is needed.

@bitcoin-coder-bob bitcoin-coder-bob force-pushed the testnet4-network-option branch from 0eb9294 to 2685477 Compare July 30, 2025 17:09
@guggero guggero merged commit ef87c7a into lightninglabs:master Jul 31, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants