nostr:npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet is it possible to use the underlying http client of nostr-relay-pool to make regular http requests or do I have to include a new dependency to some http lib for this?
No, for HTTP requests I'm using reqwest
It's now available a pre-release of the nostr-sdk library for Kotlin JVM (linux, macos and windows)!
```kotlin
implementation("org.rust-nostr:nostr-sdk-jvm:0.39.0-alpha.1")
```
https://central.sonatype.com/artifact/org.rust-nostr/nostr-sdk-jvm
Does anyone know if it's possible to cross-compile rust from Linux to iOS targets?
#rustlang #ios #asknostr
nostr:npub1acg6thl5psv62405rljzkj8spesceyfz2c32udakc2ak0dmvfeyse9p35c, I'm trying with this example:
```toml
[dependencies]
nostr-sdk = { version = "0.38", features = ["lmdb"] }
tokio = { version = "1.42", features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
```
```rust
use nostr_sdk::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
let keys = Keys::parse("nsec1ufnus6pju578ste3v90xd5m2decpuzpql2295m3sknqcjzyys9ls0qlc85")?;
let database = NostrLMDB::open("./db/nostr-lmdb")?;
let client: Client = ClientBuilder::default()
.signer(keys.clone())
.database(database)
.build();
client.add_relay("wss://chorus.mikedilger.com:444").await?;
client.connect().await;
let since = Timestamp::from_secs(1736726400);
let until = Timestamp::from_secs(1737331200);
let filter = Filter::new().kind(Kind::TextNote).since(since).until(until); // Sync the text notes of the last week
// Negentropy options
let (tx, mut rx) = SyncProgress::channel();
let opts = SyncOptions::default().progress(tx);
// Keep track of the progress
tokio::spawn(async move {
while rx.changed().await.is_ok() {
let progress = *rx.borrow_and_update();
if progress.total > 0 {
println!("{:.2}%", progress.percentage() * 100.0);
}
}
});
// Sync
let output = client.sync(filter, &opts).await?;
// Sync output
println!("Local: {}", output.local.len());
println!("Remote: {}", output.remote.len());
println!("Sent: {}", output.sent.len());
println!("Received: {}", output.received.len());
println!("Failures:");
for (url, map) in output.send_failures.iter() {
println!("* '{url}':");
for (id, e) in map.iter() {
println!(" - {id}: {e}");
}
}
Ok(())
}
```
I receive an error when I try to connect: "peer closed connection without sending TLS close_notify"
The steps looks good. I'll test it soon. Is the new code with negentropy already public?
Unlike the REQs, the negentropy messages can take only one filter, so it may be useful in some case to allow multiple sync at the same time. But it's also true that sync can be executed in sequence, like I'm doing with `Relay::sync_multi`: https://github.com/rust-nostr/nostr/blob/e4dbf484a8d1e57a05f0cc0312dd52c6c43cddd5/crates/nostr-relay-pool/src/relay/inner.rs#L1776
Here I use the `sync_multi`: https://github.com/rust-nostr/nostr/blob/e4dbf484a8d1e57a05f0cc0312dd52c6c43cddd5/crates/nostr-sdk/src/client/mod.rs#L1850
Would be nice to have negentropy support in chorus.
If it helps, here's how I implemented it for nostr-relay-builder: https://github.com/rust-nostr/nostr/blob/25a76ff3d90ea4307dd1078ccc2b910619571971/crates/nostr-relay-builder/src/local/inner.rs#L614
I'm adding support for transactional queries to the nostr-database traits 👀
This will allow to have **almost** the same performance as using nostrdb directly, even when used from the nostr-sdk.

