mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
Allow relays indicate whether probabilistic count was used in NIP-45
This commit is contained in:
parent
50945f7150
commit
21f3ad5a42
5
45.md
5
45.md
|
@ -21,6 +21,7 @@ This NIP defines the verb `COUNT`, which accepts a subscription id and filters a
|
||||||
```
|
```
|
||||||
|
|
||||||
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
|
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
|
||||||
|
In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
|
||||||
|
|
||||||
```
|
```
|
||||||
["COUNT", <subscription_id>, {"count": <integer>}]
|
["COUNT", <subscription_id>, {"count": <integer>}]
|
||||||
|
@ -36,4 +37,8 @@ Examples:
|
||||||
# Count posts and reactions
|
# Count posts and reactions
|
||||||
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
|
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
|
||||||
["COUNT", <subscription_id>, {"count": 5}]
|
["COUNT", <subscription_id>, {"count": 5}]
|
||||||
|
|
||||||
|
# Count posts approximately
|
||||||
|
["COUNT", <subscription_id>, {"kinds": [1]}]
|
||||||
|
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user