add default relays

This commit is contained in:
daywalker90 2026-08-09 20:07:11 +02:00
parent 3716ba5aa1
commit 3ef1323d31
No known key found for this signature in database
GPG key ID: 7AB4802ED5A639F3
4 changed files with 26 additions and 13 deletions

View file

@ -7,6 +7,7 @@
- holdinvoice notification: ``hold_invoice_accepted``
### 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+
- 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

View file

@ -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``).
## 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``)
## Methods

View file

@ -332,6 +332,12 @@ async fn nwc_request_handler(
);
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:?}");
}

View file

@ -16,19 +16,20 @@ pub async fn read_startup_options(
plugin: &ConfiguredPlugin<PluginState, tokio::io::Stdin, tokio::io::Stdout>,
state: &PluginState,
) -> Result<(), anyhow::Error> {
let relays_str = if let Some(relays) = plugin.option(&OPT_RELAYS).unwrap() {
if relays.is_empty() {
return Err(anyhow!(
"Empty `{}` option, must specify atleast one relay url!",
OPT_RELAYS.name()
));
}
relays
let relays_str = if plugin
.option(&OPT_RELAYS)
.unwrap()
.is_none_or(|v| v.is_empty())
{
vec![
"wss://nos.lol".to_owned(),
"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 {
return Err(anyhow!(
"`{}` not set, must specify atleast one relay url!",
OPT_RELAYS.name()
));
plugin.option(&OPT_RELAYS).unwrap().unwrap()
};
let mut rpc = ClnRpc::new(