mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
doc: Lock askrene example values
This commit is contained in:
parent
9592facf83
commit
e568d69867
15 changed files with 946 additions and 1 deletions
|
@ -256,6 +256,22 @@
|
|||
],
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-bias-channel.json": {
|
||||
|
@ -359,6 +375,50 @@
|
|||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-bias-channel#1",
|
||||
"method": "askrene-bias-channel",
|
||||
"params": {
|
||||
"layer": "test_layers",
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"bias": 1
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"biases": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"bias": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-bias-channel#2",
|
||||
"method": "askrene-bias-channel",
|
||||
"params": [
|
||||
"test_layers",
|
||||
"109x1x1/1",
|
||||
-5,
|
||||
"bigger bias"
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"biases": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"description": "bigger bias",
|
||||
"bias": -5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-create-channel.json": {
|
||||
|
@ -431,6 +491,22 @@
|
|||
],
|
||||
"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": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-create-layer.json": {
|
||||
|
@ -680,6 +756,30 @@
|
|||
],
|
||||
"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",
|
||||
"persistent": false,
|
||||
"disabled_nodes": [],
|
||||
"created_channels": [],
|
||||
"channel_updates": [],
|
||||
"constraints": [],
|
||||
"biases": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-disable-node.json": {
|
||||
|
@ -729,6 +829,19 @@
|
|||
],
|
||||
"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": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-inform-channel.json": {
|
||||
|
@ -844,6 +957,30 @@
|
|||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-listlayers.json": {
|
||||
|
@ -1095,6 +1232,119 @@
|
|||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-listlayers#1",
|
||||
"method": "askrene-listlayers",
|
||||
"params": [
|
||||
"test_layers"
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"layers": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"persistent": false,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"biases": [
|
||||
{
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"description": "bigger bias",
|
||||
"bias": -5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-listlayers#2",
|
||||
"method": "askrene-listlayers",
|
||||
"params": {}
|
||||
},
|
||||
"response": {
|
||||
"layers": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"persistent": false,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"biases": [
|
||||
{
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"description": "bigger bias",
|
||||
"bias": -5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"layer": "xpay",
|
||||
"persistent": true,
|
||||
"disabled_nodes": [],
|
||||
"created_channels": [],
|
||||
"channel_updates": [],
|
||||
"constraints": [],
|
||||
"biases": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-listreservations.json": {
|
||||
|
@ -1167,6 +1417,43 @@
|
|||
],
|
||||
"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\""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-remove-layer.json": {
|
||||
|
@ -1206,6 +1493,18 @@
|
|||
],
|
||||
"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": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-reserve.json": {
|
||||
|
@ -1267,6 +1566,46 @@
|
|||
],
|
||||
"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": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-unreserve.json": {
|
||||
|
@ -1328,6 +1667,46 @@
|
|||
],
|
||||
"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": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-askrene-update-channel.json": {
|
||||
|
@ -1410,6 +1789,35 @@
|
|||
],
|
||||
"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": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-autoclean-once.json": {
|
||||
|
@ -15549,6 +15957,46 @@
|
|||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"request": {
|
||||
"id": "example:getroutes#1",
|
||||
"method": "getroutes",
|
||||
"params": {
|
||||
"source": "nodeid010101010101010101010101010101010101010101010101010101010101",
|
||||
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
|
||||
"amount_msat": 1250000,
|
||||
"layers": [],
|
||||
"maxfee_msat": 125000,
|
||||
"final_cltv": 0
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"probability_ppm": 997501,
|
||||
"routes": [
|
||||
{
|
||||
"probability_ppm": 997501,
|
||||
"amount_msat": 1250000,
|
||||
"final_cltv": 0,
|
||||
"path": [
|
||||
{
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"next_node_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
|
||||
"amount_msat": 1250026,
|
||||
"delay": 12
|
||||
},
|
||||
{
|
||||
"short_channel_id_dir": "123x1x1/0",
|
||||
"next_node_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
|
||||
"amount_msat": 1250013,
|
||||
"delay": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"lightning-help.json": {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -99,5 +99,49 @@
|
|||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-bias-channel#1",
|
||||
"method": "askrene-bias-channel",
|
||||
"params": {
|
||||
"layer": "test_layers",
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"bias": 1
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"biases": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"bias": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-bias-channel#2",
|
||||
"method": "askrene-bias-channel",
|
||||
"params": [
|
||||
"test_layers",
|
||||
"109x1x1/1",
|
||||
-5,
|
||||
"bigger bias"
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"biases": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"description": "bigger bias",
|
||||
"bias": -5
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -245,5 +245,29 @@
|
|||
],
|
||||
"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",
|
||||
"persistent": false,
|
||||
"disabled_nodes": [],
|
||||
"created_channels": [],
|
||||
"channel_updates": [],
|
||||
"constraints": [],
|
||||
"biases": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -111,5 +111,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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -247,5 +247,118 @@
|
|||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-listlayers#1",
|
||||
"method": "askrene-listlayers",
|
||||
"params": [
|
||||
"test_layers"
|
||||
]
|
||||
},
|
||||
"response": {
|
||||
"layers": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"persistent": false,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"biases": [
|
||||
{
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"description": "bigger bias",
|
||||
"bias": -5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"request": {
|
||||
"id": "example:askrene-listlayers#2",
|
||||
"method": "askrene-listlayers",
|
||||
"params": {}
|
||||
},
|
||||
"response": {
|
||||
"layers": [
|
||||
{
|
||||
"layer": "test_layers",
|
||||
"persistent": false,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"biases": [
|
||||
{
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"description": "bigger bias",
|
||||
"bias": -5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"layer": "xpay",
|
||||
"persistent": true,
|
||||
"disabled_nodes": [],
|
||||
"created_channels": [],
|
||||
"channel_updates": [],
|
||||
"constraints": [],
|
||||
"biases": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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\""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -78,5 +78,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": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -172,5 +172,45 @@
|
|||
],
|
||||
"resources": [
|
||||
"Main web site: <https://github.com/ElementsProject/lightning>"
|
||||
],
|
||||
"examples": [
|
||||
{
|
||||
"request": {
|
||||
"id": "example:getroutes#1",
|
||||
"method": "getroutes",
|
||||
"params": {
|
||||
"source": "nodeid010101010101010101010101010101010101010101010101010101010101",
|
||||
"destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
|
||||
"amount_msat": 1250000,
|
||||
"layers": [],
|
||||
"maxfee_msat": 125000,
|
||||
"final_cltv": 0
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"probability_ppm": 997501,
|
||||
"routes": [
|
||||
{
|
||||
"probability_ppm": 997501,
|
||||
"amount_msat": 1250000,
|
||||
"final_cltv": 0,
|
||||
"path": [
|
||||
{
|
||||
"short_channel_id_dir": "109x1x1/1",
|
||||
"next_node_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
|
||||
"amount_msat": 1250026,
|
||||
"delay": 12
|
||||
},
|
||||
{
|
||||
"short_channel_id_dir": "123x1x1/0",
|
||||
"next_node_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
|
||||
"amount_msat": 1250013,
|
||||
"delay": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ ALL_RPC_EXAMPLES = {}
|
|||
EXAMPLES_JSON = {}
|
||||
LOG_FILE = './tests/autogenerate-examples-status.log'
|
||||
TEMP_EXAMPLES_FILE = './tests/autogenerate-examples.json'
|
||||
IGNORE_RPCS_LIST = ['dev-splice', 'reckless', 'sql-template', 'askrene-listreservations', 'askrene-remove-layer', 'askrene-create-channel', 'askrene-create-layer', 'askrene-bias-channel', 'askrene-reserve', 'askrene-listlayers', 'askrene-age', 'askrene-inform-channel', 'askrene-update-channel', 'getroutes', 'askrene-disable-node', 'askrene-unreserve']
|
||||
IGNORE_RPCS_LIST = ['dev-splice', 'reckless', 'sql-template']
|
||||
|
||||
# Constants for replacing values in examples
|
||||
NEW_VALUES_LIST = {
|
||||
|
@ -1024,6 +1024,54 @@ def generate_offers_renepay_examples(l1, l2, inv_l21, inv_l34):
|
|||
raise
|
||||
|
||||
|
||||
def generate_askrene_examples(l1, l2, l3, c12, c23_2):
|
||||
"""Generates askrene related examples"""
|
||||
try:
|
||||
logger.info('Askrene Start...')
|
||||
|
||||
def direction(src, dst):
|
||||
if src < dst:
|
||||
return 0
|
||||
return 1
|
||||
|
||||
direction12 = direction(l1.info['id'], l2.info['id'])
|
||||
direction23 = direction(l2.info['id'], l3.info['id'])
|
||||
scid12dir = f'{c12}/{direction12}'
|
||||
scid23dir = f'{c23_2}/{direction23}'
|
||||
update_example(node=l2, method='askrene-create-layer', params={'layer': 'test_layers'})
|
||||
update_example(node=l2, method='askrene-disable-node', params={'layer': 'test_layers', 'node': l1.info['id']})
|
||||
update_example(node=l2, method='askrene-update-channel', params=['test_layers', '0x0x1/0'])
|
||||
update_example(node=l2, method='askrene-create-channel', params={'layer': 'test_layers', 'source': l3.info['id'], 'destination': l1.info['id'], 'short_channel_id': '0x0x1', 'capacity_msat': '1000000sat'})
|
||||
update_example(node=l2, 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})
|
||||
askrene_inform_channel_res1 = update_example(node=l2, method='askrene-inform-channel', params={'layer': 'test_layers', 'short_channel_id_dir': '0x0x1/1', 'amount_msat': 100000, 'inform': 'unconstrained'})
|
||||
update_example(node=l2, method='askrene-bias-channel', params={'layer': 'test_layers', 'short_channel_id_dir': scid12dir, 'bias': 1})
|
||||
update_example(node=l2, method='askrene-bias-channel', params=['test_layers', scid12dir, -5, 'bigger bias'])
|
||||
askrene_listlayers_res1 = update_example(node=l2, method='askrene-listlayers', params=['test_layers'])
|
||||
update_example(node=l2, method='askrene-listlayers', params={})
|
||||
ts1 = only_one(only_one(askrene_listlayers_res1['layers'])['constraints'])['timestamp']
|
||||
update_example(node=l2, method='askrene-age', params={'layer': 'test_layers', 'cutoff': ts1 + 1})
|
||||
update_example(node=l2, method='askrene-remove-layer', params={'layer': 'test_layers'})
|
||||
update_example(node=l1, method='getroutes', params={'source': l1.info['id'], 'destination': l3.info['id'], 'amount_msat': 1250000, 'layers': [], 'maxfee_msat': 125000, 'final_cltv': 0})
|
||||
update_example(node=l1, method='askrene-reserve', params={'path': [{'short_channel_id_dir': scid12dir, 'amount_msat': 1250_000}, {'short_channel_id_dir': scid23dir, 'amount_msat': 1250_001}]})
|
||||
update_example(node=l1, method='askrene-reserve', params={'path': [{'short_channel_id_dir': scid12dir, 'amount_msat': 1250_000_000_000}, {'short_channel_id_dir': scid23dir, 'amount_msat': 1250_000_000_000}]})
|
||||
time.sleep(2)
|
||||
askrene_listreservations_res1 = l1.rpc.askrene_listreservations()
|
||||
askrene_listreservations_res1 = update_list_responses(askrene_listreservations_res1, list_key='reservations', slice_upto=5, update_func=lambda x, i: REPLACE_RESPONSE_VALUES.extend([{'data_keys': ['command_id'], 'original_value': x['command_id'], 'new_value': f'\"-c:askrene-reserve#6{(i + 1) * 2}/cln:askrene-reserve#12{(i + 1) * 2}\"'}]), sort=True, sort_key='amount_msat')
|
||||
update_example(node=l1, method='askrene-listreservations', params={}, response=askrene_listreservations_res1)
|
||||
update_example(node=l1, method='askrene-unreserve', params={'path': [{'short_channel_id_dir': scid12dir, 'amount_msat': 1250_000}, {'short_channel_id_dir': scid23dir, 'amount_msat': 1250_001}]})
|
||||
update_example(node=l1, method='askrene-unreserve', params={'path': [{'short_channel_id_dir': scid12dir, 'amount_msat': 1250_000_000_000}, {'short_channel_id_dir': scid23dir, 'amount_msat': 1250_000_000_000}]})
|
||||
REPLACE_RESPONSE_VALUES.extend([
|
||||
{'data_keys': ['any', 'short_channel_id_dir'], 'original_value': scid12dir, 'new_value': f"{NEW_VALUES_LIST['c12']}/{direction12}"},
|
||||
{'data_keys': ['short_channel_id_dir'], 'original_value': scid23dir, 'new_value': f"{NEW_VALUES_LIST['c23_2']}/{direction23}"},
|
||||
{'data_keys': ['cutoff'], 'original_value': ts1 + 1, 'new_value': NEW_VALUES_LIST['time_at_800']},
|
||||
{'data_keys': ['timestamp'], 'original_value': askrene_inform_channel_res1['constraints'][0]['timestamp'], 'new_value': NEW_VALUES_LIST['time_at_800']},
|
||||
])
|
||||
logger.info('Askrene Done!')
|
||||
except Exception as e:
|
||||
logger.error(f'Error in generating askrene examples: {e}')
|
||||
raise
|
||||
|
||||
|
||||
def generate_wait_examples(l1, l2, bitcoind, executor):
|
||||
"""Generates wait examples"""
|
||||
try:
|
||||
|
@ -2043,6 +2091,7 @@ def test_generate_examples(node_factory, bitcoind, executor):
|
|||
generate_datastore_examples(l2)
|
||||
generate_bookkeeper_examples(l2, l3, c23res2['channel_id'])
|
||||
offer_l23, inv_req_l1_l22 = generate_offers_renepay_examples(l1, l2, inv_l21, inv_l34)
|
||||
generate_askrene_examples(l1, l2, l3, c12, c23_2)
|
||||
generate_wait_examples(l1, l2, bitcoind, executor)
|
||||
address_l22 = generate_utils_examples(l1, l2, l3, l4, l5, l6, c23_2, c34_2, inv_l11, inv_l22, rune_l21, bitcoind)
|
||||
generate_splice_examples(node_factory, bitcoind)
|
||||
|
|
Loading…
Add table
Reference in a new issue