mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-13 02:46:24 +00:00
change schema
This commit is contained in:
parent
1a154dc1c8
commit
2d10a628d8
67
59.md
67
59.md
@ -25,54 +25,51 @@ The tags should be used to represent the Relay's abilities and meta at a point i
|
|||||||
```json
|
```json
|
||||||
["d", "wss://history.nostr.watch/"] //tagId[]
|
["d", "wss://history.nostr.watch/"] //tagId[]
|
||||||
```
|
```
|
||||||
2. `"o" == tagOnline[0]` Is the relay online. `tagOnline[]` **may** be included in the `event.tags[]` array. `tagOnline[1]` **must** be type string as exactly `true` or `false`
|
2. `"t" == tagTopic[0]` Topics relevant to the relay. `tagTopic[]` **may** be included in the `event.tags[]` array. `tagTopic[1]` **should** be string. There **should** be no more than **twenty (20)** `tagTopic[]` arrays.
|
||||||
```json
|
|
||||||
["o", "true"] //tagOnline[]
|
|
||||||
```
|
|
||||||
3. `"r" == tagRead[0]` Was able to read from the relay. `tagRead[]` **may** be included in the `event.tags[]` array. `tagRead[1]` **must** be type string as exactly `true` or `false`
|
|
||||||
```json
|
|
||||||
["r", "true"] //tagRead[]
|
|
||||||
```
|
|
||||||
4. `"w" == tagWrite[0]` Was able to write to the relay. `tagWrite[]` **may** be included in the `event.tags[]` array. `tagWrite[1]` **must** be type string as exactly `true` or `false`
|
|
||||||
```json
|
|
||||||
["w", "false"] //tagWrite[]
|
|
||||||
```
|
|
||||||
5. `"s" == tagSsl[0]` Is the relay's SSL valid. `tagSsl[]` **may** be included in the `event.tags[]` array. `tagSsl[1]` **must** be type string as exactly `true` or `false`
|
|
||||||
```json
|
|
||||||
["s", "true"] //tagSsl[]
|
|
||||||
```
|
|
||||||
6. `"t" == tagTopic[0]` Topics relevant to the relay. `tagTopic[]` **may** be included in the `event.tags[]` array. `tagTopic[1]` **should** be string
|
|
||||||
```json
|
```json
|
||||||
["t", "bitcoin"] //tagTopic[]
|
["t", "bitcoin"] //tagTopic[]
|
||||||
```
|
```
|
||||||
7. `"g" == tagGeo[0]` Relay Geo Data. `tagGeo[]` **may** be included in the `event.tags[]` array. `tagGeo[1]` **must** be string. There **may** be strings defined in the key range `2-6` (`tagGeo[2-6]`) and they **must** be strings if set.
|
3. `"g" == tagGeo[0]` Relay Geo Data. `tagGeo[]` **may** be included in the `event.tags[]` array. `tagGeo[1]` **must** be string and **should** be a geohash. There **may** be strings defined in the key range `2+` (`tagGeo[2...]`) and they **must** be strings if set. `tagGeo[]` items **should** be ascending in terms of precision. There **should** be no more than **one (1)** `tagGeo[]` per event.
|
||||||
```json
|
```json
|
||||||
["g", "Europe", "NE", "Amsterdam", "52.377956", "4.897070"] //tagGeo[]
|
["g", "ww8p1r4t8", "Amsterdam", "NL", "EU", "Earth", "Sol", "Milky Way"] //tagGeo[]
|
||||||
```
|
```
|
||||||
8. `"x" == tagIPv4[0]` Relay IPv4. `tagIPv4[]` **may** be included in the `event.tags[]` array. `tagIPv4[1]` **must** be string.
|
4. `"online" == tagOnline[0]` Is the relay online. `tagOnline[]` **may** be included in the `event.tags[]` array. `tagOnline[1]` **must** be type string as exactly `true` or `false`
|
||||||
```json
|
```json
|
||||||
["x", "1.1.1.1"] //tagIPv4[]
|
["online", "true"] //tagOnline[]
|
||||||
```
|
```
|
||||||
9. `"y" == tagIPv6[0]` Relay IPv6. `tagIPv6[]` **may** be included in the `event.tags[]` array. `tagIPv6[1]` **must** be string.
|
5. `"read" == tagRead[0]` Was able to read from the relay. `tagRead[]` **may** be included in the `event.tags[]` array. `tagRead[1]` **must** be type string as exactly `true` or `false`
|
||||||
```json
|
```json
|
||||||
["y", "2001:db8:3333:4444:5555:6666:7777:8888"] //tagIPv6[]
|
["read", "true"] //tagRead[]
|
||||||
|
```
|
||||||
|
6. `"write" == tagWrite[0]` Was able to write to the relay. `tagWrite[]` **may** be included in the `event.tags[]` array. `tagWrite[1]` **must** be type string as exactly `true` or `false`
|
||||||
|
```json
|
||||||
|
["write", "false"] //tagWrite[]
|
||||||
|
```
|
||||||
|
7. `"ssl" == tagSsl[0]` Is the relay's SSL valid. `tagSsl[]` **may** be included in the `event.tags[]` array. `tagSsl[1]` **must** be type string as exactly `true` or `false`
|
||||||
|
```json
|
||||||
|
["ssl", "true"] //tagSsl[]
|
||||||
|
```
|
||||||
|
8. `"ip" == tagIp[0]` Relay IP. `ip[]` **may** be included in the `event.tags[]` array. `tagIp[1]` **must** be string. There **may** be more than one (1) `tagIp[]`
|
||||||
|
```json
|
||||||
|
["ip", "1.1.1.1"], //tagIp[]
|
||||||
|
["ip", "2001:db8:3333:4444:5555:6666:7777:8888"] //tagIp[]
|
||||||
```
|
```
|
||||||
|
|
||||||
Minimum Requirements:
|
Example with Minimum Requirements:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "<eventid>",
|
"id": "<eventid>",
|
||||||
"pubkey": "<pubkey>",
|
"pubkey": "<pubkey>",
|
||||||
"created_at": "<created_at>",
|
"created_at": "<created_at>",
|
||||||
"signature": "<signature>",
|
"signature": "<signature>",
|
||||||
"content": "{}",
|
"content": "",
|
||||||
"tags": [
|
"tags": [
|
||||||
["d","wss://relay.snort.social/"]
|
["d","wss://relay.snort.social/"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Example Event:
|
Example with all Tags:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "<eventid>",
|
"id": "<eventid>",
|
||||||
@ -81,16 +78,16 @@ Example Event:
|
|||||||
"signature": "<signature>",
|
"signature": "<signature>",
|
||||||
"content": "{}",
|
"content": "{}",
|
||||||
"tags": [
|
"tags": [
|
||||||
["d","wss://relay.snort.social/"],
|
["d","wss://some.relay/"],
|
||||||
["o","true"],
|
|
||||||
["r","true"],
|
|
||||||
["w","false"],
|
|
||||||
["s","true"],
|
|
||||||
["t","bitcoin"],
|
|
||||||
["t","nostrica"],
|
["t","nostrica"],
|
||||||
["g","Europe","NE","Amsterdam","52.377956","4.897070"],
|
["t","bitcoin"],
|
||||||
["x", "1.1.1.1"],
|
["g","ww8p1r4t8", "Amsterdam", "NL", "EU", "Earth"],
|
||||||
["y", "2001:db8:3333:4444:5555:6666:7777:8888"]
|
["ip", "1.1.1.1"],
|
||||||
|
["ip", "2001:db8:3333:4444:5555:6666:7777:8888"]
|
||||||
|
["open","true"],
|
||||||
|
["read","true"],
|
||||||
|
["write","false"],
|
||||||
|
["ssl","true"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user