lnrpc: Add subscribe peer events rpc
This commit is contained in:
4 files changed
+958
-678
No files matched your search
+858
-678
File diff suppressed because it is too large.
Load diff
@@ -359,6 +359,13 @@ service Lightning {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
SubscribePeerEvents creates a uni-directional stream from the server to
|
||||
the client in which any events relevant to the state of peers are sent
|
||||
over. Events include peers going online and offline.
|
||||
*/
|
||||
rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent);
|
||||
|
||||
/** lncli: `getinfo`
|
||||
GetInfo returns general information concerning the lightning node including
|
||||
it's identity pubkey, alias, the chains it is connected to, and information
|
||||
@@ -1461,6 +1468,21 @@ message ListPeersResponse {
|
||||
repeated Peer peers = 1 [json_name = "peers"];
|
||||
}
|
||||
|
||||
message PeerEventSubscription {
|
||||
}
|
||||
|
||||
message PeerEvent {
|
||||
/// The identity pubkey of the peer.
|
||||
string pub_key = 1 [json_name = "pub_key"];
|
||||
|
||||
enum EventType {
|
||||
PEER_ONLINE = 0;
|
||||
PEER_OFFLINE = 1;
|
||||
}
|
||||
|
||||
EventType type = 2 [ json_name = "type" ];
|
||||
}
|
||||
|
||||
message GetInfoRequest {
|
||||
}
|
||||
message GetInfoResponse {
|
||||
|
||||
@@ -1454,6 +1454,14 @@
|
||||
],
|
||||
"default": "UNKNOWN"
|
||||
},
|
||||
"PeerEventEventType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PEER_ONLINE",
|
||||
"PEER_OFFLINE"
|
||||
],
|
||||
"default": "PEER_ONLINE"
|
||||
},
|
||||
"PeerSyncType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -3443,6 +3451,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"lnrpcPeerEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pub_key": {
|
||||
"type": "string",
|
||||
"description": "/ The identity pubkey of the peer."
|
||||
},
|
||||
"type": {
|
||||
"$ref": "#/definitions/PeerEventEventType"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lnrpcPendingChannelsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -4160,6 +4180,18 @@
|
||||
},
|
||||
"title": "Stream result of lnrpcOpenStatusUpdate"
|
||||
},
|
||||
"lnrpcPeerEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"result": {
|
||||
"$ref": "#/definitions/lnrpcPeerEvent"
|
||||
},
|
||||
"error": {
|
||||
"$ref": "#/definitions/runtimeStreamError"
|
||||
}
|
||||
},
|
||||
"title": "Stream result of lnrpcPeerEvent"
|
||||
},
|
||||
"lnrpcSendResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in new issue
Block a user