lnrpc: remote Listen/Chat, re-compile proto file

This commit is contained in:
Olaoluwa Osuntokun 2016-01-16 19:03:47 -08:00
parent 4c8b10617a
commit 4366b1b114
2 changed files with 50 additions and 164 deletions

@ -13,12 +13,8 @@ It has these top-level messages:
SendManyResponse
NewAddressRequest
NewAddressResponse
TCPListenRequest
TCPListenResponse
LNConnectRequest
LnConnectResponse
LnChatRequest
LnChatResponse
ConnectPeerRequest
ConnectPeerResponse
*/
package lnrpc
@ -78,70 +74,31 @@ func (m *NewAddressResponse) String() string { return proto.CompactTe
func (*NewAddressResponse) ProtoMessage() {}
func (*NewAddressResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
type TCPListenRequest struct {
Hostport string `protobuf:"bytes,1,opt,name=hostport" json:"hostport,omitempty"`
}
func (m *TCPListenRequest) Reset() { *m = TCPListenRequest{} }
func (m *TCPListenRequest) String() string { return proto.CompactTextString(m) }
func (*TCPListenRequest) ProtoMessage() {}
func (*TCPListenRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
type TCPListenResponse struct {
}
func (m *TCPListenResponse) Reset() { *m = TCPListenResponse{} }
func (m *TCPListenResponse) String() string { return proto.CompactTextString(m) }
func (*TCPListenResponse) ProtoMessage() {}
func (*TCPListenResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
type LNConnectRequest struct {
type ConnectPeerRequest struct {
IdAtHost string `protobuf:"bytes,1,opt,name=idAtHost" json:"idAtHost,omitempty"`
}
func (m *LNConnectRequest) Reset() { *m = LNConnectRequest{} }
func (m *LNConnectRequest) String() string { return proto.CompactTextString(m) }
func (*LNConnectRequest) ProtoMessage() {}
func (*LNConnectRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *ConnectPeerRequest) Reset() { *m = ConnectPeerRequest{} }
func (m *ConnectPeerRequest) String() string { return proto.CompactTextString(m) }
func (*ConnectPeerRequest) ProtoMessage() {}
func (*ConnectPeerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
type LnConnectResponse struct {
type ConnectPeerResponse struct {
LnID []byte `protobuf:"bytes,1,opt,name=lnID,proto3" json:"lnID,omitempty"`
}
func (m *LnConnectResponse) Reset() { *m = LnConnectResponse{} }
func (m *LnConnectResponse) String() string { return proto.CompactTextString(m) }
func (*LnConnectResponse) ProtoMessage() {}
func (*LnConnectResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
type LnChatRequest struct {
DestID []byte `protobuf:"bytes,1,opt,name=destID,proto3" json:"destID,omitempty"`
Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"`
}
func (m *LnChatRequest) Reset() { *m = LnChatRequest{} }
func (m *LnChatRequest) String() string { return proto.CompactTextString(m) }
func (*LnChatRequest) ProtoMessage() {}
func (*LnChatRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
type LnChatResponse struct {
}
func (m *LnChatResponse) Reset() { *m = LnChatResponse{} }
func (m *LnChatResponse) String() string { return proto.CompactTextString(m) }
func (*LnChatResponse) ProtoMessage() {}
func (*LnChatResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
func (m *ConnectPeerResponse) Reset() { *m = ConnectPeerResponse{} }
func (m *ConnectPeerResponse) String() string { return proto.CompactTextString(m) }
func (*ConnectPeerResponse) ProtoMessage() {}
func (*ConnectPeerResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func init() {
proto.RegisterType((*SendManyRequest)(nil), "lnrpc.SendManyRequest")
proto.RegisterType((*SendManyResponse)(nil), "lnrpc.SendManyResponse")
proto.RegisterType((*NewAddressRequest)(nil), "lnrpc.NewAddressRequest")
proto.RegisterType((*NewAddressResponse)(nil), "lnrpc.NewAddressResponse")
proto.RegisterType((*TCPListenRequest)(nil), "lnrpc.TCPListenRequest")
proto.RegisterType((*TCPListenResponse)(nil), "lnrpc.TCPListenResponse")
proto.RegisterType((*LNConnectRequest)(nil), "lnrpc.LNConnectRequest")
proto.RegisterType((*LnConnectResponse)(nil), "lnrpc.LnConnectResponse")
proto.RegisterType((*LnChatRequest)(nil), "lnrpc.LnChatRequest")
proto.RegisterType((*LnChatResponse)(nil), "lnrpc.LnChatResponse")
proto.RegisterType((*ConnectPeerRequest)(nil), "lnrpc.ConnectPeerRequest")
proto.RegisterType((*ConnectPeerResponse)(nil), "lnrpc.ConnectPeerResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
@ -153,9 +110,7 @@ var _ grpc.ClientConn
type LightningClient interface {
SendMany(ctx context.Context, in *SendManyRequest, opts ...grpc.CallOption) (*SendManyResponse, error)
NewAddress(ctx context.Context, in *NewAddressRequest, opts ...grpc.CallOption) (*NewAddressResponse, error)
TCPListen(ctx context.Context, in *TCPListenRequest, opts ...grpc.CallOption) (*TCPListenResponse, error)
LNConnect(ctx context.Context, in *LNConnectRequest, opts ...grpc.CallOption) (*LnConnectResponse, error)
LNChat(ctx context.Context, in *LnChatRequest, opts ...grpc.CallOption) (*LnChatResponse, error)
ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error)
}
type lightningClient struct {
@ -184,27 +139,9 @@ func (c *lightningClient) NewAddress(ctx context.Context, in *NewAddressRequest,
return out, nil
}
func (c *lightningClient) TCPListen(ctx context.Context, in *TCPListenRequest, opts ...grpc.CallOption) (*TCPListenResponse, error) {
out := new(TCPListenResponse)
err := grpc.Invoke(ctx, "/lnrpc.Lightning/TCPListen", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lightningClient) LNConnect(ctx context.Context, in *LNConnectRequest, opts ...grpc.CallOption) (*LnConnectResponse, error) {
out := new(LnConnectResponse)
err := grpc.Invoke(ctx, "/lnrpc.Lightning/LNConnect", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lightningClient) LNChat(ctx context.Context, in *LnChatRequest, opts ...grpc.CallOption) (*LnChatResponse, error) {
out := new(LnChatResponse)
err := grpc.Invoke(ctx, "/lnrpc.Lightning/LNChat", in, out, c.cc, opts...)
func (c *lightningClient) ConnectPeer(ctx context.Context, in *ConnectPeerRequest, opts ...grpc.CallOption) (*ConnectPeerResponse, error) {
out := new(ConnectPeerResponse)
err := grpc.Invoke(ctx, "/lnrpc.Lightning/ConnectPeer", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
@ -216,9 +153,7 @@ func (c *lightningClient) LNChat(ctx context.Context, in *LnChatRequest, opts ..
type LightningServer interface {
SendMany(context.Context, *SendManyRequest) (*SendManyResponse, error)
NewAddress(context.Context, *NewAddressRequest) (*NewAddressResponse, error)
TCPListen(context.Context, *TCPListenRequest) (*TCPListenResponse, error)
LNConnect(context.Context, *LNConnectRequest) (*LnConnectResponse, error)
LNChat(context.Context, *LnChatRequest) (*LnChatResponse, error)
ConnectPeer(context.Context, *ConnectPeerRequest) (*ConnectPeerResponse, error)
}
func RegisterLightningServer(s *grpc.Server, srv LightningServer) {
@ -249,36 +184,12 @@ func _Lightning_NewAddress_Handler(srv interface{}, ctx context.Context, dec fun
return out, nil
}
func _Lightning_TCPListen_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(TCPListenRequest)
func _Lightning_ConnectPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(ConnectPeerRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(LightningServer).TCPListen(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Lightning_LNConnect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(LNConnectRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(LightningServer).LNConnect(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Lightning_LNChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(LnChatRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(LightningServer).LNChat(ctx, in)
out, err := srv.(LightningServer).ConnectPeer(ctx, in)
if err != nil {
return nil, err
}
@ -298,45 +209,32 @@ var _Lightning_serviceDesc = grpc.ServiceDesc{
Handler: _Lightning_NewAddress_Handler,
},
{
MethodName: "TCPListen",
Handler: _Lightning_TCPListen_Handler,
},
{
MethodName: "LNConnect",
Handler: _Lightning_LNConnect_Handler,
},
{
MethodName: "LNChat",
Handler: _Lightning_LNChat_Handler,
MethodName: "ConnectPeer",
Handler: _Lightning_ConnectPeer_Handler,
},
},
Streams: []grpc.StreamDesc{},
}
var fileDescriptor0 = []byte{
// 376 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x92, 0xdd, 0x4e, 0xf2, 0x30,
0x18, 0xc7, 0x33, 0x78, 0xe1, 0x65, 0x0f, 0x5f, 0xa3, 0x7e, 0xcd, 0x1d, 0xe1, 0xa2, 0x09, 0x07,
0x66, 0x07, 0x10, 0x13, 0xa3, 0x09, 0xc9, 0x82, 0x26, 0x9a, 0x4c, 0x62, 0x94, 0x1b, 0x98, 0xac,
0x81, 0x45, 0x68, 0xe7, 0x5a, 0x54, 0x6e, 0xc0, 0x0b, 0xf3, 0xca, 0x2c, 0xfb, 0xea, 0xb2, 0x71,
0xb4, 0xf4, 0xe9, 0xff, 0xf7, 0x6f, 0xf7, 0xdb, 0x40, 0x0d, 0x83, 0xb9, 0x15, 0x84, 0x94, 0x53,
0x54, 0x5b, 0x11, 0xb1, 0x30, 0x7f, 0x14, 0xe8, 0xbe, 0x62, 0xe2, 0x3d, 0xb9, 0x64, 0xfb, 0x82,
0x3f, 0x36, 0x98, 0x71, 0x34, 0x86, 0x96, 0xed, 0x79, 0xe1, 0x8c, 0xda, 0x6b, 0xba, 0x21, 0x5c,
0x57, 0xfa, 0xd5, 0x41, 0x73, 0x38, 0xb0, 0x22, 0xc2, 0x2a, 0xa4, 0xad, 0x7c, 0xf4, 0x9e, 0xf0,
0x70, 0x6b, 0x8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 0x74, 0xcf, 0x4e, 0x52, 0x31,
0x06, 0x35, 0x73, 0x85, 0xd2, 0x83, 0x8a, 0x8e, 0x0d, 0xbd, 0xbc, 0x21, 0xf9, 0x4c, 0x6b, 0xc6,
0x17, 0x45, 0x67, 0x7c, 0xd9, 0xed, 0x15, 0xd4, 0x45, 0x5a, 0xf8, 0x41, 0x87, 0x32, 0x23, 0xe5,
0x1a, 0x47, 0x85, 0x69, 0x8c, 0xbd, 0xd5, 0xa3, 0xbf, 0x7f, 0xf4, 0x17, 0x00, 0x00, 0xff, 0xff,
0x77, 0x98, 0x74, 0x61, 0x0a, 0x03, 0x00, 0x00,
// 297 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x92, 0xd1, 0x4e, 0xb3, 0x40,
0x10, 0x85, 0x43, 0xfb, 0xf7, 0xb7, 0x1d, 0x30, 0x6d, 0xb7, 0x89, 0x22, 0x57, 0x0d, 0x46, 0xc3,
0x15, 0x17, 0xed, 0x8d, 0xd1, 0xc4, 0x84, 0x58, 0x13, 0x4d, 0xd4, 0x18, 0xf5, 0x05, 0xb0, 0x4c,
0x2a, 0x11, 0x67, 0x91, 0x5d, 0x54, 0x5e, 0xc0, 0xf7, 0xf3, 0x8d, 0x44, 0x58, 0x02, 0x0a, 0x97,
0x73, 0xe6, 0x3b, 0x87, 0x33, 0x64, 0x61, 0x94, 0xc4, 0x6b, 0x37, 0x4e, 0xb8, 0xe4, 0x6c, 0x10,
0x51, 0x3e, 0xd8, 0x9f, 0x1a, 0x8c, 0xef, 0x91, 0x82, 0x6b, 0x9f, 0xb2, 0x3b, 0x7c, 0x4d, 0x51,
0x48, 0x76, 0x0a, 0x86, 0x17, 0x04, 0xc9, 0x03, 0xf7, 0x5e, 0x78, 0x4a, 0xd2, 0xd4, 0xe6, 0x7d,
0x47, 0x5f, 0x38, 0x6e, 0xe1, 0x70, 0xff, 0xd0, 0x6e, 0x13, 0x3d, 0x27, 0x99, 0x64, 0xd6, 0x12,
0xa6, 0x2d, 0x91, 0xe9, 0xd0, 0x7f, 0xc6, 0x2c, 0xcf, 0xd2, 0x9c, 0x11, 0xdb, 0x86, 0xc1, 0x9b,
0x1f, 0xa5, 0x68, 0xf6, 0xf2, 0xb1, 0x7f, 0xdc, 0x3b, 0xd2, 0xec, 0x39, 0x4c, 0xea, 0x64, 0x11,
0x73, 0x12, 0xc8, 0x0c, 0xf8, 0x27, 0x3f, 0xc2, 0xa0, 0x34, 0xd9, 0x33, 0x98, 0xde, 0xe0, 0xfb,
0x4f, 0x32, 0x0a, 0xa1, 0xbe, 0x6e, 0x1f, 0x00, 0x6b, 0x8a, 0xca, 0x38, 0x86, 0x2d, 0xbf, 0x94,
0x94, 0xf7, 0x10, 0xd8, 0x19, 0x27, 0xc2, 0xb5, 0xbc, 0x45, 0x4c, 0xaa, 0x43, 0x27, 0x30, 0x0c,
0x03, 0x4f, 0x5e, 0x70, 0x21, 0x15, 0xb7, 0x0f, 0xb3, 0x5f, 0x5c, 0x5d, 0x24, 0xa2, 0xcb, 0x55,
0x01, 0x19, 0x8b, 0x2f, 0x0d, 0x46, 0x57, 0xe1, 0xe6, 0x49, 0x52, 0x48, 0x1b, 0x76, 0x02, 0xc3,
0xaa, 0x38, 0xdb, 0xe9, 0xfe, 0x47, 0xd6, 0x6e, 0x4b, 0x57, 0xc1, 0x1e, 0x40, 0x5d, 0x9f, 0x99,
0x0a, 0x6b, 0x9d, 0x69, 0xed, 0x75, 0x6c, 0x54, 0xc4, 0x0a, 0xf4, 0x46, 0x65, 0x56, 0x91, 0xed,
0x73, 0x2d, 0xab, 0x6b, 0x55, 0xa6, 0x3c, 0xfe, 0x2f, 0x5e, 0xc5, 0xf2, 0x3b, 0x00, 0x00, 0xff,
0xff, 0x15, 0x2e, 0xcf, 0x06, 0x22, 0x02, 0x00, 0x00,
}

@ -6,39 +6,27 @@ service Lightning {
rpc SendMany(SendManyRequest) returns (SendManyResponse);
rpc NewAddress(NewAddressRequest) returns (NewAddressResponse);
rpc TCPListen(TCPListenRequest) returns (TCPListenResponse);
rpc LNConnect(LNConnectRequest) returns (LnConnectResponse);
rpc LNChat(LnChatRequest) returns (LnChatResponse);
rpc ConnectPeer(ConnectPeerRequest) returns (ConnectPeerResponse);
}
message SendManyRequest {
map<string, int64> AddrToAmount = 1;
}
message SendManyResponse {
string txid = 1;
}
message NewAddressRequest {}
message NewAddressResponse {
string address = 1;
}
message TCPListenRequest {
string hostport = 1;
}
message TCPListenResponse{}
message LNConnectRequest {
message ConnectPeerRequest {
string idAtHost = 1;
}
message LnConnectResponse {
message ConnectPeerResponse {
bytes lnID = 1;
}
message LnChatRequest {
bytes destID = 1;
string msg = 2;
}
message LnChatResponse{}