-
Notifications
You must be signed in to change notification settings - Fork 38
Broadcast tx over nostr #459
Conversation
3625418 to
c3d4e87
Compare
c3d4e87 to
1f6a594
Compare
| ln-websocket-proxy = "0.3.0" | ||
| lnurl-rs = { version = "0.2.2", default-features = false, features = ["async", "async-https"] } | ||
|
|
||
| nostr-sdk = { version = "0.21.0", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses tokio, are you sure it's browser safe? Might be wasm safe but idk about tokio::sync https://github.com/rust-nostr/nostr/blob/master/crates/nostr-sdk/Cargo.toml#L41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and was able to broadcast a transaction, will look into where tokio is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it is used for channels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think tokio channels were wasm safe. I've just been going with futures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing I'm seeing online convinces me that it's truly wasm safe. From documentation, I see that even tokio::sync::mpsc will block if there's multiple sends that it needs to do. https://github.com/tokio-rs/tokio/blob/c89406965ffb4a64936d781c556a2c48855dfbdb/tokio/src/sync/mpsc/bounded.rs#L448-L451
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay will convert to draft and we can make PRs into rust-nostr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also be wrong, it's just so hard to tell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just implement our own client. All we need is a websocket, won't be very hard.
|
Let's go without this |
Implements nostr-protocol/nips#476
For now we still broadcast to esplora as well because I am pretty sure I am the only one running a server.
Need to make the nostr-sdk more wasm safe