Add ConnectPeer API endpoint#107
Merged
benthecarman merged 1 commit intolightningdevkit:mainfrom Jan 23, 2026
Merged
Conversation
|
👋 Thanks for assigning @benthecarman as a reviewer! |
b2958d7 to
95aab15
Compare
Collaborator
|
See #103 |
Closed
Collaborator
benthecarman
left a comment
There was a problem hiding this comment.
can you add to the cli as well?
95aab15 to
ff1c271
Compare
Contributor
Author
|
CLI added. But I see this may be a duplicate indeed. |
ldk-server/src/api/connect_peer.rs
Outdated
| let address = SocketAddress::from_str(&request.address) | ||
| .map_err(|_| ldk_node::NodeError::InvalidSocketAddress)?; | ||
|
|
||
| let persist = request.persist.unwrap_or(true); |
Collaborator
There was a problem hiding this comment.
Why default to true here? I feel like false would make more sense
Contributor
Author
There was a problem hiding this comment.
Switched to false
Contributor
Author
There was a problem hiding this comment.
Also only made it default for the cli. On the API, defaults can only cause problems in my experience.
e85191a to
9f5fe2f
Compare
Adds a new endpoint to connect to a peer on the Lightning Network without opening a channel. This is useful for establishing connections before channel operations or for maintaining peer connectivity. The endpoint accepts node_pubkey, address, and a persist flag that indicates whether the peer should be re-connected on restart. Also adds client library and CLI support for the new endpoint. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9f5fe2f to
acb1bb8
Compare
Contributor
Author
benthecarman
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new endpoint to connect to a peer on the Lightning Network without opening a channel. This is useful for establishing connections before channel operations or for maintaining peer connectivity.
The endpoint accepts node_pubkey, address, and an optional persist flag that defaults to true for automatic reconnection on restart.
Needed this endpoint when working on #108. Nodes sometimes seems very slow to auto-reconnect, or not reconnect at all?