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 ```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 ```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 ```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 ```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 ```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 ```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 ```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 ```json
["x", "1.1.1.1"] //tagIPv4[] ["ip", "1.1.1.1"], //tagIp[]
``` ["ip", "2001:db8:3333:4444:5555:6666:7777:8888"] //tagIp[]
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[]
``` ```
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"]
] ]
} }
``` ```