-
Notifications
You must be signed in to change notification settings - Fork 905
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
rpc: use the standard port derivation in connect command #5242
rpc: use the standard port derivation in connect command #5242
Conversation
7746843
to
dbc4c6c
Compare
dbc4c6c
to
7ffd207
Compare
b2bb0cb
to
c60287b
Compare
de82bf1
to
4911862
Compare
Second commit fixes up mistakes in the first: please clean that up! Results look good though! |
4911862
to
f18bc50
Compare
Ops! sorry!
Looks like already done :) seems that I clean up my memory! |
Here's a little more documentation: diff --git a/doc/lightning-connect.7.md b/doc/lightning-connect.7.md
index c2e9851f7..ebdc3d8c0 100644
--- a/doc/lightning-connect.7.md
+++ b/doc/lightning-connect.7.md
@@ -18,7 +18,11 @@ be of the form *id@host* or *id@host:port*. In this case, the *host* and
*host* is the peer's hostname or IP address.
-If not specified, the *port* defaults to 9735.
+If not specified, the *port* depends on the current network:
+- **bitcoin** mainnet: 9735.
+- bitcoin **testnet**: 19735.
+- bitcoin **signet**: 39735.
+- bitcoin **regtest**: 19846.
If *host* is not specified (or doesn't work), the connection will be attempted to an IP
belonging to *id* obtained through gossip with other already connected
diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md
index 5fc07bea9..07388d262 100644
--- a/doc/lightningd-config.5.md
+++ b/doc/lightningd-config.5.md
@@ -370,7 +370,8 @@ network.
Note that for simple setups, the implicit *autolisten* option does the
right thing: for the mainnet (bitcoin) network it will try to bind to
port 9735 on IPv4 and IPv6, and will announce it to peers if it seems
-like a public address.
+like a public address (and other default ports for other networks,
+as described below).
Core Lightning also support IPv4/6 address discovery behind NAT routers.
If your node detects an new public address, it will update its announcement. |
f18bc50
to
083cf8d
Compare
trivial rebase and docs updated |
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.
You also need to get rid of "DEFAULT_PORT" throughout the code (many are in tests: the can have a local definition no problems!).
But this shows some places you missed!
083cf8d
to
7ec6353
Compare
1380474
to
c0ed812
Compare
b7b78b6
to
c79bd94
Compare
8c448e9
to
15b9443
Compare
Complete implementation of BOLT1 port derivation proposal lightning/bolts#968 Changelog-Added: rpc: use the standard port derivation in connect command when the port is not specified. Signed-off-by: Vincenzo Palazzo <[email protected]>
This doesn't make sense, but for now we just keep it Signed-off-by: Vincenzo Palazzo <[email protected]>
Suggested-by: @rustyrussell Signed-off-by: Vincenzo Palazzo <[email protected]> # Title: Signed-off-by: Vincenzo Palazzo <[email protected]>
5adb0f3
to
2aa523d
Compare
Signed-off-by: Vincenzo Palazzo <[email protected]>
2aa523d
to
465e32e
Compare
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.
Looks good, one overzealous change found!
7b1d127
to
6eeb74c
Compare
6eeb74c
to
173ec20
Compare
I fixed the last commit (I was wrong: gossipwith did not set chainparams, which already caused problems, since gossipwith -h would crash!). |
[Also fixes crash with -h, since chainparams was not set! --RR]
173ec20
to
90b6cbc
Compare
Thanks! Looks like also that the tests related to the network looks good! |
Ack 90b6cbc |
adding the port derivation when the port is not specified in the connect command.
Complete implementation of BOLT1 port derivation proposal lightning/bolts#968
Let's see if some tests in CI will be unhappy
Signed-off-by: Vincenzo Palazzo [email protected]