feat(nip13): Support PoW

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-05-06 11:36:56 +00:00
parent a56acf5752
commit c0a5e47793
2 changed files with 4 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ pub struct CliOptions {
/// Where your relays list. And repository relays if not included in naddr
#[arg(short, long, required = true)]
pub relays: Vec<RelayUrl>,
/// Proof of Work difficulty when creatring events
#[arg(long, default_value_t = 0)]
pub pow: u8,
}
#[derive(Parser, Debug)]

View File

@@ -91,6 +91,7 @@ impl CommandRunner for AnnounceArgs {
maintainers,
self.labels.into_iter().map(utils::str_trim).collect(),
)?
.pow(options.pow)
.build(user_pubk);
let nevent = Nip19Event::new(event.id.expect("There is an id"))
.relays(write_relays.iter().take(3).cloned())