Skip to content

Instantly share code, notes, and snippets.

@jeremyd
Created June 17, 2024 18:21
Show Gist options
  • Save jeremyd/6274c83dca409ee548cfc1af518274c7 to your computer and use it in GitHub Desktop.
Save jeremyd/6274c83dca409ee548cfc1af518274c7 to your computer and use it in GitHub Desktop.
gossiptest of NIP17 w/auth

GM ser. I setup a gossip test environment this morning as follows

Scenario#1

Create two new gossip accounts from scratch, using 2 relays: hotrightnow.nostr1.com as inbox+outbox+discover, and auth.nostr1.com as DM. I cannot initially add auth.nostr1.com as it is not in the onboarding. Added afterward with DM only selected and then advertised relay list.

Advertised relay lists multiple times for each account. Confirmed it published them to hotrightnow and that gossip knows this is also a discovery relay. (purplepag.es rugged me, see bug#2)

Attempt to follow account01 from account02 using add-contact flow. Confirmed on contact info page, gossip found the outbox *and the DM relays for this contact.

Gossip now says: Secured with new DM technology. Ready to perform send testing.

(Bug or user-error encountered, I had initially expected only to have to set DM as the relay setting, but gossip will never go read from this relay unless i ALSO set Read+Inbox, so I did that.)

Now I can see gossip authenticating the connection, when I send a DM I see the 1059s going through. I still do not see messages from either account in the other account's DM page, I do not see gossip attempting to download these messages either..

I tried going back and forth multiple times, this includes many gossip restarts etc, still no downloading, only publishing of 1059s? I even turned back on kind1 for auth.nostr1.com to see if this helps, nope.

This concludes the test, neither account can see the NIP17 DMs that were attempted to be sent back and forth. The relay does not show gossip even attempting to query for them, only an auth success and then no further queries.

Additional (side) Bugs:

Bug#1 was encountered during onboarding flow, so I re-initialized my two gossip accounts to make sure this wasn't the cause. When attempting to follow user01 from user02. Gossip panic encountered when attempting follow "thread '' panicked at gossip-lib/src/feed/mod.rs:78:45: called Option::unwrap() on a None value note: run with RUST_BACKTRACE=1 environment variable to display a backtrace"

The above bug actually causes gossip to be unable to set any settings related to relays and must be restarted to continue.


Bug#2 was encountered it seems that purplepag.es did not actually accept or get advertised either 10002 or 10050 kind lists. When I query for them with nak, there is nothing there. Hotrightnow does have them. But as it's not set to discover from hotrightnow, I believe gossip is ignoring this. <insert rant about purplepag.es here being a centralizing broken point).

This is despite gossip thinking they "were" advertised as seen in the logs:

2024-06-17T17:22:24.110463Z  INFO gossip-lib/src/storage/mod.rs:1160: Processing our own relay list
2024-06-17T17:22:24.114996Z  INFO gossip-lib/src/storage/mod.rs:1070: Processing our own dm relay list
2024-06-17T17:22:24.117048Z  INFO gossip-lib/src/overlord/minion/handle_websocket.rs:193: wss://hotrightnow.nostr1.com/: OK=true id=09e29773113280b423ba46fb7d805fb0638ef8fa431b62e31e231e9a50f81ce8
2024-06-17T17:22:25.503931Z  INFO gossip-lib/src/overlord/minion/mod.rs:523: Advertised relay lists to wss://purplepag.es/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment