lnrpc: make close/open channel into streaming RPC calls

This commit is contained in:
Olaoluwa Osuntokun 2016-07-07 15:23:29 -07:00
parent 4d7bd2eb5d
commit c7f49e19aa
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -12,9 +12,8 @@ service Lightning {
rpc ListPeers(ListPeersRequest) returns (ListPeersResponse); rpc ListPeers(ListPeersRequest) returns (ListPeersResponse);
rpc GetInfo(GetInfoRequest) returns (GetInfoResponse); rpc GetInfo(GetInfoRequest) returns (GetInfoResponse);
rpc OpenChannel(OpenChannelRequest) returns (OpenChannelResponse); rpc OpenChannel(OpenChannelRequest) returns (stream ChannelOpenUpdate);
rpc CloseChannel(CloseChannelRequest) returns (CloseChannelResponse); rpc CloseChannel(CloseChannelRequest) returns (stream ChannelCloseUpdate);
} }
message ChannelPoint { message ChannelPoint {
@ -121,6 +120,35 @@ message GetInfoResponse {
uint32 num_peers = 5; uint32 num_peers = 5;
} }
message ConfirmationUpdate {
bytes block_sha = 1;
int32 block_height = 2;
uint32 num_confs_left = 3;
}
message ChannelOpenUpdate {
ChannelPoint channel_point = 1;
}
message ChannelCloseUpdate {
bytes closing_txid = 1;
bool success = 2;
}
message CloseChannelRequest {
ChannelPoint channel_point = 1;
int64 time_limit = 2;
bool allow_force_close = 3;
}
message CloseStatusUpdate {
oneof update {
ConfirmationUpdate confirmation = 1;
ChannelCloseUpdate chan_close = 2;
}
}
message OpenChannelRequest { message OpenChannelRequest {
int32 target_peer_id = 1; int32 target_peer_id = 1;
LightningAddress target_node = 2; LightningAddress target_node = 2;
@ -132,17 +160,14 @@ message OpenChannelRequest {
uint32 num_confs = 6; uint32 num_confs = 6;
} }
message OpenChannelResponse { message OpenStatusUpdate {
ChannelPoint channel_point = 1; oneof update {
ConfirmationUpdate confirmation = 1;
ChannelOpenUpdate chan_open = 2;
}
} }
message CloseChannelRequest {
ChannelPoint channel_point = 1;
int64 time_limit = 2;
bool allow_force_close = 3;
} }
message CloseChannelResponse {
bool success = 1;
} }
message WalletBalanceRequest { message WalletBalanceRequest {