Skip to content

Commit 638fb95

Browse files
doc: Askrene examples
Changelog-Added: Generating askrene examples by test script
1 parent 34dcc7b commit 638fb95

14 files changed

+780
-2
lines changed

contrib/msggen/msggen/schema.json

Lines changed: 366 additions & 1 deletion
Large diffs are not rendered by default.

doc/schemas/lightning-askrene-age.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,21 @@
5959
],
6060
"resources": [
6161
"Main web site: <https://github.com/ElementsProject/lightning>"
62+
],
63+
"examples": [
64+
{
65+
"request": {
66+
"id": "example:askrene-age#1",
67+
"method": "askrene-age",
68+
"params": {
69+
"layer": "test_layers",
70+
"cutoff": 1738000000
71+
}
72+
},
73+
"response": {
74+
"layer": "test_layers",
75+
"num_removed": 1
76+
}
77+
}
6278
]
6379
}

doc/schemas/lightning-askrene-create-channel.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,21 @@
6868
],
6969
"resources": [
7070
"Main web site: <https://github.com/ElementsProject/lightning>"
71+
],
72+
"examples": [
73+
{
74+
"request": {
75+
"id": "example:askrene-create-channel#1",
76+
"method": "askrene-create-channel",
77+
"params": {
78+
"layer": "test_layers",
79+
"source": "nodeid030303030303030303030303030303030303030303030303030303030303",
80+
"destination": "nodeid010101010101010101010101010101010101010101010101010101010101",
81+
"short_channel_id": "0x0x1",
82+
"capacity_msat": "1000000sat"
83+
}
84+
},
85+
"response": {}
86+
}
7187
]
7288
}

doc/schemas/lightning-askrene-create-layer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,27 @@
197197
],
198198
"resources": [
199199
"Main web site: <https://github.com/ElementsProject/lightning>"
200+
],
201+
"examples": [
202+
{
203+
"request": {
204+
"id": "example:askrene-create-layer#1",
205+
"method": "askrene-create-layer",
206+
"params": {
207+
"layer": "test_layers"
208+
}
209+
},
210+
"response": {
211+
"layers": [
212+
{
213+
"layer": "test_layers",
214+
"disabled_nodes": [],
215+
"created_channels": [],
216+
"channel_updates": [],
217+
"constraints": []
218+
}
219+
]
220+
}
221+
}
200222
]
201223
}

doc/schemas/lightning-askrene-disable-node.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,18 @@
4545
],
4646
"resources": [
4747
"Main web site: <https://github.com/ElementsProject/lightning>"
48+
],
49+
"examples": [
50+
{
51+
"request": {
52+
"id": "example:askrene-disable-node#1",
53+
"method": "askrene-disable-node",
54+
"params": {
55+
"layer": "test_layers",
56+
"node": "nodeid010101010101010101010101010101010101010101010101010101010101"
57+
}
58+
},
59+
"response": {}
60+
}
4861
]
4962
}

doc/schemas/lightning-askrene-inform-channel.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,29 @@
9696
],
9797
"resources": [
9898
"Main web site: <https://github.com/ElementsProject/lightning>"
99+
],
100+
"examples": [
101+
{
102+
"request": {
103+
"id": "example:askrene-inform-channel#1",
104+
"method": "askrene-inform-channel",
105+
"params": {
106+
"layer": "test_layers",
107+
"short_channel_id_dir": "0x0x1/1",
108+
"amount_msat": 100000,
109+
"inform": "unconstrained"
110+
}
111+
},
112+
"response": {
113+
"constraints": [
114+
{
115+
"layer": "test_layers",
116+
"short_channel_id_dir": "0x0x1/1",
117+
"timestamp": 1738000000,
118+
"minimum_msat": 100000
119+
}
120+
]
121+
}
122+
}
99123
]
100124
}

