39 lines
1.0 KiB
Markdown
39 lines
1.0 KiB
Markdown
# web of npubs
|
|
|
|
Quick and dirty code for minimum viable web of trust.
|
|
|
|
## Running
|
|
|
|
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
|
|
deno run -A fetch.ts
|
|
deno run -A fetch.ts --legacy-mode
|
|
```
|
|
|
|
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.
|
|
|
|
## Development
|
|
|
|
Using repl:
|
|
|
|
```shell
|
|
export DEBUG='ndk:*'
|
|
deno repl -A
|
|
```
|
|
|
|
Paste code from `fetch.ts`. Profit.
|
|
|
|
TODO:
|
|
|
|
* rename pubkey to subscriber_pubkey for consitency.
|
|
|
|
## Reference
|
|
|
|
* [NDK docs](https://ndk.fyi/docs/)
|
|
* [Deno and databases](https://docs.deno.com/runtime/manual/basics/connecting_to_databases) |