Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Conversation

@benthecarman
Copy link
Collaborator

@benthecarman benthecarman commented May 3, 2023

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

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 }
Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Collaborator Author

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

Copy link
Contributor

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

Copy link
Collaborator Author

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.

@AnthonyRonning
Copy link
Contributor

Let's go without this

@benthecarman benthecarman deleted the nostr-broadcast branch February 5, 2024 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants