diff --git a/README.md b/README.md index f63c834..f19a66c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,18 @@ # cagliostr -Experimental Nostr Relay written in C++ +High performance Nostr Relay written in C++ ## Usage ``` -$ ./cagliostr +$ ./cagliostr --help +Usage: cagliostr [--help] [--version] [-database DATABASE] [-loglevel LEVEL] + +Optional arguments: + -h, --help shows help message and exits + -v, --version prints version information and exits + -database DATABASE connection string [default: "./cagliostr.sqlite"] + -loglevel LEVEL log level [default: "info"] ``` ## Requirements diff --git a/main.cxx b/main.cxx index 8b175cf..a58c033 100644 --- a/main.cxx +++ b/main.cxx @@ -229,7 +229,7 @@ static bool matched_filters(const std::vector &filters, return found; } -static bool check_event(const event_t ev) { +static bool check_event(const event_t& ev) { nlohmann::json check = {0, ev.pubkey, ev.created_at, ev.kind, ev.tags, ev.content}; auto dump = check.dump(); @@ -477,10 +477,6 @@ static void signal_handler(uv_signal_t *req, int /*signum*/) { sqlite3_close_v2(conn); } -using commandtype = std::function::const_iterator, - std::vector::const_iterator)>; - static std::string env(const char *name, const char *defvalue) { const char *value = getenv(name); if (value == nullptr) {