CREATE DATABASE nosdump_and_store;
\c nosdump_and_store;
CREATE TABLE nostr_events (
id character varying NOT NULL,
kind integer NOT NULL,
created_at integer NOT NULL,
body json NOT NULL
);
ALTER TABLE ONLY nostr_events ADD CONSTRAINT nostr_events_pkey PRIMARY KEY (id);
CREATE INDEX index_nostr_events_on_kind ON nostr_events USING btree (kind);
CREATE INDEX index_nostr_events_on_created_at ON nostr_events USING btree (created_at);
docker run -d \
-e NOSDUMP_AUTHORS=npub1abc...001,npub1def...002 \
-e NOSDUMP_RELAYS=wss://nostr.example.com,wss://another-relay.example.com \
-e DATABASE_URL=postgres://user:pass@host:5432/nosdump_and_store \
kaosf/nosdump-and-store:0.8.0
- Validation or verification feature in other gems
- Test code
docker run -d -p 5432:5432 postgres:14.6
psql postgres://postgres:@127.0.0.1:5432/
CREATE DATABASE "nosdump_and_store_development";
psql postgres://postgres:@127.0.0.1:5432/nosdump_and_store_development
CREATE TABLE IF NOT EXISTS "nostr_events" (
"id" text primary key,
"kind" integer not null,
"created_at" integer not null,
"body" json not null
);
bundle
# Edit app.rb
DATABASE_URL=postgres://postgres:@127.0.0.1:5432/nosdump_and_store_development \
IS_DEVELOPMENT=1 \
SINCE_MARGIN_SECONDS=3600 \
SLEEP_SECONDS=30 \
bundle exec ruby app.rb
Copyright (C) 2023 ka