mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-22 08:25:53 -05:00
NIP11 example using curl. (#490)
This commit is contained in:
parent
7f75d0db33
commit
d7c189d70b
88
11.md
88
11.md
|
@ -69,18 +69,18 @@ are rejected or fail immediately.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"limitation": {
|
limitation: {
|
||||||
"max_message_length": 16384,
|
max_message_length: 16384,
|
||||||
"max_subscriptions": 20,
|
max_subscriptions: 20,
|
||||||
"max_filters": 100,
|
max_filters: 100,
|
||||||
"max_limit": 5000,
|
max_limit: 5000,
|
||||||
"max_subid_length": 100,
|
max_subid_length: 100,
|
||||||
"min_prefix": 4,
|
min_prefix: 4,
|
||||||
"max_event_tags": 100,
|
max_event_tags: 100,
|
||||||
"max_content_length": 8196,
|
max_content_length: 8196,
|
||||||
"min_pow_difficulty": 30,
|
min_pow_difficulty: 30,
|
||||||
"auth_required": true,
|
auth_required: true,
|
||||||
"payment_required": true,
|
payment_required: true,
|
||||||
}
|
}
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
@ -141,11 +141,11 @@ all, and preferably an error will be provided when those are received.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"retention": [
|
retention: [
|
||||||
{ "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 },
|
{ kinds: [0, 1, [5, 7], [40, 49]], time: 3600 },
|
||||||
{ "kinds": [[40000, 49999]], "time": 100 },
|
{ kinds: [[40000, 49999], time: 100 },
|
||||||
{ "kinds": [[30000, 39999]], "count": 1000 },
|
{ kinds: [[30000, 39999], count: 1000 },
|
||||||
{ "time": 3600, "count": 10000 }
|
{ time: 3600, count: 10000 }
|
||||||
]
|
]
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ all, and preferably an error will be provided when those are received.
|
||||||
`retention` is a list of specifications: each will apply to either all kinds, or
|
`retention` is a list of specifications: each will apply to either all kinds, or
|
||||||
a subset of kinds. Ranges may be specified for the kind field as a tuple of inclusive
|
a subset of kinds. Ranges may be specified for the kind field as a tuple of inclusive
|
||||||
start and end values. Events of indicated kind (or all) are then limited to a `count`
|
start and end values. Events of indicated kind (or all) are then limited to a `count`
|
||||||
and/or time period.
|
and or time period.
|
||||||
|
|
||||||
It is possible to effectively blacklist Nostr-based protocols that rely on
|
It is possible to effectively blacklist Nostr-based protocols that rely on
|
||||||
a specific `kind` number, by giving a retention time of zero for those `kind` values.
|
a specific `kind` number, by giving a retention time of zero for those `kind` values.
|
||||||
|
@ -175,8 +175,8 @@ It is not possible to describe the limitations of each country's laws
|
||||||
and policies which themselves are typically vague and constantly shifting.
|
and policies which themselves are typically vague and constantly shifting.
|
||||||
|
|
||||||
Therefore, this field allows the relay operator to indicate which
|
Therefore, this field allows the relay operator to indicate which
|
||||||
countries' laws might end up being enforced on them, and then
|
country's' laws might end up being enforced on them, and then
|
||||||
indirectly on their users' content.
|
indirectly on their users's content.
|
||||||
|
|
||||||
Users should be able to avoid relays in countries they don't like,
|
Users should be able to avoid relays in countries they don't like,
|
||||||
and/or select relays in more favourable zones. Exposing this
|
and/or select relays in more favourable zones. Exposing this
|
||||||
|
@ -185,7 +185,7 @@ flexibility is up to the client software.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"relay_countries": [ "CA", "US" ],
|
relay_countries: [ 'CA', 'US' ],
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -208,9 +208,9 @@ To support this goal, relays MAY specify some of the following values.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"language_tags": [ "en", "en-419" ],
|
language_tags: [ 'en', 'en-419' ],
|
||||||
"tags": [ "sfw-only", "bitcoin-only", "anime" ],
|
tags: [ 'sfw-only', 'bitcoin-only', 'anime' ],
|
||||||
"posting_policy": "https://example.com/posting-policy.html",
|
posting_policy: 'https://example.com/posting-policy.html',
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -220,7 +220,7 @@ To support this goal, relays MAY specify some of the following values.
|
||||||
the major languages spoken on the relay.
|
the major languages spoken on the relay.
|
||||||
|
|
||||||
- `tags` is a list of limitations on the topics to be discussed.
|
- `tags` is a list of limitations on the topics to be discussed.
|
||||||
For example `sfw-only` indicates that only "Safe For Work" content
|
For example `sfw-only` indicates hat only "Safe For Work" content
|
||||||
is encouraged on this relay. This relies on assumptions of what the
|
is encouraged on this relay. This relies on assumptions of what the
|
||||||
"work" "community" feels "safe" talking about. In time, a common
|
"work" "community" feels "safe" talking about. In time, a common
|
||||||
set of tags may emerge that allow users to find relays that suit
|
set of tags may emerge that allow users to find relays that suit
|
||||||
|
@ -245,12 +245,40 @@ Relays that require payments may want to expose their fee schedules.
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"payments_url": "https://my-relay/payments",
|
payments_url: "https://my-relay/payments",
|
||||||
"fees": {
|
fees: {
|
||||||
"admission": [{ "amount": 1000000, "unit": "msats" }],
|
"admission": [{ amount: 1000000, unit: 'msats' }],
|
||||||
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
|
"subscription": [{ amount: 5000000, unit: 'msats', period: 2592000 }],
|
||||||
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }],
|
"publication": [{ kinds: [4], amount: 100, unit: 'msats' }],
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Examples ###
|
||||||
|
As of 2 May 2023 the following `curl` command provided these results.
|
||||||
|
|
||||||
|
>curl -H "Accept: application/nostr+json" https://eden.nostr.land
|
||||||
|
|
||||||
|
{"name":"eden.nostr.land",
|
||||||
|
"description":"Eden Nostr Land - Toronto 1-01",
|
||||||
|
"pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700",
|
||||||
|
"contact":"me@ricardocabral.io",
|
||||||
|
"supported_nips":[1,2,4,9,11,12,15,16,20,22,26,28,33,40],
|
||||||
|
"supported_nip_extensions":["11a"],
|
||||||
|
"software":"git+https://github.com/Cameri/nostream.git",
|
||||||
|
"version":"1.22.6",
|
||||||
|
"limitation":{"max_message_length":1048576,
|
||||||
|
"max_subscriptions":10,
|
||||||
|
"max_filters":2500,
|
||||||
|
"max_limit":5000,
|
||||||
|
"max_subid_length":256,
|
||||||
|
"min_prefix":4,
|
||||||
|
"max_event_tags":2500,
|
||||||
|
"max_content_length":65536,
|
||||||
|
"min_pow_difficulty":0,
|
||||||
|
"auth_required":false,
|
||||||
|
"payment_required":true},
|
||||||
|
"payments_url":"https://eden.nostr.land/invoices",
|
||||||
|
"fees":{"admission":[{"amount":5000000,"unit":"msats"}],
|
||||||
|
"publication":[]}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user