mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-13 23:39:08 -05:00
Merge pull request #744 from viktorvsk/patch-1
Allow relays indicate whether probabilistic count was used in NIP-45
This commit is contained in:
commit
415e261ec0
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