mirror of
https://github.com/Start9Labs/documentation.git
synced 2026-03-26 10:21:53 +00:00
Merge pull request #639 from Start9Labs/update/nostr
Updated Nostr docs - break out of client and relay so that both/eithe…
This commit is contained in:
@@ -4,48 +4,22 @@
|
|||||||
Nostr
|
Nostr
|
||||||
=====
|
=====
|
||||||
|
|
||||||
Nostr is a simple, open protocol that enables global, decentralized, and censorship-resistant social media.
|
Nostr is a simple, open protocol that enables global, decentralized, and censorship-resistant social media. Clients allow you to browse and send Notes (and "*Other Stuff*") that have been transmitted to Relays. Relays collect and store Notes, where clients then download them. Secure personal profiles are created by using public/private key pairs.
|
||||||
|
|
||||||
.. note::
|
You can run both a Client and a Relay on StartOS.
|
||||||
|
|
||||||
It is highly recommended that you run a private relay, not a public one. Private will be the default option when you open the config for the first time. You will not be able to save the config until you follow the instructions below.
|
Client
|
||||||
|
------
|
||||||
**Initial Config**
|
|
||||||
|
|
||||||
#. Install **Nostr RS relay** service from Start9 Registry on your server.
|
|
||||||
|
|
||||||
.. figure:: /_static/images/services/nostr/nostr-1.png
|
|
||||||
:width: 50%
|
|
||||||
:alt: nostr install
|
|
||||||
|
|
||||||
#. In the service, page click **CONFIGURE** and add the pubkey in hex format to whitelist your client. Click save.
|
|
||||||
|
|
||||||
.. figure:: /_static/images/services/nostr/nostr-2.png
|
|
||||||
:width: 50%
|
|
||||||
:alt: nostr whitelist pubkey
|
|
||||||
|
|
||||||
#. Now you will have a Nostr relay websocket URL available in Nostr Properties.
|
|
||||||
|
|
||||||
|
|
||||||
**Running a private relay**
|
|
||||||
|
|
||||||
Private relays serve as a personal backup for your posts, follows, messages, settings, and more. Without a private relay, there is no assurance that this data will be preserved, and there is a risk of it disappearing unexpectedly. By utilizing a private relay, only the pubkeys on the whitelist are authorized to post and save content to your relay. To ensure functionality, it is essential to whitelist your own pubkey in hex format. The configuration settings will not permit saving until at least one pubkey is added to the whitelist. Some Nostr clients may offer the option to copy your hex pubkey, but if not, you can visit https://damus.io/key to convert your npub to hex.
|
|
||||||
|
|
||||||
**Running a public relay**
|
|
||||||
|
|
||||||
In contrast to a private relay, a public relay lacks a whitelist, permitting any pubkey to post. Running a public relay is not recommended unless you comprehend the associated risks and configure it with appropriate safeguards. The primary risk to be mindful of is the potential for malicious clients to spam your relay, leading to the saturation of your storage drive. While we have implemented fairly restrictive defaults in your configuration to mitigate this risk, it is crucial to acknowledge that you assume responsibility for managing this aspect on your own.
|
|
||||||
|
|
||||||
**Testing your relay**
|
|
||||||
|
|
||||||
If you want to test your private relay and verify whether it's storing all your notes, you can SSH into your server and execute the following command.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
sudo podman exec nostr.embassy sqlite3 /data/nostr.db "SELECT content FROM event;" | grep -o 'content":"[^"]*' | awk -F: '{print $1":"$2}'
|
|
||||||
|
|
||||||
**Client setup**
|
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
nostrudel
|
nostrudel
|
||||||
|
|
||||||
|
Relay
|
||||||
|
------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
nostr-rs-relay
|
||||||
54
site/source/service-guides/nostr/nostr-rs-relay.rst
Normal file
54
site/source/service-guides/nostr/nostr-rs-relay.rst
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
.. _nostr-service:
|
||||||
|
|
||||||
|
===============
|
||||||
|
Nostr RS Relay
|
||||||
|
===============
|
||||||
|
|
||||||
|
Nostr is a simple, open protocol that enables global, decentralized, and censorship-resistant social media. Nostr RS Relay is written in Rust and currently supports the entire relay protocol, persisting data with SQLite.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
It is highly recommended that you run a private relay, not a public one. Private will be the default option when you open the config for the first time. You will not be able to save the config until you follow the instructions below.
|
||||||
|
|
||||||
|
**Initial Config**
|
||||||
|
|
||||||
|
#. Install **Nostr RS relay** service from Start9 Registry on your server.
|
||||||
|
|
||||||
|
.. figure:: /_static/images/services/nostr/nostr-1.png
|
||||||
|
:width: 50%
|
||||||
|
:alt: nostr install
|
||||||
|
|
||||||
|
#. In the service, page click **CONFIGURE** and add the pubkey in hex format to whitelist your client. Click save.
|
||||||
|
|
||||||
|
.. figure:: /_static/images/services/nostr/nostr-2.png
|
||||||
|
:width: 50%
|
||||||
|
:alt: nostr whitelist pubkey
|
||||||
|
|
||||||
|
#. Now you will have a Nostr relay websocket URL available in Nostr Properties.
|
||||||
|
|
||||||
|
|
||||||
|
**Running a private relay**
|
||||||
|
|
||||||
|
Private relays serve as a personal backup for your posts, follows, messages, settings, and more. Without a private relay, there is no assurance that this data will be preserved, and there is a risk of it disappearing unexpectedly. By utilizing a private relay, only the pubkeys on the whitelist are authorized to post and save content to your relay. To ensure functionality, it is essential to whitelist your own pubkey in hex format. The configuration settings will not permit saving until at least one pubkey is added to the whitelist. Some Nostr clients may offer the option to copy your hex pubkey, but if not, you can visit https://damus.io/key to convert your npub to hex.
|
||||||
|
|
||||||
|
**Running a public relay**
|
||||||
|
|
||||||
|
In contrast to a private relay, a public relay lacks a whitelist, permitting any pubkey to post. Running a public relay is not recommended unless you comprehend the associated risks and configure it with appropriate safeguards. The primary risk to be mindful of is the potential for malicious clients to spam your relay, leading to the saturation of your storage drive. While we have implemented fairly restrictive defaults in your configuration to mitigate this risk, it is crucial to acknowledge that you assume responsibility for managing this aspect on your own.
|
||||||
|
|
||||||
|
**Testing your relay**
|
||||||
|
|
||||||
|
If you want to test your private relay and verify whether it's storing all your notes, you can SSH into your server and execute the following command.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
sudo podman exec nostr.embassy sqlite3 /data/nostr.db "SELECT content FROM event;" | grep -o 'content":"[^"]*' | awk -F: '{print $1":"$2}'
|
||||||
|
|
||||||
|
Alternatively, you can use a new or different web, desktop or mobile client, create a new npub, remove all other relays but yours and then view the global feed.
|
||||||
|
|
||||||
|
Client setup
|
||||||
|
------------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
nostrudel
|
||||||
@@ -39,16 +39,36 @@ noStrudel is a web app for exploring the nostr protocol.
|
|||||||
#. To connect to your own private relay, go to Relays -> App Relays, paste in your Nostr Relay Websocket URL (e.g. ws://address.onion) and click add. You can find this value in the Properties section of your Nostr RS Relay service.
|
#. To connect to your own private relay, go to Relays -> App Relays, paste in your Nostr Relay Websocket URL (e.g. ws://address.onion) and click add. You can find this value in the Properties section of your Nostr RS Relay service.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If you plan to connect to your own private relay, you must use `Tor browser <https://www.torproject.org/>`_ or :ref:`run Tor<connecting-tor>` on your system. We recommend using Firefox which must be :ref:`configured to use Tor<tor-ff>`.
|
|
||||||
It is recommended to use your Relay's Tor websocket URL (ws://address.onion), since the LAN websocket URL (wss://address.local) will only work when you are home.
|
It is recommended to use your Relay's Tor websocket URL (ws://address.onion), since the LAN websocket URL (wss://address.local) will only work when you are home.
|
||||||
|
|
||||||
|
If you plan to do this, you must use `Tor browser <https://www.torproject.org/>`_ or :ref:`run Tor<connecting-tor>` on your system.
|
||||||
|
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
We recommend using Firefox which must be :ref:`configured to use Tor<tor-ff>`.
|
||||||
|
|
||||||
|
You must also allow ws:// websockets.
|
||||||
|
|
||||||
|
Open Firefox and enter ``about:config`` in the URL bar. Accept any warnings that appear.
|
||||||
|
|
||||||
|
Search for ``network.websocket.allowInsecureFromHTTPS`` and set the value to ``true``.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. figure:: /_static/images/services/nostr/nostrudel-5.png
|
.. figure:: /_static/images/services/nostr/nostrudel-5.png
|
||||||
:width: 50%
|
:width: 50%
|
||||||
:alt: add relay
|
:alt: add relay
|
||||||
|
|
||||||
#. To connect to your LND instance using `NWC <https://marketplace.start9.com/marketplace/nostr-wallet-connect>`_ (Nostr Wallet Connect) for LN payments, go to Settings -> Lightning -> Connect wallet. Choose NWC and paste your pairing secret.
|
#. To connect to your LND instance using `Alby Hub <https://marketplace.start9.com/marketplace/alby-hub>`_ for LN payments, go to Settings -> Lightning -> Connect wallet. Then see the Alby Hub guide for :ref:`connecting apps <albyhub>`.
|
||||||
|
|
||||||
.. figure:: /_static/images/services/nostr/nostrudel-6.png
|
.. figure:: /_static/images/services/nostr/nostrudel-6.png
|
||||||
:width: 50%
|
:width: 50%
|
||||||
:alt: connect wallet
|
:alt: connect wallet
|
||||||
|
|
||||||
|
More resources
|
||||||
|
--------------
|
||||||
|
|
||||||
|
- :ref:`Nostr RS Relay <nostr-service>` - create a private or public relay to add to noStrudel
|
||||||
|
|
||||||
|
- :ref:`Alby Hub <albyhub>` - connect LND to noStrudel for sending zaps (and create an Alby account for receiving zaps via proxy to LND)
|
||||||
Reference in New Issue
Block a user