Skip to content
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

feat(daemon): add --p2p-listen-address arg to forest #3995

Merged
merged 13 commits into from
Mar 5, 2024

Conversation

hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Feb 27, 2024

Summary of changes

As part of #3990
This PR allows overriding p2p listening addresses via CLI options, which is easier than using a config file. The next step is updating forest-iac to publicly expose the p2p addresses of forest nodes to allow accepting connections from new peers, to improve discoverability and connectivity.

Changes introduced in this pull request:

  • Add --p2p-listen-address CLI option to forest daemon
  • (To specify multiple addresses, --p2p-listen-address A --p2p-listen-address B)

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@hanabi1224 hanabi1224 marked this pull request as ready for review February 27, 2024 10:28
@hanabi1224 hanabi1224 requested a review from a team as a code owner February 27, 2024 10:28
@hanabi1224 hanabi1224 requested review from ruseinov and LesnyRumcajs and removed request for a team February 27, 2024 10:28
src/cli_shared/cli/mod.rs Outdated Show resolved Hide resolved
@@ -57,6 +58,9 @@ pub struct CliOpts {
/// Address used for RPC. By defaults binds on localhost on port 2345.
#[arg(long)]
pub rpc_address: Option<SocketAddr>,
/// P2P addresses, e.g. `--p2p-address /ip4/0.0.0.0/tcp/12345 --p2p-address /ip4/0.0.0.0/tcp/12346`
Copy link
Member

Choose a reason for hiding this comment

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

Let's use the word listening somewhere. I tend to grep for such keywords, and it's ultimately what it does. Perhaps --p2p-listening-address? Otherwise, at first glance, I'd assume it's an address to which Forest should connect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

hanabi1224 and others added 2 commits February 27, 2024 21:58
@hanabi1224 hanabi1224 changed the title feat(daemon): add --p2p-adderss arg to forest feat(daemon): add --p2p-listening-address arg to forest Feb 27, 2024
@@ -174,6 +178,10 @@ impl CliOpts {
}
}

if let Some(addresses) = &self.p2p_listening_address {
cfg.network.listening_multiaddrs = addresses.clone();
Copy link
Contributor

@ruseinov ruseinov Feb 28, 2024

Choose a reason for hiding this comment

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

nit: not a fan of "listening". "listen" is better. And is actually the way it's put for in e.g. ssh configs. Otherwise good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@LesnyRumcajs How about using listen instead of listening?

Copy link
Member

Choose a reason for hiding this comment

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

I'm okay with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ruseinov fixed.

@hanabi1224 hanabi1224 changed the title feat(daemon): add --p2p-listening-address arg to forest feat(daemon): add --p2p-listen-address arg to forest Feb 28, 2024
@hanabi1224 hanabi1224 added this pull request to the merge queue Mar 5, 2024
@hanabi1224 hanabi1224 removed this pull request from the merge queue due to a manual request Mar 5, 2024
@hanabi1224 hanabi1224 added this pull request to the merge queue Mar 5, 2024
Merged via the queue into main with commit 12fdae9 Mar 5, 2024
27 checks passed
@hanabi1224 hanabi1224 deleted the hm/cli-opt-p2p-address branch March 5, 2024 11:23
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.

None yet

4 participants