Skip to content

Allow hostname RPC support#136

Merged
benthecarman merged 1 commit intolightningdevkit:mainfrom
Anyitechs:split-rpc-addr
Mar 2, 2026
Merged

Allow hostname RPC support#136
benthecarman merged 1 commit intolightningdevkit:mainfrom
Anyitechs:split-rpc-addr

Conversation

@Anyitechs
Copy link
Contributor

@Anyitechs Anyitechs commented Feb 25, 2026

This removes the restriction of SocketAddr and allows us to support hostnames, which is essential in containerized/dynamic environments.

Closes #66

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 25, 2026

👋 Thanks for assigning @benthecarman as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@Anyitechs Anyitechs force-pushed the split-rpc-addr branch 2 times, most recently from 354137f to 0f7bc37 Compare February 25, 2026 15:28
Comment on lines -155 to +156
ChainSource::Rpc { rpc_address, rpc_user, rpc_password } => {
builder.set_chain_source_bitcoind_rpc(
rpc_address.ip().to_string(),
rpc_address.port(),
rpc_user,
rpc_password,
);
ChainSource::Rpc { rpc_host, rpc_port, rpc_user, rpc_password } => {
builder.set_chain_source_bitcoind_rpc(rpc_host, rpc_port, rpc_user, rpc_password);
Copy link
Contributor

Choose a reason for hiding this comment

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

Up to you people to make the call, I'd prefer parsing a single <hostname>:<port> string rather than splitting that setting into two parameters. This is what I do in VSS, it optimizes for fewer config params. That setting is logically a single thing right?

Copy link
Contributor Author

@Anyitechs Anyitechs Feb 26, 2026

Choose a reason for hiding this comment

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

That setting is logically a single thing right?

I agree it is. The problem was that we parse this setting using SocketAddr and that has a limitation of only supporting IP addresses. In containerized environments where the IP address might change if the container restarts, the user will have to update this setting each time it restarts. But supporting hostname simplifies things, because you only have to map the setting to a hostname and not worry if/when the IP changes.

An alternative to using SocketAddr (without splitting) is the ToSocketAddrs trait which supports hostname but it's sync and blocking.

UPDATE:

Missed "I'd prefer parsing a single <hostname>:<port>" from the comment earlier. Will drop the split.

Copy link
Contributor

@tankyleo tankyleo left a comment

Choose a reason for hiding this comment

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

Thank you

@ldk-reviews-bot ldk-reviews-bot requested a review from jkczyz March 2, 2026 14:24
@tankyleo tankyleo requested review from benthecarman and tankyleo and removed request for jkczyz and tankyleo March 2, 2026 18:22
@benthecarman benthecarman merged commit 9ff18af into lightningdevkit:main Mar 2, 2026
7 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.

Allow hostname-based RPC communication (remove SocketAddr restriction)

4 participants