change schema

This commit is contained in:
dskvr 2023-02-10 13:34:58 +01:00
parent 1a154dc1c8
commit 2d10a628d8

57
59.md
View File

@ -25,54 +25,51 @@ The tags should be used to represent the Relay's abilities and meta at a point i
```json
["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[]
["t", "bitcoin"] //tagTopic[]
```
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`
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
["r", "true"] //tagRead[]
["g", "ww8p1r4t8", "Amsterdam", "NL", "EU", "Earth", "Sol", "Milky Way"] //tagGeo[]
```
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`
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
["w", "false"] //tagWrite[]
["online", "true"] //tagOnline[]
```
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`
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
["s", "true"] //tagSsl[]
["read", "true"] //tagRead[]
```
6. `"t" == tagTopic[0]` Topics relevant to the relay. `tagTopic[]` **may** be included in the `event.tags[]` array. `tagTopic[1]` **should** be string
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
["t", "bitcoin"] //tagTopic[]
["write", "false"] //tagWrite[]
```
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.
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
["g", "Europe", "NE", "Amsterdam", "52.377956", "4.897070"] //tagGeo[]
["ssl", "true"] //tagSsl[]
```
8. `"x" == tagIPv4[0]` Relay IPv4. `tagIPv4[]` **may** be included in the `event.tags[]` array. `tagIPv4[1]` **must** be string.
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
["x", "1.1.1.1"] //tagIPv4[]
```
9. `"y" == tagIPv6[0]` Relay IPv6. `tagIPv6[]` **may** be included in the `event.tags[]` array. `tagIPv6[1]` **must** be string.
```json
["y", "2001:db8:3333:4444:5555:6666:7777:8888"] //tagIPv6[]
["ip", "1.1.1.1"], //tagIp[]
["ip", "2001:db8:3333:4444:5555:6666:7777:8888"] //tagIp[]
```
Minimum Requirements:
Example with Minimum Requirements:
```json
{
"id": "<eventid>",
"pubkey": "<pubkey>",
"created_at": "<created_at>",
"signature": "<signature>",
"content": "{}",
"content": "",
"tags": [
["d","wss://relay.snort.social/"]
]
}
```
Example Event:
Example with all Tags:
```json
{
"id": "<eventid>",
@ -81,16 +78,16 @@ Example Event:
"signature": "<signature>",
"content": "{}",
"tags": [
["d","wss://relay.snort.social/"],
["o","true"],
["r","true"],
["w","false"],
["s","true"],
["t","bitcoin"],
["d","wss://some.relay/"],
["t","nostrica"],
["g","Europe","NE","Amsterdam","52.377956","4.897070"],
["x", "1.1.1.1"],
["y", "2001:db8:3333:4444:5555:6666:7777:8888"]
["t","bitcoin"],
["g","ww8p1r4t8", "Amsterdam", "NL", "EU", "Earth"],
["ip", "1.1.1.1"],
["ip", "2001:db8:3333:4444:5555:6666:7777:8888"]
["open","true"],
["read","true"],
["write","false"],
["ssl","true"]
]
}
```