2022-12-19 19:42:40 +00:00
|
|
|
appName: strfry
|
|
|
|
|
|
|
|
quadrable: true
|
|
|
|
|
|
|
|
flatBuffers: |
|
|
|
|
include "../fbs/nostr-index.fbs";
|
|
|
|
|
2023-01-11 21:23:18 +00:00
|
|
|
includes: |
|
|
|
|
inline std::string_view sv(const NostrIndex::Fixed32Bytes *f) {
|
|
|
|
return std::string_view((const char *)f->val()->data(), 32);
|
|
|
|
}
|
|
|
|
|
2022-12-19 19:42:40 +00:00
|
|
|
tables:
|
|
|
|
Event:
|
|
|
|
tableId: 1
|
|
|
|
|
|
|
|
primaryKey: quadId
|
|
|
|
|
|
|
|
fields:
|
|
|
|
- name: quadId
|
|
|
|
- name: receivedAt # microseconds
|
|
|
|
- name: flat
|
|
|
|
type: ubytes
|
|
|
|
nestedFlat: NostrIndex.Event
|
|
|
|
|
|
|
|
indices:
|
|
|
|
created_at:
|
|
|
|
integer: true
|
|
|
|
id:
|
|
|
|
comparator: StringUint64
|
|
|
|
pubkey:
|
|
|
|
comparator: StringUint64
|
|
|
|
kind:
|
|
|
|
comparator: Uint64Uint64
|
|
|
|
pubkeyKind:
|
|
|
|
comparator: StringUint64Uint64
|
|
|
|
tag:
|
|
|
|
comparator: StringUint64
|
|
|
|
multi: true
|
|
|
|
deletion: # eventId, pubkey
|
|
|
|
multi: true
|
|
|
|
|
|
|
|
indexPrelude: |
|
|
|
|
auto *flat = v.flat_nested();
|
|
|
|
created_at = flat->created_at();
|
|
|
|
uint64_t indexTime = *created_at;
|
|
|
|
|
|
|
|
id = makeKey_StringUint64(sv(flat->id()), indexTime);
|
|
|
|
pubkey = makeKey_StringUint64(sv(flat->pubkey()), indexTime);
|
|
|
|
kind = makeKey_Uint64Uint64(flat->kind(), indexTime);
|
|
|
|
pubkeyKind = makeKey_StringUint64Uint64(sv(flat->pubkey()), flat->kind(), indexTime);
|
|
|
|
|
2023-01-11 21:23:18 +00:00
|
|
|
for (const auto &tagPair : *(flat->tagsGeneral())) {
|
|
|
|
auto tagName = (char)tagPair->key();
|
|
|
|
auto tagVal = sv(tagPair->val());
|
|
|
|
tag.push_back(makeKey_StringUint64(std::string(1, tagName) + std::string(tagVal), indexTime));
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const auto &tagPair : *(flat->tagsFixed32())) {
|
2022-12-19 19:42:40 +00:00
|
|
|
auto tagName = (char)tagPair->key();
|
|
|
|
auto tagVal = sv(tagPair->val());
|
|
|
|
tag.push_back(makeKey_StringUint64(std::string(1, tagName) + std::string(tagVal), indexTime));
|
|
|
|
if (flat->kind() == 5 && tagName == 'e') deletion.push_back(std::string(tagVal) + std::string(sv(flat->pubkey())));
|
|
|
|
}
|
|
|
|
|
|
|
|
config:
|
|
|
|
- name: db
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Directory that contains strfry database"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: "./strfry-db/"
|
|
|
|
noReload: true
|
|
|
|
|
|
|
|
- name: relay__bind
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Interface to listen on. Use 0.0.0.0 to listen on all interfaces"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: "127.0.0.1"
|
|
|
|
noReload: true
|
2023-01-13 21:14:11 +00:00
|
|
|
- name: relay__port
|
|
|
|
desc: "Port to open for the nostr websocket protocol"
|
|
|
|
default: 7777
|
|
|
|
noReload: true
|
2022-12-19 19:42:40 +00:00
|
|
|
|
|
|
|
- name: relay__info__name
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "NIP-11: Name of this server. Short/descriptive (< 30 characters)"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: "strfry default"
|
|
|
|
- name: relay__info__description
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "NIP-11: Detailed information about relay, free-form"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: "This is a strfry instance."
|
|
|
|
- name: relay__info__pubkey
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "NIP-11: Administrative nostr pubkey, for contact purposes"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: "unset"
|
|
|
|
- name: relay__info__contact
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "NIP-11: Alternative administrative contact (email, website, etc)"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: "unset"
|
|
|
|
|
|
|
|
- name: relay__maxWebsocketPayloadSize
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Maximum accepted incoming websocket frame size (should be larger than max event and yesstr msg)"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 131072
|
|
|
|
noReload: true
|
2023-01-12 04:56:45 +00:00
|
|
|
- name: relay__autoPingSeconds
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Websocket-level PING message frequency (should be less than any reverse proxy idle timeouts)"
|
2023-01-12 04:56:45 +00:00
|
|
|
default: 55
|
|
|
|
noReload: true
|
2023-01-13 19:34:54 +00:00
|
|
|
- name: relay__enableTcpKeepalive
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "If TCP keep-alive should be enabled (detect dropped connections to upstream reverse proxy)"
|
2023-01-13 19:34:54 +00:00
|
|
|
default: false
|
2022-12-19 19:42:40 +00:00
|
|
|
- name: relay__queryTimesliceBudgetMicroseconds
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "How much uninterrupted CPU time a REQ query should get during its DB scan"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 10000
|
|
|
|
- name: relay__maxFilterLimit
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Maximum records that can be returned per filter"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 500
|
|
|
|
|
2023-01-22 16:33:12 +00:00
|
|
|
- name: relay__logging__dumpInAll
|
|
|
|
desc: "Dump all incoming messages"
|
|
|
|
default: false
|
|
|
|
- name: relay__logging__dumpInEvents
|
|
|
|
desc: "Dump all incoming EVENT messages"
|
|
|
|
default: false
|
|
|
|
- name: relay__logging__dumpInReqs
|
|
|
|
desc: "Dump all incoming REQ/CLOSE messages"
|
|
|
|
default: false
|
|
|
|
- name: relay__logging__dbScanPerf
|
|
|
|
desc: "Log performance metrics for initial REQ database scans"
|
|
|
|
default: false
|
|
|
|
|
2023-01-13 21:14:11 +00:00
|
|
|
- name: relay__numThreads__ingester
|
|
|
|
default: 3
|
|
|
|
noReload: true
|
|
|
|
- name: relay__numThreads__reqWorker
|
|
|
|
default: 3
|
|
|
|
noReload: true
|
|
|
|
- name: relay__numThreads__reqMonitor
|
|
|
|
default: 3
|
|
|
|
noReload: true
|
|
|
|
- name: relay__numThreads__yesstr
|
|
|
|
default: 1
|
|
|
|
noReload: true
|
|
|
|
|
|
|
|
- name: events__maxEventSize
|
|
|
|
desc: "Maximum size of normalised JSON, in bytes"
|
|
|
|
default: 65536
|
2022-12-19 19:42:40 +00:00
|
|
|
- name: events__rejectEventsNewerThanSeconds
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Events newer than this will be rejected"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 900 # 15 mins
|
|
|
|
- name: events__rejectEventsOlderThanSeconds
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Events older than this will be rejected"
|
|
|
|
default: 94608000 # 3 years
|
2022-12-19 19:42:40 +00:00
|
|
|
- name: events__rejectEphemeralEventsOlderThanSeconds
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Ephemeral events older than this will be rejected"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 60
|
|
|
|
- name: events__ephemeralEventsLifetimeSeconds
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Ephemeral events will be deleted from the DB when older than this"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 300
|
|
|
|
- name: events__maxNumTags
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Maximum number of tags allowed"
|
2022-12-19 19:42:40 +00:00
|
|
|
default: 250
|
|
|
|
- name: events__maxTagValSize
|
2023-01-13 21:14:11 +00:00
|
|
|
desc: "Maximum size for tag values, in bytes"
|
2023-01-16 19:04:44 +00:00
|
|
|
default: 255
|