Skip to content

Commit

Permalink
Explicitly include custom-messages in manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikDeSmedt committed Apr 10, 2024
1 parent f3b904a commit 32b341b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions libs/cln-lsps/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl RequestId {

// BOLT8 message ID 37913
pub const LSPS_MESSAGE_ID: [u8; 2] = [0x94, 0x19];
pub const LSPS_MESSAGE_ID_U16: u16 = 30971;
pub const TIMEOUT_MILLIS: u128 = 30_000;

/// The LspClient
Expand Down
3 changes: 2 additions & 1 deletion plugins/lsps-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use lsp_primitives::lsps0::common_schemas::{Network, NetworkCheckable, PublicKey
use lsp_primitives::lsps1;
use lsp_primitives::methods;

use cln_lsps::client::{LspClient, RequestId, LSPS_MESSAGE_ID};
use cln_lsps::client::{LspClient, RequestId, LSPS_MESSAGE_ID, LSPS_MESSAGE_ID_U16};
use cln_lsps::cln_rpc_client::ClnRpcLspClient;
use cln_lsps::custom_msg_hook::RpcCustomMsgMessage;
use cln_lsps::transport::RequestResponseMatcher as RRM;
Expand Down Expand Up @@ -55,6 +55,7 @@ async fn main() -> Result<()> {
.rpcmethod_from_builder(crate::plugin_rpc::lsps1_create_order())
.rpcmethod_from_builder(crate::plugin_rpc::lsps1_get_order())
.hook("custommsg", handle_custom_msg)
.custommessages(vec![LSPS_MESSAGE_ID_U16])
.dynamic()
.configure()
.await?
Expand Down
4 changes: 3 additions & 1 deletion plugins/lsps-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use lsp_primitives::lsps0::schema::ListprotocolsResponse;
use lsp_primitives::methods;
use lsp_primitives::methods::JsonRpcMethodEnum;

use cln_lsps::client::LSPS_MESSAGE_ID;
use cln_lsps::client::{LSPS_MESSAGE_ID, LSPS_MESSAGE_ID_U16};
use cln_lsps::custom_msg_hook::RpcCustomMsgMessage;

use serde_json::json;
Expand Down Expand Up @@ -54,6 +54,7 @@ async fn main() -> Result<()> {
.option(options::lsps1_info_website())
.option(options::lsps1_min_required_channel_confirmations())
.option(options::lsps1_min_onchain_payment_confirmations())
.option(options::lsps1_min_funding_confirms_within_blocks())
.option(options::lsps1_supports_zero_channel_reserve())
.option(options::lsps1_max_channel_expiry_blocks())
.option(options::lsps1_min_onchain_payment_size_sat())
Expand All @@ -67,6 +68,7 @@ async fn main() -> Result<()> {
.option(options::lsps1_max_initial_lsp_balance_sat())
.option(options::lsps1_min_channel_balance_sat())
.option(options::lsps1_max_channel_balance_sat())
.custommessages(vec![LSPS_MESSAGE_ID_U16])
.hook("custommsg", handle_custom_msg)
.hook("invoice_payment", handle_paid_invoice)
.featurebits(FeatureBitsKind::Node, String::from(FEATURE_BIT_STRING))
Expand Down

0 comments on commit 32b341b

Please sign in to comment.