civkit / civkit/civkit-node

Finish the implementation of NIP-01

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
62
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Our implementation of NIP-01 is not very complete, the following list of items is missing (at least).

Filtering is only implemented to match on kind in `filter_events` (in `src/clienthandler.rs`), spec says “at least one of the array’s values must match the relevant field in an event for the condition itself to be considered a match” so we should match all filter attributes (`ids`, `authors`, `kinds`, `#e`, `#p`, `since`, `until`).

The spec says “all conditions of a filter that are specified must match for an event for it to pass the filter, i.e., multiple conditions are interpreted as `&&` conditions”, so when we parse an `Event` against `Filter` the event should satisfy the concatenation of all the attributes.

We do not enforce the `limit` property, this can be done at reception of `ClientMessage::Req` though here we might need a notion of a store first, see "TODO: replay stored events when there is a store”

There is no implementation of metadata assigned to our `NostrClient` (in `src/clienthandler.rs`) as a result of calling `setmetadata` in the sample.

There is no implementation of recommendation assigned to our `NostrClient` (in `src/clienthandler.rs`) as a result of calling `recommendserver` in the sample.

Our `opensubscription` command in the sample do not take as argument all the filter attributes (`ids`, `authors`, `kinds`, `#e`, `#p`, `since`, `until`), neither can accept an array of filters.

Can be splitted in multiple PRs as some of the items might be buffy.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.