npubweb/README.md

39 lines
1.0 KiB
Markdown
Raw Permalink Normal View History

2024-01-11 19:08:10 +00:00
# web of npubs
2024-01-11 21:33:44 +00:00
Quick and dirty code for minimum viable web of trust.
2024-01-11 19:08:10 +00:00
## Running
2024-01-11 21:33:44 +00:00
Create a SQLite database `pubkeys.db` from the old csv file of users. This is idempotent.
```sh
deno run --allow-read=. --allow-write=. initialize-subscriber-table.ts
2024-01-12 21:33:20 +00:00
deno run -A fetch.ts
deno run -A fetch.ts --legacy-mode
2024-01-11 21:33:44 +00:00
```
2024-01-11 19:08:10 +00:00
2024-01-12 21:33:20 +00:00
The legacy mode flag disables outbox mode to workaround issues where outbox mode stalls indefinitely on some profiles.
Moreover, the websocket implementation in Deno will frequently crash for whatever reason. This means we need to run the script many times before it finishes collecting npubs.
There's no update method, so if you want to update the foaf pubkey lists, delete `pubkey.db` and run the script again.
2024-01-11 19:08:10 +00:00
## Development
2024-01-12 21:33:20 +00:00
Using repl:
2024-01-11 19:08:10 +00:00
```shell
export DEBUG='ndk:*'
deno repl -A
```
2024-01-12 21:33:20 +00:00
Paste code from `fetch.ts`. Profit.
TODO:
* rename pubkey to subscriber_pubkey for consitency.
2024-01-11 19:08:10 +00:00
## Reference
* [NDK docs](https://ndk.fyi/docs/)
* [Deno and databases](https://docs.deno.com/runtime/manual/basics/connecting_to_databases)