Document strfry integration
This commit is contained in:
parent
29ff486683
commit
b29a0abb0b
57
docs/dev/nostr.md
Normal file
57
docs/dev/nostr.md
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# Nostr
|
||||||
|
|
||||||
|
## strfry
|
||||||
|
|
||||||
|
The `extras/strfry` directory contains code to integrate [strfry][1] with
|
||||||
|
akkounts, so that notes published to the relay have to be authored by (or in
|
||||||
|
some cases just related to) local users who have verified their Nostr public
|
||||||
|
key.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
[Deno](https://deno.com/) needs to be installed on the machine that you run
|
||||||
|
strfry on.
|
||||||
|
|
||||||
|
We provide a Docker image with recent strfry and Deno builds:
|
||||||
|
|
||||||
|
https://gitea.kosmos.org/kosmos/-/packages/container/strfry-deno/
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
You can use either environment variables (see e.g. the `strfry` service in
|
||||||
|
`docker-compose-yml`) or a local `.env` file in the same working directory
|
||||||
|
that you place the extra files in (e.g. `/opt/strfry`).
|
||||||
|
|
||||||
|
In your `strfry.conf`, configure `strfry-policy.ts` as the write policy, like so:
|
||||||
|
|
||||||
|
```
|
||||||
|
writePolicy {
|
||||||
|
plugin = "/opt/strfry/strfry-policy.ts"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
All dependencies will be downloaded and cached automatically when the plugin is
|
||||||
|
called for the first time.
|
||||||
|
|
||||||
|
### Manual tasks
|
||||||
|
|
||||||
|
You can sync all notes authored by local users (any account that has verified
|
||||||
|
their Nostr pubkey with akkounts) from a remote [strfry][1] relay via negentropy
|
||||||
|
sync:
|
||||||
|
|
||||||
|
deno run -A /opt/strfry/strfry-sync.ts wss://nostr.kosmos.org
|
||||||
|
|
||||||
|
Or, in the running container when using Docker Compose:
|
||||||
|
|
||||||
|
docker compose exec strfry deno run -A /opt/strfry/strfry-sync.ts wss://nostr.kosmos.org
|
||||||
|
|
||||||
|
The `strfry` service container also exposes the local relay on your local host
|
||||||
|
on port 4777.
|
||||||
|
|
||||||
|
[nak](https://github.com/fiatjaf/nak) is a helpful tool for manual Nostr tasks.
|
||||||
|
Here's how you can grab a note by its event ID from a remote relay and publish
|
||||||
|
it to your local strfry for example:
|
||||||
|
|
||||||
|
nak req -i 0fb010192685b86b0810b3de3706fbbf3b8c1db30b14533094a2b9700c820cdc nostr.kosmos.org | nak event ws://localhost:4777
|
||||||
|
|
||||||
|
[1]: https://github.com/hoytech/strfry
|
Loading…
x
Reference in New Issue
Block a user