mirror of
https://github.com/daywalker90/cln-nip47.git
synced 2026-08-13 12:33:43 +02:00
add default relays
This commit is contained in:
parent
7241ae39d3
commit
7c100cf5d2
4 changed files with 26 additions and 13 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
- holdinvoice notification: ``hold_invoice_accepted``
|
- holdinvoice notification: ``hold_invoice_accepted``
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- there are now five default relays that will be used if ``nip47-relays`` is not set
|
||||||
- `pay_keysend` will use the new CLN `xkeysend` command using CLN v26.06+
|
- `pay_keysend` will use the new CLN `xkeysend` command using CLN v26.06+
|
||||||
- Budget is updated on demand instead of by a background task
|
- Budget is updated on demand instead of by a background task
|
||||||
- `list_transactions` is bounded (at most 500 transactions and ~128kB response) to prevent DoS
|
- `list_transactions` is bounded (at most 500 transactions and ~128kB response) to prevent DoS
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,12 @@ It is highly recommended to use your own private relay since public relays may l
|
||||||
For a private relay you can for example use [nostr-rs-relay](https://github.com/scsibug/nostr-rs-relay) with ``pubkey_whitelist`` set to both ``clientkey_public`` and ``walletkey_public`` (returned from ``nip47-create``/``nip47-list``).
|
For a private relay you can for example use [nostr-rs-relay](https://github.com/scsibug/nostr-rs-relay) with ``pubkey_whitelist`` set to both ``clientkey_public`` and ``walletkey_public`` (returned from ``nip47-create``/``nip47-list``).
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
* ``nip47-relays``: Specify the relays that you want to use with your NWC. Can be set multiple times to use multiple relays. NWC's you create will save these and even if you add or remove relays keep the relays from the moment you created that NWC. You must set this atleast one time.
|
* ``nip47-relays``: Specify the relays that you want to use with your NWC. Can be set multiple times to use multiple relays. NWC's you create will save these and even if you add or remove relays keep the relays from the moment you created that NWC. If you don't set this yourself these default relays will be used:
|
||||||
|
* ``wss://nos.lol``
|
||||||
|
* ``wss://relay.primal.net``
|
||||||
|
* ``wss://relay.getalby.com/v1``
|
||||||
|
* ``wss://relay.nostr.net``
|
||||||
|
* ``wss://relay.snort.social``
|
||||||
* ``nip47-notifications``: Enable/disable nip47 notifications. Default is enabled (``true``)
|
* ``nip47-notifications``: Enable/disable nip47 notifications. Default is enabled (``true``)
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,12 @@ async fn nwc_request_handler(
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
for success in send_result.success {
|
||||||
|
log::trace!("Sent to {}", success.0);
|
||||||
|
}
|
||||||
|
for failure in send_result.failed {
|
||||||
|
log::trace!("Failed to send to {}: {}", failure.0, failure.1);
|
||||||
|
}
|
||||||
log::trace!("SENT RESPONSE {response_event:?}");
|
log::trace!("SENT RESPONSE {response_event:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
25
src/parse.rs
25
src/parse.rs
|
|
@ -16,19 +16,20 @@ pub async fn read_startup_options(
|
||||||
plugin: &ConfiguredPlugin<PluginState, tokio::io::Stdin, tokio::io::Stdout>,
|
plugin: &ConfiguredPlugin<PluginState, tokio::io::Stdin, tokio::io::Stdout>,
|
||||||
state: &PluginState,
|
state: &PluginState,
|
||||||
) -> Result<(), anyhow::Error> {
|
) -> Result<(), anyhow::Error> {
|
||||||
let relays_str = if let Some(relays) = plugin.option(&OPT_RELAYS).unwrap() {
|
let relays_str = if plugin
|
||||||
if relays.is_empty() {
|
.option(&OPT_RELAYS)
|
||||||
return Err(anyhow!(
|
.unwrap()
|
||||||
"Empty `{}` option, must specify atleast one relay url!",
|
.is_none_or(|v| v.is_empty())
|
||||||
OPT_RELAYS.name()
|
{
|
||||||
));
|
vec![
|
||||||
}
|
"wss://nos.lol".to_owned(),
|
||||||
relays
|
"wss://relay.primal.net".to_owned(),
|
||||||
|
"wss://relay.getalby.com/v1".to_owned(),
|
||||||
|
"wss://relay.nostr.net".to_owned(),
|
||||||
|
"wss://relay.snort.social".to_owned(),
|
||||||
|
]
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow!(
|
plugin.option(&OPT_RELAYS).unwrap().unwrap()
|
||||||
"`{}` not set, must specify atleast one relay url!",
|
|
||||||
OPT_RELAYS.name()
|
|
||||||
));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut rpc = ClnRpc::new(
|
let mut rpc = ClnRpc::new(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue