diff options
| author | Jon Staab <jstaab@protonmail.com> | 2023-08-28 09:43:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-28 09:43:41 -0700 |
| commit | 415e261ec0d1c68b3dcd8631d94227b91a87c899 (patch) | |
| tree | 352aea49c7aac0b5b76a2bee8042478e5515c44f | |
| parent | 52ba024eff529be4a85b6198ff00a233181ef735 (diff) | |
| parent | 21f3ad5a42c0ae63f2fc0a6e9f18b05f44df68c5 (diff) | |
Merge pull request #744 from viktorvsk/patch-1
Allow relays indicate whether probabilistic count was used in NIP-45
| -rw-r--r-- | 45.md | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -21,6 +21,7 @@ This NIP defines the verb `COUNT`, which accepts a subscription id and filters a | |||
| 21 | ``` | 21 | ``` |
| 22 | 22 | ||
| 23 | Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements. | 23 | Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements. |
| 24 | In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`. | ||
| 24 | 25 | ||
| 25 | ``` | 26 | ``` |
| 26 | ["COUNT", <subscription_id>, {"count": <integer>}] | 27 | ["COUNT", <subscription_id>, {"count": <integer>}] |
| @@ -36,4 +37,8 @@ Examples: | |||
| 36 | # Count posts and reactions | 37 | # Count posts and reactions |
| 37 | ["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] | 38 | ["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] |
| 38 | ["COUNT", <subscription_id>, {"count": 5}] | 39 | ["COUNT", <subscription_id>, {"count": 5}] |
| 40 | |||
| 41 | # Count posts approximately | ||
| 42 | ["COUNT", <subscription_id>, {"kinds": [1]}] | ||
| 43 | ["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}] | ||
| 39 | ``` | 44 | ``` |