Skip to content

Instantly share code, notes, and snippets.

@ryogrid
Last active June 9, 2024 01:35
Show Gist options
  • Save ryogrid/5080ff36b6786902d40bb4b91de0766e to your computer and use it in GitHub Desktop.
Save ryogrid/5080ff36b6786902d40bb4b91de0766e to your computer and use it in GitHub Desktop.
About trial procedure of NostrP2P

Trying to enable (some) Nostr clients to connect to the NostrP2P server

  • The I/F for NostrP2P clients is REST, but it is necessary to insert a WS <-> REST bridge server for Nostr called Yonle/nhttp-adapter So, I tried to make it behave in a way that is compatible to some extent
    • Some modifications were required to the NostrP2P server to achieve this...
    • The specifications of nhttp -adapter were not compatible with NostrP2P's REST I/F, so I made some modifications ryogrid/nhttp-adapter

How to try

  • Client to use

    • For now, I will use Snort because it seems to handle the display of posts and profile information well even if I respond to REQ in a careless manner
  • procedure

    • (1) Access the Snort site above
    • (2) Log in with the demo private key you used earlier
      • nsec1lga8gzqcydyydhveeky4dknqeeq0k5wkrk3qzxsvlfm8ar5t9v7qy5c7vl
    • (3) Go to relay server settings from the settings screen, delete everything that was originally set, and add the following address as a relay server.
      • wss://np2p-ws-bridge.onrender.com
    • (4) Go to the global timeline display screen and reload the site, or click the "Load more" button
    • (5) You should see a display like the one below...
    • .
    • If that doesn't work, maybe deleting all saved data from "Storage" in the web developer tools might help?
    • It might work better if you change the client to noStrudel
  • note

    • Same as in the previous article, the demo NostrP2P server is designed to block WRITE requests, so you cannot post or update your profile with the demo account
    • It seems that some clients are accessing unspecified relay servers , so if you want to confirm that the data is definitely coming from the NostrP2P server, use Firefox (on your PC) and check the Request Blocker You can definitely block the following relays by installing the extension:
      • *://purplepag.es/
      • *:// relay.stemstr.app /
      • *://relay.damus.io/
      • *:// relay.snort.social /
      • *:// nostr.wine /
      • *:// nos.lol /
      • *:// relay.nostr.band /
    • Check the WS communication from the "network" section of Firefox's web development tool to be more sure

What being done this time

  • A while ago, I wrote a separate article about Demo Story, and I used nhttp -adapter to install WS<-> on the demo environment server for it. I just use a REST bridge to connect
    • https://ryogrid.net:8889
    • So wss://np2p-ws-bridge.onrender.com has an nhttp -adapter deployed, which is making REST requests to https://ryogrid.net:8889
    • (The reason why I went to the trouble of using a separate server is because of TLS issues, and it was just easier than putting it on the ryogrid.net server machine.)

Binaries and Etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment