forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect.schema.json
82 lines (82 loc) · 1.76 KB
/
connect.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"required": [ "id", "features", "direction", "address" ],
"properties": {
"id": {
"type": "pubkey",
"description": "the peer we connected to"
},
"features": {
"type": "hex",
"description": "BOLT 9 features bitmap offered by peer"
},
"direction": {
"type": "string",
"enum": [ "in", "out" ],
"description": "Whether they initiated connection or we did"
},
"address": {
"type": "object",
"description": "Address information (mainly useful if **direction** is *out*)",
"additionalProperties": true,
"required": [ "type" ],
"properties": {
"type": {
"type": "string",
"enum": [ "local socket", "ipv4", "ipv6", "torv2", "torv3" ],
"description": "Type of connection (*torv2*/*torv3* only if **direction** is *out*)"
}
},
"allOf": [
{
"if": {
"properties": {
"type": {
"type": "string",
"enum": [ "local socket" ]
}
}
},
"then": {
"additionalProperties": false,
"required": [ "socket" ],
"properties": {
"type": { },
"socket": {
"type": "string",
"description": "socket filename"
}
}
}
},
{
"if": {
"properties": {
"type": {
"type": "string",
"enum": [ "ipv4", "ipv6", "torv2", "torv3" ]
}
}
},
"then": {
"additionalProperties": false,
"required": [ "address", "port" ],
"properties": {
"type": { },
"address": {
"type": "string",
"description": "address in expected format for **type**"
},
"port": {
"type": "u16",
"description": "port number"
}
}
}
}
]
}
}
}