In the book, for now only the "hello, rust-nostr" example is available. But if you are already familiar with the python bindings, the APIs are the same.
For now only keys parsing/generation/serialization, event de/serialization, event building and the client with some methods (add relays, connect and send event) are available. I'll add event fetching and subscriptions soon
## rust-nostr v0.38 is out! 🦀
### Summary
Full NIP42 support for SDK and relay builder, negentropy support and read/write policy plugins for relay builder, NIP35 support, better logs and docs, performance improvements, bugs fix and more!
The Flutter bindings are finally fixed and usable (not for web yet), although rather incomplete compared to other languages.
Full changelog: https://rust-nostr.org/changelog
### Contributors
Thanks to all contributors for this relays!
* nostr:npub1xj5hzn62q2jg8xp9m3j6lw7r8z6g47plqyz2jmjr3g52y8tx4rls095s8g
* nostr:npub1useke4f9maul5nf67dj0m9sq6jcsmnjzzk4ycvldwl4qss35fvgqjdk5ks
* ethicnology
* nostr:npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc
* nostr:npub1v0lxxxxutpvrelsksy8cdhgfux9l6a42hsj2qzquu2zk7vc9qnkszrqj49
* nostr:npub1ahaz04ya9tehace3uy39hdhdryfvdkve9qdndkqp3tvehs6h8s5slq45hy
A big thank you also to those who contributed throughout 2024 (in addition to the above-listed):
* nostr:npub1k95p0e36xx62mwjltdlsrrjunnqx464wlf969f9u3stvrq5dah4qgds3z7
* nostr:npub1f5uuywemqwlejj2d7he6zjw8jz9wr0r5z6q8lhttxj333ph24cjsymjmug
* nostr:npub1u8lnhlw5usp3t9vmpz60ejpyt649z33hu82wc2hpv6m5xdqmuxhs46turz
* nostr:npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr
* nostr:npub138he9w0tumwpun4rnrmywlez06259938kz3nmjymvs8px7e9d0js8lrdr2
* nostr:npub1lu2qcwt23uq5pku99pxfe3uudpzdl4cfks24c2758cqqnfehujlqn6xlm6
* nostr:npub163jct20kzgjjr6z28u4vskax7d0gwq3zemrk6flgnw430vu55vtsdeqdc2
* nanikamado
* nostr:npub1zwnx29tj2lnem8wvjcx7avm8l4unswlz6zatk0vxzeu62uqagcash7fhrf
* nostr:npub1zfss807aer0j26mwp2la0ume0jqde3823rmu97ra6sgyyg956e0s6xw445
* nostr:npub1w80jzxf36fhwgyfp622m6s7tcl3cy5z7xva4cy75q9kwm92zm8tsclzqjv
* nostr:npub1zk6u7mxlflguqteghn8q7xtu47hyerruv6379c36l8lxzzr4x90q0gl6ef
* nostr:npub1mheh5x5uhplms73kl73hwtg4gf57qxq89fvkwc2ykj8y966l05cqh9qtf9
* nostr:npub17q5n2z8naw0xl6vu9lvt560lg33pdpe29k0k09umlfxm3vc4tqrq466f2y
* nostr:npub1acxjpdrlk2vw320dxcy3prl87g5kh4c73wp0knullrmp7c4mc7nq88gj3j
* nostr:npub1q0uulk2ga9dwkp8hsquzx38hc88uqggdntelgqrtkm29r3ass6fq8y9py9
Thank you very much also to all the donors! Special thanks to nostr:npub10pensatlcfwktnvjjw2dtem38n6rvw8g6fv73h84cuacxn4c28eqyfn34f for the LTS grant, to nostr:npub1ktt8phjnkfmfrsxrgqpztdjuxk3x6psf80xyray0l3c7pyrln49qhkyhz0 for subscribing and being a recurring donor and to nostr:npub16p8v7varqwjes5hak6q7mz6pygqm4pwc6gve4mrned3xs8tz42gq7kfhdw to be the top-donor of 2024.
### Links
#rustnostr #nostr #rustlang #programming #rust #python #javascript #kotlin #swift #flutter
Missed to mention nostr:nprofile1qqsqqqe6jda9u2w0ax4tfrf3rgcxz43umq6ga0r79j5uchpnwazxtegpp4mhxue69uhkummn9ekx7mqpr4mhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet5qyw8wumn8ghj7mn0wd68yttjv4kxz7fwwak8vuewwdcxzcm9mkwz3u as code contributor. Thank you!
## rust-nostr v0.38 is out! 🦀
### Summary
Full NIP42 support for SDK and relay builder, negentropy support and read/write policy plugins for relay builder, NIP35 support, better logs and docs, performance improvements, bugs fix and more!
The Flutter bindings are finally fixed and usable (not for web yet), although rather incomplete compared to other languages.
Full changelog: https://rust-nostr.org/changelog
### Contributors
Thanks to all contributors for this relays!
* nostr:npub1xj5hzn62q2jg8xp9m3j6lw7r8z6g47plqyz2jmjr3g52y8tx4rls095s8g
* nostr:npub1useke4f9maul5nf67dj0m9sq6jcsmnjzzk4ycvldwl4qss35fvgqjdk5ks
* ethicnology
* nostr:npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc
* nostr:npub1v0lxxxxutpvrelsksy8cdhgfux9l6a42hsj2qzquu2zk7vc9qnkszrqj49
* nostr:npub1ahaz04ya9tehace3uy39hdhdryfvdkve9qdndkqp3tvehs6h8s5slq45hy
A big thank you also to those who contributed throughout 2024 (in addition to the above-listed):
* nostr:npub1k95p0e36xx62mwjltdlsrrjunnqx464wlf969f9u3stvrq5dah4qgds3z7
* nostr:npub1f5uuywemqwlejj2d7he6zjw8jz9wr0r5z6q8lhttxj333ph24cjsymjmug
* nostr:npub1u8lnhlw5usp3t9vmpz60ejpyt649z33hu82wc2hpv6m5xdqmuxhs46turz
* nostr:npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr
* nostr:npub138he9w0tumwpun4rnrmywlez06259938kz3nmjymvs8px7e9d0js8lrdr2
* nostr:npub1lu2qcwt23uq5pku99pxfe3uudpzdl4cfks24c2758cqqnfehujlqn6xlm6
* nostr:npub163jct20kzgjjr6z28u4vskax7d0gwq3zemrk6flgnw430vu55vtsdeqdc2
* nanikamado
* nostr:npub1zwnx29tj2lnem8wvjcx7avm8l4unswlz6zatk0vxzeu62uqagcash7fhrf
* nostr:npub1zfss807aer0j26mwp2la0ume0jqde3823rmu97ra6sgyyg956e0s6xw445
* nostr:npub1w80jzxf36fhwgyfp622m6s7tcl3cy5z7xva4cy75q9kwm92zm8tsclzqjv
* nostr:npub1zk6u7mxlflguqteghn8q7xtu47hyerruv6379c36l8lxzzr4x90q0gl6ef
* nostr:npub1mheh5x5uhplms73kl73hwtg4gf57qxq89fvkwc2ykj8y966l05cqh9qtf9
* nostr:npub17q5n2z8naw0xl6vu9lvt560lg33pdpe29k0k09umlfxm3vc4tqrq466f2y
* nostr:npub1acxjpdrlk2vw320dxcy3prl87g5kh4c73wp0knullrmp7c4mc7nq88gj3j
* nostr:npub1q0uulk2ga9dwkp8hsquzx38hc88uqggdntelgqrtkm29r3ass6fq8y9py9
Thank you very much also to all the donors! Special thanks to nostr:npub10pensatlcfwktnvjjw2dtem38n6rvw8g6fv73h84cuacxn4c28eqyfn34f for the LTS grant, to nostr:npub1ktt8phjnkfmfrsxrgqpztdjuxk3x6psf80xyray0l3c7pyrln49qhkyhz0 for subscribing and being a recurring donor and to nostr:npub16p8v7varqwjes5hak6q7mz6pygqm4pwc6gve4mrned3xs8tz42gq7kfhdw to be the top-donor of 2024.
### Links
#rustnostr #nostr #rustlang #programming #rust #python #javascript #kotlin #swift #flutter
Ah, just tried, I receive an invalid invoice.
nostr:nprofile1qqsx3kq3vkgczq9hmfplc28h687py42yvms3zkyxh8nmkvn0vhkyyuspz4mhxue69uhkummnw3ezummcw3ezuer9wchsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qy88wumn8ghj7mn0wvhxcmmv9u0uehfp can you fix your LN address so I can zap you ?
Are you trying to pay@yukikishimoto.com? What error do you receive?
There is a method on the database that allow to check where an event ID was seen:
```rust
let database = client.database();
let relays = database.event_seen_on_relays(id).await?;
```
This works with the in-memory database (which is used by default) and with some persistent database but not with all implementations (like with nostrdb).
Another good solution is to use the `RelayPoolNotification`, like suggested by nostr:nprofile1qqswgvmv65ja7706f5a0xe8ajcqdfvgdeeppt2jvx0kh06sggg6ykyqppemhxue69uhkummn9ekx7mp0qys8wumn8ghj7mn0wd68ytn9d9h82mny0fmkzmn6d9njuumsv93k2tcpr4mhxue69uhkummnw3ezucnfw33k76twv4ezuum0vd5kzmp0v9ru2a
You have to enable it in the `Cargo.toml`:
```toml
nostr-sdk = { version = "0.37", features = ["nip59"] }
```
You can find all features here: https://github.com/rust-nostr/nostr/blob/master/crates%2Fnostr-sdk%2FREADME.md#crate-feature-flags