doc/schemas/lightning-askrene-listlayers.json

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,86 @@
193193
"request": {
194194
"id": "example:askrene-listlayers#1",
195195
"method": "askrene-listlayers",
196+
"params": [
197+
"test_layers"
198+
]
199+
},
200+
"response": {
201+
"layers": [
202+
{
203+
"layer": "test_layers",
204+
"disabled_nodes": [
205+
"nodeid010101010101010101010101010101010101010101010101010101010101"
206+
],
207+
"created_channels": [
208+
{
209+
"source": "nodeid010101010101010101010101010101010101010101010101010101010101",
210+
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
211+
"short_channel_id": "0x0x1",
212+
"capacity_msat": 1000000000
213+
}
214+
],
215+
"channel_updates": [
216+
{
217+
"short_channel_id_dir": "0x0x1/0",
218+
"htlc_minimum_msat": 100,
219+
"htlc_maximum_msat": 900000000,
220+
"fee_base_msat": 1,
221+
"fee_proportional_millionths": 2,
222+
"cltv_expiry_delta": 18
223+
}
224+
],
225+
"constraints": [
226+
{
227+
"short_channel_id_dir": "0x0x1/1",
228+
"timestamp": 1738000000,
229+
"minimum_msat": 100000
230+
}
231+
]
232+
}
233+
]
234+
}
235+
},
236+
{
237+
"request": {
238+
"id": "example:askrene-listlayers#2",
239+
"method": "askrene-listlayers",
196240
"params": {}
197241
},
198242
"response": {
199-
"layers": []
243+
"layers": [
244+
{
245+
"layer": "test_layers",
246+
"disabled_nodes": [
247+
"nodeid010101010101010101010101010101010101010101010101010101010101"
248+
],
249+
"created_channels": [
250+
{
251+
"source": "nodeid010101010101010101010101010101010101010101010101010101010101",
252+
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
253+
"short_channel_id": "0x0x1",
254+
"capacity_msat": 1000000000
255+
}
256+
],
257+
"channel_updates": [
258+
{
259+
"short_channel_id_dir": "0x0x1/0",
260+
"htlc_minimum_msat": 100,
261+
"htlc_maximum_msat": 900000000,
262+
"fee_base_msat": 1,
263+
"fee_proportional_millionths": 2,
264+
"cltv_expiry_delta": 18
265+
}
266+
],
267+
"constraints": [
268+
{
269+
"short_channel_id_dir": "0x0x1/1",
270+
"timestamp": 1738000000,
271+
"minimum_msat": 100000
272+
}
273+
]
274+
}
275+
]
200276
}
201277
}
202278
]

doc/schemas/lightning-askrene-listreservations.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,42 @@
6868
],
6969
"resources": [
7070
"Main web site: <https://github.com/ElementsProject/lightning>"
71+
],
72+
"examples": [
73+
{
74+
"request": {
75+
"id": "example:askrene-listreservations#1",
76+
"method": "askrene-listreservations",
77+
"params": {}
78+
},
79+
"response": {
80+
"reservations": [
81+
{
82+
"short_channel_id_dir": "109x1x1/1",
83+
"amount_msat": 1250000,
84+
"age_in_seconds": 2,
85+
"command_id": "\"-c:askrene-reserve#62/cln:askrene-reserve#122\""
86+
},
87+
{
88+
"short_channel_id_dir": "123x1x1/0",
89+
"amount_msat": 1250001,
90+
"age_in_seconds": 2,
91+
"command_id": "\"-c:askrene-reserve#62/cln:askrene-reserve#122\""
92+
},
93+
{
94+
"short_channel_id_dir": "109x1x1/1",
95+
"amount_msat": 1250000000000,
96+
"age_in_seconds": 2,
97+
"command_id": "\"-c:askrene-reserve#66/cln:askrene-reserve#126\""
98+
},
99+
{
100+
"short_channel_id_dir": "123x1x1/0",
101+
"amount_msat": 1250000000000,
102+
"age_in_seconds": 2,
103+
"command_id": "\"-c:askrene-reserve#66/cln:askrene-reserve#126\""
104+
}
105+
]
106+
}
107+
}
71108
]
72109
}

doc/schemas/lightning-askrene-remove-layer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,17 @@
3535
],
3636
"resources": [
3737
"Main web site: <https://github.com/ElementsProject/lightning>"
38+
],
39+
"examples": [
40+
{
41+
"request": {
42+
"id": "example:askrene-remove-layer#1",
43+
"method": "askrene-remove-layer",
44+
"params": {
45+
"layer": "test_layers"
46+
}
47+
},
48+
"response": {}
49+
}
3850
]
3951
}

doc/schemas/lightning-askrene-reserve.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,45 @@
5757
],
5858
"resources": [
5959
"Main web site: <https://github.com/ElementsProject/lightning>"
60+
],
61+
"examples": [
62+
{
63+
"request": {
64+
"id": "example:askrene-reserve#1",
65+
"method": "askrene-reserve",
66+
"params": {
67+
"path": [
68+
{
69+
"short_channel_id_dir": "109x1x1/1",
70+
"amount_msat": 1250000
71+
},
72+
{
73+
"short_channel_id_dir": "123x1x1/0",
74+
"amount_msat": 1250001
75+
}
76+
]
77+
}
78+
},
79+
"response": {}
80+
},
81+
{
82+
"request": {
83+
"id": "example:askrene-reserve#2",
84+
"method": "askrene-reserve",
85+
"params": {
86+
"path": [
87+
{
88+
"short_channel_id_dir": "109x1x1/1",
89+
"amount_msat": 1250000000000
90+
},
91+
{
92+
"short_channel_id_dir": "123x1x1/0",
93+
"amount_msat": 1250000000000
94+
}
95+
]
96+
}
97+
},
98+
"response": {}
99+
}
60100
]
61101
}

0 commit comments

Comments
 (0)