Skip to content

Commit

Permalink
Merge pull request #25 from G8XSU/crates-rename
Browse files Browse the repository at this point in the history
Rename crates to have ldk-server- prefix.
  • Loading branch information
G8XSU authored Nov 25, 2024
2 parents a5178ec + 49a4450 commit 4e61a58
Show file tree
Hide file tree
Showing 39 changed files with 94 additions and 86 deletions.
58 changes: 29 additions & 29 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = [ "cli", "client", "protos", "server"]
members = [ "ldk-server-cli", "ldk-server-client", "ldk-server-protos", "ldk-server"]

[profile.release]
panic = "abort"
Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.toml → ldk-server-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "cli"
name = "ldk-server-cli"
version = "0.1.0"
edition = "2021"

[dependencies]
client = { path = "../client" }
ldk-server-client = { path = "../ldk-server-client" }
clap = { version = "4.0.5", default-features = false, features = ["derive", "std", "error-context", "suggestions", "help"] }
tokio = { version = "1.38.0", default-features = false, features = ["rt-multi-thread", "macros"] }
prost = { version = "0.11.6", default-features = false}
6 changes: 3 additions & 3 deletions cli/src/main.rs → ldk-server-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::{Parser, Subcommand};
use client::client::LdkServerClient;
use client::error::LdkServerError;
use client::protos::api::{
use ldk_server_client::client::LdkServerClient;
use ldk_server_client::error::LdkServerError;
use ldk_server_client::ldk_server_protos::api::{
Bolt11ReceiveRequest, Bolt11SendRequest, Bolt12ReceiveRequest, Bolt12SendRequest,
OnchainReceiveRequest, OnchainSendRequest, OpenChannelRequest,
};
Expand Down
4 changes: 2 additions & 2 deletions client/Cargo.toml → ldk-server-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "client"
name = "ldk-server-client"
version = "0.1.0"
edition = "2021"

[dependencies]
protos = { path = "../protos" }
ldk-server-protos = { path = "../ldk-server-protos" }
reqwest = { version = "0.11.13", default-features = false, features = ["rustls-tls"] }
tokio = { version = "1.38.0", default-features = false }
prost = { version = "0.11.6", default-features = false, features = ["std", "prost-derive"] }
4 changes: 2 additions & 2 deletions client/src/client.rs → ldk-server-client/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use prost::Message;

use crate::error::LdkServerError;
use protos::api::{
use ldk_server_protos::api::{
Bolt11ReceiveRequest, Bolt11ReceiveResponse, Bolt11SendRequest, Bolt11SendResponse,
Bolt12ReceiveRequest, Bolt12ReceiveResponse, Bolt12SendRequest, Bolt12SendResponse,
CloseChannelRequest, CloseChannelResponse, ListChannelsRequest, ListChannelsResponse,
Expand Down Expand Up @@ -31,7 +31,7 @@ pub struct LdkServerClient {
}

impl LdkServerClient {
/// Constructs a [`LdkServerClient`] using `base_url` as the server endpoint.
/// Constructs a [`LdkServerClient`] using `base_url` as the ldk-server endpoint.
pub fn new(base_url: String) -> Self {
Self { base_url, client: Client::new() }
}
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions client/src/lib.rs → ldk-server-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#![deny(rustdoc::private_intra_doc_links)]
#![deny(missing_docs)]

/// Implements a client ([`client::LdkServerClient`]) to access a hosted instance of LDK Server.
/// Implements a ldk-ldk-server-client ([`client::LdkServerClient`]) to access a hosted instance of LDK Server.
pub mod client;

/// Implements the error type ([`error::LdkServerError`]) returned on interacting with [`client::LdkServerClient`]
pub mod error;

/// Request/Response structs required for interacting with the client.
pub use protos;
/// Request/Response structs required for interacting with the ldk-ldk-server-client.
pub use ldk_server_protos;
2 changes: 1 addition & 1 deletion protos/Cargo.toml → ldk-server-protos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "protos"
name = "ldk-server-protos"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions protos/src/error.rs → ldk-server-protos/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct ErrorResponse {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorCode {
/// Will neve be used as `error_code` by server.
/// Will neve be used as `error_code` by ldk-server.
///
/// **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to
/// `UnknownError`.
Expand All @@ -35,7 +35,7 @@ pub enum ErrorCode {
AuthError = 2,
/// Used to represent an error while doing a Lightning operation.
LightningError = 3,
/// Used when an internal server error occurred. The client is probably at no fault.
/// Used when an internal ldk-server error occurred. The ldk-ldk-server-client is probably at no fault.
InternalServerError = 4,
}
impl ErrorCode {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/Cargo.toml → ldk-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ http-body-util = { version = "0.1", default-features = false }
hyper-util = { version = "0.1", default-features = false, features = ["server-graceful"] }
tokio = { version = "1.38.0", default-features = false, features = ["time", "signal", "rt-multi-thread"] }
prost = { version = "0.11.6", default-features = false, features = ["std"] }
protos = { path = "../protos" }
ldk-server-protos = { path = "../ldk-server-protos" }
bytes = "1.4.0"
hex = { package = "hex-conservative", version = "0.2.1", default-features = false }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ldk_node::Node;
use protos::api::{Bolt11ReceiveRequest, Bolt11ReceiveResponse};
use ldk_server_protos::api::{Bolt11ReceiveRequest, Bolt11ReceiveResponse};
use std::sync::Arc;

pub(crate) const BOLT11_RECEIVE_PATH: &str = "Bolt11Receive";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::Bytes;
use ldk_node::lightning_invoice::Bolt11Invoice;
use ldk_node::Node;
use protos::api::{Bolt11SendRequest, Bolt11SendResponse};
use ldk_server_protos::api::{Bolt11SendRequest, Bolt11SendResponse};
use std::str::FromStr;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ldk_node::Node;
use protos::api::{Bolt12ReceiveRequest, Bolt12ReceiveResponse};
use ldk_server_protos::api::{Bolt12ReceiveRequest, Bolt12ReceiveResponse};
use std::sync::Arc;

pub(crate) const BOLT12_RECEIVE_PATH: &str = "Bolt12Receive";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::Bytes;
use ldk_node::lightning::offers::offer::Offer;
use ldk_node::Node;
use protos::api::{Bolt12SendRequest, Bolt12SendResponse};
use ldk_server_protos::api::{Bolt12SendRequest, Bolt12SendResponse};
use std::str::FromStr;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ldk_node::bitcoin::secp256k1::PublicKey;
use ldk_node::{Node, UserChannelId};
use protos::api::{CloseChannelRequest, CloseChannelResponse};
use ldk_server_protos::api::{CloseChannelRequest, CloseChannelResponse};
use std::str::FromStr;
use std::sync::Arc;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ldk_node::Node;
use protos::api::{GetNodeInfoRequest, GetNodeInfoResponse};
use protos::types::BestBlock;
use ldk_server_protos::api::{GetNodeInfoRequest, GetNodeInfoResponse};
use ldk_server_protos::types::BestBlock;
use std::sync::Arc;

pub(crate) const GET_NODE_INFO: &str = "GetNodeInfo";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::util::proto_adapter::payment_to_proto;
use hex::FromHex;
use ldk_node::lightning::ln::channelmanager::PaymentId;
use ldk_node::Node;
use protos::api::{GetPaymentDetailsRequest, GetPaymentDetailsResponse};
use ldk_server_protos::api::{GetPaymentDetailsRequest, GetPaymentDetailsResponse};
use std::sync::Arc;

pub(crate) const GET_PAYMENT_DETAILS_PATH: &str = "GetPaymentDetails";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::util::proto_adapter::channel_to_proto;
use ldk_node::Node;
use protos::api::{ListChannelsRequest, ListChannelsResponse};
use ldk_server_protos::api::{ListChannelsRequest, ListChannelsResponse};
use std::sync::Arc;

pub(crate) const LIST_CHANNELS_PATH: &str = "ListChannels";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::util::proto_adapter::payment_to_proto;
use ldk_node::Node;
use protos::api::{ListPaymentsRequest, ListPaymentsResponse};
use ldk_server_protos::api::{ListPaymentsRequest, ListPaymentsResponse};
use std::sync::Arc;

pub(crate) const LIST_PAYMENTS_PATH: &str = "ListPayments";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ldk_node::Node;
use protos::api::{OnchainReceiveRequest, OnchainReceiveResponse};
use ldk_server_protos::api::{OnchainReceiveRequest, OnchainReceiveResponse};
use std::sync::Arc;

pub(crate) const ONCHAIN_RECEIVE_PATH: &str = "OnchainReceive";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ldk_node::bitcoin::Address;
use ldk_node::Node;
use protos::api::{OnchainSendRequest, OnchainSendResponse};
use ldk_server_protos::api::{OnchainSendRequest, OnchainSendResponse};
use std::str::FromStr;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bytes::Bytes;
use ldk_node::bitcoin::secp256k1::PublicKey;
use ldk_node::lightning::ln::msgs::SocketAddress;
use ldk_node::Node;
use protos::api::{OpenChannelRequest, OpenChannelResponse};
use ldk_server_protos::api::{OpenChannelRequest, OpenChannelResponse};
use std::str::FromStr;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use ldk_node::bitcoin::secp256k1::PublicKey;
use ldk_node::config::{ChannelConfig, MaxDustHTLCExposure};
use ldk_node::{Node, UserChannelId};
use protos::api::{UpdateChannelConfigRequest, UpdateChannelConfigResponse};
use protos::types::channel_config::MaxDustHtlcExposure;
use ldk_server_protos::api::{UpdateChannelConfigRequest, UpdateChannelConfigResponse};
use ldk_server_protos::types::channel_config::MaxDustHtlcExposure;
use std::str::FromStr;
use std::sync::Arc;

Expand Down Expand Up @@ -38,7 +38,7 @@ pub(crate) fn handle_update_channel_config_request(
}

fn build_updated_channel_config(
current_config: ChannelConfig, proto_channel_config: protos::types::ChannelConfig,
current_config: ChannelConfig, proto_channel_config: ldk_server_protos::types::ChannelConfig,
) -> ChannelConfig {
let max_dust_htlc_exposure = proto_channel_config
.max_dust_htlc_exposure
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 4e61a58

Please sign in to comment.