Skip to content

Commit bbf8529

Browse files
committed
lightningd: add networkevents to wait API.
Changelog-Added: JSON-RPC: `wait` now has `networkevents` subsystem. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 45c3f2e commit bbf8529

File tree

10 files changed

+696
-443
lines changed

10 files changed

+696
-443
lines changed

.msggen.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,12 @@
542542
"paid": 1,
543543
"unpaid": 0
544544
},
545+
"WaitNetworkeventsType": {
546+
"connect": 0,
547+
"connect_fail": 1,
548+
"disconnect": 3,
549+
"ping": 2
550+
},
545551
"WaitSendpaysStatus": {
546552
"complete": 2,
547553
"failed": 1,
@@ -553,6 +559,7 @@
553559
"forwards": 1,
554560
"htlcs": 3,
555561
"invoices": 0,
562+
"networkevents": 6,
556563
"sendpays": 2
557564
},
558565
"WaitanyinvoiceStatus": {
@@ -3764,6 +3771,11 @@
37643771
"Wait.invoices.label": 2,
37653772
"Wait.invoices.status": 1
37663773
},
3774+
"WaitNetworkevents": {
3775+
"Wait.networkevents.created_index": 1,
3776+
"Wait.networkevents.peer_id": 3,
3777+
"Wait.networkevents.type": 2
3778+
},
37673779
"WaitRequest": {
37683780
"Wait.indexname": 2,
37693781
"Wait.nextvalue": 3,
@@ -3778,6 +3790,7 @@
37783790
"Wait.forwards": 6,
37793791
"Wait.htlcs": 9,
37803792
"Wait.invoices": 7,
3793+
"Wait.networkevents": 12,
37813794
"Wait.sendpays": 8,
37823795
"Wait.subsystem": 1,
37833796
"Wait.updated": 3
@@ -13082,6 +13095,22 @@
1308213095
"added": "v25.05",
1308313096
"deprecated": null
1308413097
},
13098+
"Wait.networkevents": {
13099+
"added": "v25.12",
13100+
"deprecated": null
13101+
},
13102+
"Wait.networkevents.created_index": {
13103+
"added": "v25.12",
13104+
"deprecated": null
13105+
},
13106+
"Wait.networkevents.peer_id": {
13107+
"added": "v25.12",
13108+
"deprecated": null
13109+
},
13110+
"Wait.networkevents.type": {
13111+
"added": "v25.12",
13112+
"deprecated": null
13113+
},
1308513114
"Wait.nextvalue": {
1308613115
"added": "pre-v0.10.1",
1308713116
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/convert.rs

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-rpc/src/model.rs

Lines changed: 59 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/msggen/msggen/schema.json

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36796,15 +36796,17 @@
3679636796
" `forwards`: corresponding to `listforwards` (added in *v23.11*).",
3679736797
" `htlcs`: corresponding to `listhtlcs` (added in *v25.05*).",
3679836798
" `chainmoves`: corresponding to `listchainmoves` (added in *v25.09*).",
36799-
" `channelmoves`: corresponding to `listchannelmoves` (added in *v25.09*)."
36799+
" `channelmoves`: corresponding to `listchannelmoves` (added in *v25.09*).",
36800+
" `networkevents`: corresponding to `listnetworkevents` (added in *v25.12*)."
3680036801
],
3680136802
"enum": [
3680236803
"invoices",
3680336804
"forwards",
3680436805
"sendpays",
3680536806
"htlcs",
3680636807
"chainmoves",
36807-
"channelmoves"
36808+
"channelmoves",
36809+
"networkevents"
3680836810
]
3680936811
},
3681036812
"indexname": {
@@ -36843,7 +36845,8 @@
3684336845
"sendpays",
3684436846
"htlcs",
3684536847
"chainmoves",
36846-
"channelmoves"
36848+
"channelmoves",
36849+
"networkevents"
3684736850
]
3684836851
},
3684936852
"created": {
@@ -36870,6 +36873,7 @@
3687036873
"htlcs": {},
3687136874
"chainmoves": {},
3687236875
"channelmoves": {},
36876+
"networkevents": {},
3687336877
"details": {}
3687436878
},
3687536879
"allOf": [
@@ -37419,6 +37423,62 @@
3741937423
}
3742037424
}
3742137425
}
37426+
},
37427+
{
37428+
"if": {
37429+
"additionalProperties": true,
37430+
"properties": {
37431+
"subsystem": {
37432+
"type": "string",
37433+
"enum": [
37434+
"networkevents"
37435+
]
37436+
}
37437+
}
37438+
},
37439+
"then": {
37440+
"additionalProperties": false,
37441+
"properties": {
37442+
"subsystem": {},
37443+
"created": {},
37444+
"updated": {},
37445+
"deleted": {},
37446+
"networkevents": {
37447+
"added": "v25.12",
37448+
"type": "object",
37449+
"additionalProperties": false,
37450+
"properties": {
37451+
"created_index": {
37452+
"added": "v25.12",
37453+
"type": "u64",
37454+
"description": [
37455+
"The created_index of the record added/deleted"
37456+
]
37457+
},
37458+
"type": {
37459+
"added": "v25.12",
37460+
"type": "string",
37461+
"enum": [
37462+
"connect",
37463+
"connect_fail",
37464+
"ping",
37465+
"disconnect"
37466+
],
37467+
"description": [
37468+
"The kind of network event"
37469+
]
37470+
},
37471+
"peer_id": {
37472+
"added": "v25.12",
37473+
"type": "pubkey",
37474+
"description": [
37475+
"The peer this network event was with"
37476+
]
37477+
}
37478+
}
37479+
}
37480+
}
37481+
}
3742237482
}
3742337483
]
3742437484
},

contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Lines changed: 434 additions & 430 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/pyln-testing/pyln/testing/grpc2py.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,14 @@ def wait_invoices2py(m):
21622162
})
21632163

21642164

2165+
def wait_networkevents2py(m):
2166+
return remove_default({
2167+
"type": str(m.item_type), # EnumField in generate_composite
2168+
"created_index": m.created_index, # PrimitiveField in generate_composite
2169+
"peer_id": hexlify(m.peer_id), # PrimitiveField in generate_composite
2170+
})
2171+
2172+
21652173
def wait_sendpays2py(m):
21662174
return remove_default({
21672175
"status": str(m.status), # EnumField in generate_composite

0 commit comments

Comments
 (0)