Skip to content

Commit

Permalink
Merge pull request #2059 from get10101/replace-tcp-with-ws
Browse files Browse the repository at this point in the history
Replace TCP with WebSockets (when feature gate enabled)
  • Loading branch information
luckysori authored Feb 27, 2024
2 parents 8d9411f + 1528483 commit d1f4a89
Show file tree
Hide file tree
Showing 22 changed files with 1,232 additions and 74 deletions.
122 changes: 85 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dlc-trie = { git = "https://github.com/get10101/rust-dlc", rev = "0191dc4" }
lightning = { git = "https://github.com/bonomat/rust-lightning-p2p-derivatives", rev = "e49030e" }
lightning-background-processor = { git = "https://github.com/bonomat/rust-lightning-p2p-derivatives", rev = "e49030e" }
lightning-transaction-sync = { git = "https://github.com/bonomat/rust-lightning-p2p-derivatives", rev = "e49030e" }
lightning-net-tokio = { git = "https://github.com/bonomat/rust-lightning-p2p-derivatives", rev = "e49030e" }
lightning-persister = { git = "https://github.com/bonomat/rust-lightning-p2p-derivatives", rev = "e49030e" }
lightning-rapid-gossip-sync = { git = "https://github.com/bonomat/rust-lightning-p2p-derivatives", rev = "e49030e" }

Expand Down
1 change: 1 addition & 0 deletions coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ version = "0.25"

[dependencies.ln-dlc-node]
path = "../crates/ln-dlc-node"
features = ["ln_net_axum_ws"]

[dependencies.openssl]
version = "0.10.60"
Expand Down
1 change: 1 addition & 0 deletions coordinator/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ pub async fn open_channel(
let peer = NodeInfo {
pubkey,
address: target_address,
is_ws: false,
};
state.node.inner.connect(peer).await.map_err(|e| {
AppError::InternalServerError(format!("Could not connect to target node {e:#}"))
Expand Down
2 changes: 1 addition & 1 deletion coordinator/src/bin/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async fn main() -> Result<()> {
tracing::debug!("Listening on http://{}", http_address);

match axum::Server::bind(&http_address)
.serve(app.into_make_service())
.serve(app.into_make_service_with_connect_info::<SocketAddr>())
.await
{
Ok(_) => {
Expand Down
1 change: 1 addition & 0 deletions coordinator/src/node/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn reconnect_to_disconnected_public_channel_peers(
let node_info = NodeInfo {
pubkey: peer,
address,
is_ws: false,
};

match node.connect(node_info).await {
Expand Down
Loading

0 comments on commit d1f4a89

Please sign in to comment.