change schema

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

67
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`
```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
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
["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
["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
["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
["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
{
"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"]
]
}
```