Skip to content

Commit

Permalink
doc: Askrene examples
Browse files Browse the repository at this point in the history
Changelog-Added: Generating askrene examples by test script
  • Loading branch information
ShahanaFarooqui committed Oct 22, 2024
1 parent e70eeec commit 8fca5d9
Show file tree
Hide file tree
Showing 14 changed files with 781 additions and 3 deletions.
367 changes: 366 additions & 1 deletion contrib/msggen/msggen/schema.json

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions doc/schemas/lightning-askrene-age.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,21 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-age#1",
"method": "askrene-age",
"params": {
"layer": "test_layers",
"cutoff": 1738000000
}
},
"response": {
"layer": "test_layers",
"num_removed": 1
}
}
]
}
16 changes: 16 additions & 0 deletions doc/schemas/lightning-askrene-create-channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,21 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-create-channel#1",
"method": "askrene-create-channel",
"params": {
"layer": "test_layers",
"source": "nodeid030303030303030303030303030303030303030303030303030303030303",
"destination": "nodeid010101010101010101010101010101010101010101010101010101010101",
"short_channel_id": "0x0x1",
"capacity_msat": "1000000sat"
}
},
"response": {}
}
]
}
22 changes: 22 additions & 0 deletions doc/schemas/lightning-askrene-create-layer.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,27 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-create-layer#1",
"method": "askrene-create-layer",
"params": {
"layer": "test_layers"
}
},
"response": {
"layers": [
{
"layer": "test_layers",
"disabled_nodes": [],
"created_channels": [],
"channel_updates": [],
"constraints": []
}
]
}
}
]
}
13 changes: 13 additions & 0 deletions doc/schemas/lightning-askrene-disable-node.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,18 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-disable-node#1",
"method": "askrene-disable-node",
"params": {
"layer": "test_layers",
"node": "nodeid010101010101010101010101010101010101010101010101010101010101"
}
},
"response": {}
}
]
}
24 changes: 24 additions & 0 deletions doc/schemas/lightning-askrene-inform-channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,29 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-inform-channel#1",
"method": "askrene-inform-channel",
"params": {
"layer": "test_layers",
"short_channel_id_dir": "0x0x1/1",
"amount_msat": 100000,
"inform": "unconstrained"
}
},
"response": {
"constraints": [
{
"layer": "test_layers",
"short_channel_id_dir": "0x0x1/1",
"timestamp": 1738000000,
"minimum_msat": 100000
}
]
}
}
]
}
78 changes: 77 additions & 1 deletion doc/schemas/lightning-askrene-listlayers.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,86 @@
"request": {
"id": "example:askrene-listlayers#1",
"method": "askrene-listlayers",
"params": [
"test_layers"
]
},
"response": {
"layers": [
{
"layer": "test_layers",
"disabled_nodes": [
"nodeid010101010101010101010101010101010101010101010101010101010101"
],
"created_channels": [
{
"source": "nodeid010101010101010101010101010101010101010101010101010101010101",
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
"short_channel_id": "0x0x1",
"capacity_msat": 1000000000
}
],
"channel_updates": [
{
"short_channel_id_dir": "0x0x1/0",
"htlc_minimum_msat": 100,
"htlc_maximum_msat": 900000000,
"fee_base_msat": 1,
"fee_proportional_millionths": 2,
"cltv_expiry_delta": 18
}
],
"constraints": [
{
"short_channel_id_dir": "0x0x1/1",
"timestamp": 1738000000,
"minimum_msat": 100000
}
]
}
]
}
},
{
"request": {
"id": "example:askrene-listlayers#2",
"method": "askrene-listlayers",
"params": {}
},
"response": {
"layers": []
"layers": [
{
"layer": "test_layers",
"disabled_nodes": [
"nodeid010101010101010101010101010101010101010101010101010101010101"
],
"created_channels": [
{
"source": "nodeid010101010101010101010101010101010101010101010101010101010101",
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
"short_channel_id": "0x0x1",
"capacity_msat": 1000000000
}
],
"channel_updates": [
{
"short_channel_id_dir": "0x0x1/0",
"htlc_minimum_msat": 100,
"htlc_maximum_msat": 900000000,
"fee_base_msat": 1,
"fee_proportional_millionths": 2,
"cltv_expiry_delta": 18
}
],
"constraints": [
{
"short_channel_id_dir": "0x0x1/1",
"timestamp": 1738000000,
"minimum_msat": 100000
}
]
}
]
}
}
]
Expand Down
37 changes: 37 additions & 0 deletions doc/schemas/lightning-askrene-listreservations.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,42 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-listreservations#1",
"method": "askrene-listreservations",
"params": {}
},
"response": {
"reservations": [
{
"short_channel_id_dir": "109x1x1/1",
"amount_msat": 1250000,
"age_in_seconds": 2,
"command_id": "\"-c:askrene-reserve#62/cln:askrene-reserve#122\""
},
{
"short_channel_id_dir": "123x1x1/0",
"amount_msat": 1250001,
"age_in_seconds": 2,
"command_id": "\"-c:askrene-reserve#62/cln:askrene-reserve#122\""
},
{
"short_channel_id_dir": "109x1x1/1",
"amount_msat": 1250000000000,
"age_in_seconds": 2,
"command_id": "\"-c:askrene-reserve#66/cln:askrene-reserve#126\""
},
{
"short_channel_id_dir": "123x1x1/0",
"amount_msat": 1250000000000,
"age_in_seconds": 2,
"command_id": "\"-c:askrene-reserve#66/cln:askrene-reserve#126\""
}
]
}
}
]
}
12 changes: 12 additions & 0 deletions doc/schemas/lightning-askrene-remove-layer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,17 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-remove-layer#1",
"method": "askrene-remove-layer",
"params": {
"layer": "test_layers"
}
},
"response": {}
}
]
}
40 changes: 40 additions & 0 deletions doc/schemas/lightning-askrene-reserve.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,45 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-reserve#1",
"method": "askrene-reserve",
"params": {
"path": [
{
"short_channel_id_dir": "109x1x1/1",
"amount_msat": 1250000
},
{
"short_channel_id_dir": "123x1x1/0",
"amount_msat": 1250001
}
]
}
},
"response": {}
},
{
"request": {
"id": "example:askrene-reserve#2",
"method": "askrene-reserve",
"params": {
"path": [
{
"short_channel_id_dir": "109x1x1/1",
"amount_msat": 1250000000000
},
{
"short_channel_id_dir": "123x1x1/0",
"amount_msat": 1250000000000
}
]
}
},
"response": {}
}
]
}
40 changes: 40 additions & 0 deletions doc/schemas/lightning-askrene-unreserve.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,45 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-unreserve#1",
"method": "askrene-unreserve",
"params": {
"path": [
{
"short_channel_id_dir": "109x1x1/1",
"amount_msat": 1250000
},
{
"short_channel_id_dir": "123x1x1/0",
"amount_msat": 1250001
}
]
}
},
"response": {}
},
{
"request": {
"id": "example:askrene-unreserve#2",
"method": "askrene-unreserve",
"params": {
"path": [
{
"short_channel_id_dir": "109x1x1/1",
"amount_msat": 1250000000000
},
{
"short_channel_id_dir": "123x1x1/0",
"amount_msat": 1250000000000
}
]
}
},
"response": {}
}
]
}
29 changes: 29 additions & 0 deletions doc/schemas/lightning-askrene-update-channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,34 @@
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:askrene-update-channel#1",
"method": "askrene-update-channel",
"params": [
"test_layers",
"0x0x1/0"
]
},
"response": {}
},
{
"request": {
"id": "example:askrene-update-channel#2",
"method": "askrene-update-channel",
"params": {
"layer": "test_layers",
"short_channel_id_dir": "0x0x1/0",
"htlc_minimum_msat": 100,
"htlc_maximum_msat": 900000000,
"fee_base_msat": 1,
"fee_proportional_millionths": 2,
"cltv_expiry_delta": 18
}
},
"response": {}
}
]
}
Loading

0 comments on commit 8fca5d9

Please sign in to comment.