From b5f07ede46a71e0deb9f182a7dfa2814dea8c3b7 Mon Sep 17 00:00:00 2001 From: BitfuryLightning Date: Sat, 20 Aug 2016 16:49:35 -0400 Subject: [PATCH 1/3] lncli: Make output of lncli sane and readable LIGHT-133, LIGHT-138 Make output of `lncli showrouting table` in two different formats: table and json. Instead of sending serialized routing table send list of channels. --- cmd/lncli/commands.go | 128 ++++++++++++++++++++++- lnrpc/rpc.pb.go | 221 ++++++++++++++++++++++----------------- lnrpc/rpc.proto | 10 +- lnwire/neighbor_hello.go | 8 +- rpcserver.go | 14 ++- 5 files changed, 272 insertions(+), 109 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 2cd6ecfc..43470068 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -13,6 +13,9 @@ import ( "github.com/roasbeef/btcd/wire" "github.com/urfave/cli" "golang.org/x/net/context" + "github.com/BitfuryLightning/tools/rt" + "github.com/BitfuryLightning/tools/rt/graph/prefix_tree" + "github.com/BitfuryLightning/tools/rt/graph" ) // TODO(roasbeef): cli logic for supporting both positional and unix style @@ -525,7 +528,19 @@ func sendPaymentCommand(ctx *cli.Context) error { var ShowRoutingTableCommand = cli.Command{ Name: "showroutingtable", Description: "shows routing table for a node", - Action: showRoutingTable, + Usage: "showroutingtable [--table]", + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "table", + Usage: "Show the routing table in table format. Print only a few first symbols of id", + }, + cli.BoolFlag{ + Name: "human", + Usage: "Simplify output to human readable form. Output lightning_id partially. Only work with --table option.", + }, + }, + + Action: showRoutingTable, } func showRoutingTable(ctx *cli.Context) error { @@ -537,7 +552,114 @@ func showRoutingTable(ctx *cli.Context) error { if err != nil { return err } - - printRespJson(resp) + // TODO(mkl): maybe it is better to print output directly omitting + // conversion to RoutingTable. This part is not performance critical so + // I think it is ok because it enables code reuse + r := rt.NewRoutingTable() + for _, channel := range resp.Channels { + r.AddChannel( + graph.NewID(channel.Id1), + graph.NewID(channel.Id2), + graph.NewEdgeID(channel.EdgeID), + &rt.ChannelInfo{channel.Capacity, channel.Weight}, + ) + } + if err != nil { + fmt.Println("Can't unmarshall routing table") + return err + } + if ctx.Bool("table") { + printRTAsTable(r, ctx.Bool("human")) + } else { + printRTAsJSON(r) + } return nil } + +// Prints routing table in human readable table format +func printRTAsTable(r *rt.RoutingTable, humanForm bool) { + // Minimum length of data part to which name can be shortened + var minLen int + var tmpl string + var lightningIdTree, edgeIdTree prefix_tree.PrefixTree + if humanForm { + tmpl = "%-10v %-10v %-10v %-10v %-10v\n" + minLen = 6 + } else { + tmpl = "%-64v %-64v %-66v %-10v %-10v\n" + minLen = 100 + } + fmt.Printf(tmpl, "ID1", "ID2", "EdgeID", "Capacity", "Weight") + channels := r.AllChannels() + if humanForm { + // Generate prefix tree for shortcuts + lightningIdTree = prefix_tree.NewPrefixTree() + for _, node := range r.Nodes() { + lightningIdTree.Add(hex.EncodeToString([]byte(node.String()))) + } + edgeIdTree = prefix_tree.NewPrefixTree() + for _, channel := range channels { + edgeIdTree.Add(channel.EdgeID.String()) + } + } + for _, channel := range channels { + var source, target, edgeId string + sourceHex := hex.EncodeToString([]byte(channel.Id1.String())) + targetHex := hex.EncodeToString([]byte(channel.Id2.String())) + edgeIdRaw := channel.EdgeID.String() + if humanForm { + source = getShortcut(lightningIdTree, sourceHex, minLen) + target = getShortcut(lightningIdTree, targetHex, minLen) + edgeId = getShortcut(edgeIdTree, edgeIdRaw, minLen) + } else { + source = sourceHex + target = targetHex + edgeId = edgeIdRaw + } + fmt.Printf(tmpl, source, target, edgeId, channel.Info.Cpt, channel.Info.Wgt) + } +} + +func getShortcut(tree prefix_tree.PrefixTree, s string, minLen int) string { + s1, err := tree.Shortcut(s) + if err != nil || s == s1 { + return s + } + if len(s1) < minLen && minLen < len(s) { + s1 = s[:minLen] + } + shortcut := fmt.Sprintf("%v...", s1) + if len(shortcut) >= len(s) { + shortcut = s + } + return shortcut +} + +func printRTAsJSON(r *rt.RoutingTable) { + type ChannelDesc struct { + ID1 string `json:"lightning_id1"` + ID2 string `json:"lightning_id2"` + EdgeId string `json:"edge_id"` + Capacity float64 `json:"capacity"` + Weight float64 `json:"weight"` + } + var channels struct { + Channels []ChannelDesc `json:"channels"` + } + channelsRaw := r.AllChannels() + channels.Channels = make([]ChannelDesc, 0, len(channelsRaw)) + for _, channelRaw := range channelsRaw { + sourceHex := hex.EncodeToString([]byte(channelRaw.Id1.String())) + targetHex := hex.EncodeToString([]byte(channelRaw.Id2.String())) + channels.Channels = append(channels.Channels, + ChannelDesc{ + ID1: sourceHex, + ID2: targetHex, + EdgeId: channelRaw.EdgeID.String(), + Weight: channelRaw.Info.Weight(), + Capacity: channelRaw.Info.Capacity(), + }, + ) + } + printRespJson(channels) +} \ No newline at end of file diff --git a/lnrpc/rpc.pb.go b/lnrpc/rpc.pb.go index d2e4a583..bccb44f7 100644 --- a/lnrpc/rpc.pb.go +++ b/lnrpc/rpc.pb.go @@ -40,6 +40,7 @@ It has these top-level messages: PendingChannelResponse WalletBalanceRequest WalletBalanceResponse + RTChannel ShowRoutingTableRequest ShowRoutingTableResponse */ @@ -798,22 +799,42 @@ func (m *WalletBalanceResponse) String() string { return proto.Compac func (*WalletBalanceResponse) ProtoMessage() {} func (*WalletBalanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } +type RTChannel struct { + Id1 string `protobuf:"bytes,1,opt,name=id1" json:"id1,omitempty"` + Id2 string `protobuf:"bytes,2,opt,name=id2" json:"id2,omitempty"` + EdgeID string `protobuf:"bytes,3,opt,name=edgeID" json:"edgeID,omitempty"` + Capacity float64 `protobuf:"fixed64,4,opt,name=capacity" json:"capacity,omitempty"` + Weight float64 `protobuf:"fixed64,5,opt,name=weight" json:"weight,omitempty"` +} + +func (m *RTChannel) Reset() { *m = RTChannel{} } +func (m *RTChannel) String() string { return proto.CompactTextString(m) } +func (*RTChannel) ProtoMessage() {} +func (*RTChannel) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } + type ShowRoutingTableRequest struct { } func (m *ShowRoutingTableRequest) Reset() { *m = ShowRoutingTableRequest{} } func (m *ShowRoutingTableRequest) String() string { return proto.CompactTextString(m) } func (*ShowRoutingTableRequest) ProtoMessage() {} -func (*ShowRoutingTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } +func (*ShowRoutingTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } type ShowRoutingTableResponse struct { - Rt string `protobuf:"bytes,1,opt,name=rt" json:"rt,omitempty"` + Channels []*RTChannel `protobuf:"bytes,1,rep,name=channels" json:"channels,omitempty"` } func (m *ShowRoutingTableResponse) Reset() { *m = ShowRoutingTableResponse{} } func (m *ShowRoutingTableResponse) String() string { return proto.CompactTextString(m) } func (*ShowRoutingTableResponse) ProtoMessage() {} -func (*ShowRoutingTableResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } +func (*ShowRoutingTableResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } + +func (m *ShowRoutingTableResponse) GetChannels() []*RTChannel { + if m != nil { + return m.Channels + } + return nil +} func init() { proto.RegisterType((*SendRequest)(nil), "lnrpc.SendRequest") @@ -848,6 +869,7 @@ func init() { proto.RegisterType((*PendingChannelResponse_PendingChannel)(nil), "lnrpc.PendingChannelResponse.PendingChannel") proto.RegisterType((*WalletBalanceRequest)(nil), "lnrpc.WalletBalanceRequest") proto.RegisterType((*WalletBalanceResponse)(nil), "lnrpc.WalletBalanceResponse") + proto.RegisterType((*RTChannel)(nil), "lnrpc.RTChannel") proto.RegisterType((*ShowRoutingTableRequest)(nil), "lnrpc.ShowRoutingTableRequest") proto.RegisterType((*ShowRoutingTableResponse)(nil), "lnrpc.ShowRoutingTableResponse") proto.RegisterEnum("lnrpc.ChannelStatus", ChannelStatus_name, ChannelStatus_value) @@ -1379,99 +1401,102 @@ var _Lightning_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("rpc.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1496 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x57, 0x5b, 0x6f, 0x13, 0xd7, - 0x13, 0xc7, 0x77, 0x7b, 0x6c, 0x27, 0xf6, 0xc9, 0xcd, 0x31, 0xf0, 0xff, 0xd3, 0x15, 0xa0, 0x08, - 0x85, 0x40, 0x4d, 0x1f, 0x10, 0xa8, 0x54, 0xc1, 0xa4, 0x84, 0x92, 0x26, 0x29, 0x0e, 0x42, 0x7d, - 0x5a, 0xad, 0xd7, 0x27, 0x78, 0xc5, 0x7a, 0x77, 0xeb, 0x73, 0x36, 0xc1, 0xfd, 0x00, 0x7d, 0xed, - 0x6b, 0x3f, 0x44, 0x55, 0xf5, 0x3b, 0x54, 0x7d, 0xaa, 0xd4, 0xcf, 0xd4, 0x39, 0x97, 0xb5, 0xf7, - 0xe2, 0x20, 0xf5, 0xa1, 0x4f, 0xd6, 0xce, 0x99, 0x33, 0x97, 0xdf, 0xcc, 0xfc, 0xce, 0x18, 0x6a, - 0xd3, 0xc0, 0xde, 0x0b, 0xa6, 0x3e, 0xf7, 0x49, 0xc9, 0xf5, 0xf0, 0xc3, 0xf8, 0x0e, 0xea, 0x03, - 0xea, 0x8d, 0xde, 0xd0, 0x1f, 0x42, 0xca, 0x38, 0x69, 0x40, 0x71, 0x84, 0xbf, 0x9d, 0xdc, 0xad, - 0xdc, 0x4e, 0x83, 0xd4, 0xa1, 0x60, 0x4d, 0x78, 0x27, 0x8f, 0x1f, 0x05, 0xb2, 0x0e, 0x8d, 0xc0, - 0x9a, 0x4d, 0xa8, 0xc7, 0xcd, 0xb1, 0xc5, 0xc6, 0x9d, 0x82, 0x54, 0x69, 0x43, 0xed, 0xdc, 0x62, - 0xdc, 0x64, 0x68, 0xa4, 0x53, 0x44, 0x51, 0xd5, 0x58, 0x81, 0x86, 0x32, 0xc9, 0x02, 0xdf, 0x63, - 0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0x16, 0x54, 0x6d, - 0x2b, 0xb0, 0x6c, 0x87, 0xcf, 0xa4, 0xf1, 0x82, 0x50, 0x44, 0x57, 0x96, 0x6b, 0x0e, 0x2d, 0xd7, - 0xf2, 0x6c, 0x2a, 0x9d, 0x14, 0x10, 0xdf, 0x15, 0x6d, 0x32, 0x92, 0x97, 0xa4, 0x7c, 0x1b, 0xda, - 0x21, 0xe6, 0xc6, 0xb9, 0x4b, 0x47, 0xe6, 0x90, 0xaa, 0xa3, 0xb2, 0x3c, 0x32, 0xa0, 0x19, 0x50, - 0x35, 0x66, 0x63, 0xee, 0xda, 0xac, 0x53, 0x91, 0x1d, 0x5f, 0xd7, 0xa8, 0xc9, 0xcc, 0xd7, 0xa0, - 0xee, 0x85, 0x13, 0x33, 0x0c, 0x46, 0x16, 0xa7, 0xac, 0x53, 0xc5, 0x8b, 0x45, 0xe3, 0x8f, 0x1c, - 0x14, 0x05, 0x70, 0x62, 0x24, 0xdd, 0x08, 0xdb, 0x45, 0x2a, 0x31, 0x18, 0x45, 0x12, 0xa5, 0x78, - 0xf1, 0x0a, 0x52, 0x03, 0x01, 0x1d, 0xce, 0xd0, 0x9e, 0x20, 0x05, 0x2e, 0x13, 0x28, 0x2e, 0x64, - 0x53, 0x6a, 0x5f, 0xc8, 0xe0, 0x8b, 0x22, 0x7b, 0x66, 0x71, 0xa5, 0xa5, 0x62, 0xd6, 0x12, 0xa9, - 0x53, 0x91, 0x12, 0x34, 0xee, 0x78, 0x43, 0x2c, 0xc8, 0x48, 0x46, 0x57, 0x25, 0x77, 0x11, 0x32, - 0x85, 0x24, 0xeb, 0xd4, 0x64, 0x46, 0xeb, 0x3a, 0xa3, 0x44, 0x11, 0x0c, 0x22, 0x98, 0x83, 0xc9, - 0x0e, 0x88, 0x3a, 0xdb, 0x78, 0x00, 0xed, 0x98, 0x4c, 0xb7, 0x45, 0x17, 0x4a, 0x22, 0x1f, 0xa6, - 0x19, 0x21, 0xc2, 0x47, 0x28, 0x19, 0x2d, 0x58, 0x79, 0x49, 0xf9, 0x2b, 0xef, 0xdc, 0x8f, 0x4c, - 0xfc, 0x8c, 0xd4, 0x32, 0x17, 0x69, 0x0b, 0xcb, 0x71, 0xea, 0x40, 0xcb, 0x19, 0x61, 0x6a, 0x58, - 0x5b, 0x33, 0xc2, 0x47, 0x55, 0xfd, 0x06, 0xac, 0x0b, 0xd4, 0xa3, 0xea, 0xcc, 0xd3, 0x11, 0xe8, - 0x35, 0xc9, 0x75, 0x58, 0x13, 0xa7, 0x96, 0xcc, 0x66, 0x71, 0x58, 0x94, 0x87, 0xd8, 0x5a, 0xea, - 0xaa, 0x08, 0xb8, 0x24, 0x29, 0xf2, 0xad, 0x1c, 0x95, 0x73, 0x67, 0x3a, 0xb1, 0xb8, 0xe3, 0x7b, - 0x6f, 0x65, 0x2d, 0x85, 0xe2, 0x50, 0xf4, 0xac, 0xc9, 0xc6, 0xd6, 0x82, 0x61, 0x95, 0x68, 0x4c, - 0x45, 0xb4, 0xba, 0x7a, 0xd8, 0x59, 0xc2, 0xa2, 0x8d, 0x26, 0x98, 0xe9, 0xd2, 0x73, 0xae, 0xc2, - 0x30, 0xbe, 0x82, 0xb6, 0x86, 0xf2, 0x04, 0x03, 0xd5, 0x56, 0xef, 0xa5, 0xdb, 0x58, 0x4d, 0xe2, - 0x9a, 0xc6, 0x2c, 0x4e, 0xf3, 0x72, 0x84, 0xd5, 0x77, 0xdf, 0xf5, 0x19, 0xd5, 0x16, 0x30, 0x08, - 0x1b, 0x3f, 0x53, 0xe4, 0x8f, 0x55, 0x66, 0xa1, 0x6d, 0x47, 0x10, 0x55, 0x8d, 0x00, 0x47, 0x58, - 0xdc, 0xd2, 0x16, 0x22, 0x02, 0xf8, 0x17, 0xfe, 0x45, 0xc7, 0x71, 0x67, 0x42, 0x4d, 0xd7, 0x99, - 0x38, 0xd1, 0x34, 0xe3, 0xb8, 0x58, 0xae, 0xeb, 0x5f, 0x9a, 0xe7, 0xfe, 0xd4, 0x46, 0x70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, 0x00, 0xff, 0x01, 0xa5, 0xc6, 0x89, 0xfc, 0x2f, 0x52, 0x5e, 0x3e, 0x82, 0xdd, 0xff, - 0x5f, 0x79, 0xae, 0x0c, 0x0f, 0xcb, 0xf2, 0x4f, 0xee, 0xa3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, - 0xfb, 0x5b, 0x5f, 0x9d, 0xf1, 0x0e, 0x00, 0x00, + // 1539 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x57, 0x5d, 0x6f, 0x1a, 0x57, + 0x13, 0xce, 0x1a, 0x30, 0x30, 0x80, 0x0d, 0xc7, 0x5f, 0x98, 0x24, 0xef, 0x9b, 0xf7, 0x28, 0x89, + 0xac, 0xc8, 0x71, 0x12, 0xf2, 0x5e, 0x44, 0x89, 0x9a, 0xca, 0xc1, 0x6e, 0xec, 0xc6, 0xb5, 0xdd, + 0x40, 0x14, 0xf5, 0x6a, 0xb5, 0xec, 0x1e, 0x9b, 0x55, 0x96, 0x5d, 0xca, 0x1e, 0xe2, 0xd0, 0x1f, + 0xd0, 0xdb, 0xde, 0xf6, 0x47, 0x54, 0x55, 0xff, 0x43, 0xd5, 0xab, 0x4a, 0xfd, 0x4d, 0x9d, 0xf3, + 0xb1, 0xb0, 0x1f, 0x38, 0x52, 0x2f, 0x7a, 0x85, 0x76, 0xce, 0x9c, 0xf9, 0x78, 0x66, 0xe6, 0x39, + 0x03, 0x94, 0xc7, 0x23, 0x7b, 0x6f, 0x34, 0x0e, 0x78, 0x40, 0x0a, 0x9e, 0x8f, 0x1f, 0xf4, 0x5b, + 0xa8, 0x74, 0x99, 0xef, 0xbc, 0x65, 0xdf, 0x4f, 0x58, 0xc8, 0x49, 0x15, 0xf2, 0x0e, 0xfe, 0x36, + 0x8d, 0x3b, 0xc6, 0x4e, 0x95, 0x54, 0x20, 0x67, 0x0d, 0x79, 0x73, 0x09, 0x3f, 0x72, 0x64, 0x1d, + 0xaa, 0x23, 0x6b, 0x3a, 0x64, 0x3e, 0x37, 0x07, 0x56, 0x38, 0x68, 0xe6, 0xa4, 0x4a, 0x03, 0xca, + 0x17, 0x56, 0xc8, 0xcd, 0x10, 0x8d, 0x34, 0xf3, 0x28, 0x2a, 0xd1, 0x15, 0xa8, 0x2a, 0x93, 0xe1, + 0x28, 0xf0, 0x43, 0x46, 0x9f, 0x43, 0xb5, 0x33, 0xb0, 0x7c, 0x9f, 0x79, 0xe7, 0x81, 0xeb, 0x73, + 0x61, 0xe8, 0x62, 0xe2, 0x3b, 0xae, 0x7f, 0x69, 0xf2, 0x4f, 0xae, 0xa3, 0x7d, 0xa1, 0x34, 0x98, + 0xf0, 0xd1, 0x84, 0x9b, 0xae, 0xef, 0xb0, 0x4f, 0xd2, 0x69, 0x8d, 0xfe, 0x1f, 0xea, 0x27, 0xee, + 0xe5, 0x80, 0xfb, 0xa8, 0xbd, 0xef, 0x38, 0x63, 0x16, 0x86, 0x84, 0x00, 0x8c, 0x26, 0xfd, 0x37, + 0x6c, 0x7a, 0x24, 0xc2, 0x10, 0xb7, 0xcb, 0x22, 0xee, 0x41, 0x10, 0xaa, 0x50, 0xcb, 0xf4, 0x47, + 0x03, 0x56, 0x45, 0x08, 0xdf, 0x58, 0xfe, 0x34, 0xca, 0xec, 0x25, 0x54, 0x85, 0x81, 0x5e, 0xb0, + 0x3f, 0x0c, 0x26, 0xbe, 0xc8, 0x30, 0xb7, 0x53, 0x69, 0xef, 0xec, 0x49, 0x18, 0xf6, 0x52, 0xda, + 0x7b, 0x71, 0xd5, 0x43, 0x9f, 0x8f, 0xa7, 0xad, 0xa7, 0xd0, 0xc8, 0x08, 0x05, 0x40, 0x1f, 0xd8, + 0x54, 0xc7, 0x50, 0x83, 0xc2, 0x47, 0xcb, 0x9b, 0x30, 0x85, 0xd7, 0xf3, 0xa5, 0x67, 0x06, 0xbd, + 0x03, 0xf5, 0xb9, 0x65, 0x05, 0x87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x87, 0x13, 0xdb, 0x8e, 0x20, 0x2a, 0xd1, + 0x11, 0x8e, 0xb0, 0xb8, 0xa5, 0x2d, 0x44, 0x04, 0xf0, 0x0f, 0xfc, 0x8b, 0x8e, 0xe3, 0xee, 0x90, + 0x99, 0x9e, 0x3b, 0x74, 0xa3, 0x69, 0xc6, 0x71, 0xb1, 0x3c, 0x2f, 0xb8, 0x32, 0x2f, 0x82, 0xb1, + 0x8d, 0xe0, 0x0a, 0x17, 0x32, 0xdf, 0x12, 0xfd, 0x0d, 0x39, 0x53, 0xba, 0xec, 0x72, 0x8b, 0x4f, + 0x42, 0x1d, 0xee, 0x43, 0x74, 0x28, 0x84, 0x51, 0xb1, 0xb4, 0xc3, 0xf5, 0x59, 0x93, 0x48, 0xa9, + 0x52, 0x3e, 0xba, 0x41, 0x9e, 0x60, 0x76, 0xb1, 0x5a, 0x48, 0xaf, 0x95, 0xf6, 0x76, 0x14, 0x5e, + 0xa6, 0x4c, 0x78, 0xe5, 0x11, 0x80, 0x48, 0x29, 0x16, 0x4b, 0xec, 0x42, 0x06, 0xbf, 0xa3, 0x1b, + 0xaf, 0x4a, 0xb0, 0xac, 0xe6, 0x95, 0xde, 0x86, 0x5a, 0x22, 0x80, 0xc4, 0x2b, 0x50, 0x15, 0x73, + 0x4c, 0x44, 0xed, 0x52, 0x18, 0x62, 0xc1, 0xb9, 0x35, 0xbe, 0x64, 0xdc, 0x4c, 0xb0, 0x21, 0xd9, + 0x85, 0x8a, 0x96, 0xfb, 0x81, 0xc3, 0x74, 0xe8, 0xd7, 0x71, 0xac, 0xe8, 0x61, 0xc5, 0x53, 0xd1, + 0x53, 0xae, 0x59, 0x53, 0xb1, 0xd8, 0x6d, 0xd8, 0xd0, 0x74, 0x95, 0x3a, 0x56, 0x6c, 0xb6, 0x05, + 0xab, 0x76, 0x30, 0x1c, 0xba, 0x61, 0x88, 0x48, 0x98, 0xa1, 0xfb, 0x43, 0x44, 0x67, 0xba, 0xbd, + 0x65, 0x33, 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, 0x2b, 0x25, 0x37, + 0x92, 0xd6, 0x66, 0x5a, 0xac, 0x6f, 0x76, 0xa0, 0x12, 0x63, 0xff, 0x59, 0xfc, 0xd9, 0x17, 0x61, + 0x56, 0x85, 0x34, 0xcd, 0x3e, 0x36, 0x90, 0x74, 0xaa, 0xf1, 0x77, 0x98, 0xcc, 0x52, 0xcd, 0x3e, + 0xce, 0xb3, 0x24, 0x32, 0xaf, 0x28, 0xda, 0x39, 0x85, 0xd5, 0x24, 0xe7, 0xe0, 0x0b, 0x72, 0x0d, + 0x6b, 0x29, 0x63, 0xb7, 0x3f, 0xcb, 0x69, 0xe4, 0xb9, 0xfa, 0xdb, 0x7a, 0xae, 0xfe, 0x90, 0x12, + 0x12, 0x6b, 0x84, 0xc8, 0xc2, 0x5a, 0x42, 0xa6, 0xee, 0xed, 0x18, 0x18, 0x4b, 0x17, 0xff, 0x72, + 0xa5, 0xc6, 0x8c, 0xfc, 0x27, 0x52, 0x5e, 0x3c, 0x9a, 0xad, 0xff, 0x5e, 0x7b, 0xae, 0x0c, 0xf7, + 0x97, 0xe5, 0xbf, 0xea, 0xa7, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x86, 0xfc, 0xda, 0xe9, 0x62, + 0x0f, 0x00, 0x00, } diff --git a/lnrpc/rpc.proto b/lnrpc/rpc.proto index 2c7a8d04..86d25dad 100644 --- a/lnrpc/rpc.proto +++ b/lnrpc/rpc.proto @@ -222,9 +222,17 @@ message WalletBalanceResponse { double balance = 1; } +message RTChannel { + string id1 = 1; + string id2 = 2; + string edgeID = 3; + double capacity = 4; + double weight = 5; +} + message ShowRoutingTableRequest { } message ShowRoutingTableResponse { - string rt = 1; + repeated RTChannel channels = 1; } diff --git a/lnwire/neighbor_hello.go b/lnwire/neighbor_hello.go index d26a2352..01645c12 100644 --- a/lnwire/neighbor_hello.go +++ b/lnwire/neighbor_hello.go @@ -5,7 +5,6 @@ package lnwire import ( - "encoding/gob" "fmt" "io" @@ -18,16 +17,13 @@ type NeighborHelloMessage struct { } func (msg *NeighborHelloMessage) Decode(r io.Reader, pver uint32) error { - decoder := gob.NewDecoder(r) - rt1 := rt.NewRoutingTable() - err := decoder.Decode(rt1.G) + rt1, err := rt.UnmarshallRoutingTable(r) msg.RT = rt1 return err } func (msg *NeighborHelloMessage) Encode(w io.Writer, pver uint32) error { - encoder := gob.NewEncoder(w) - err := encoder.Encode(msg.RT.G) + err := msg.RT.Marshall(w) return err } diff --git a/rpcserver.go b/rpcserver.go index 18598c80..7a0f8904 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -512,7 +512,19 @@ func (r *rpcServer) ShowRoutingTable(ctx context.Context, in *lnrpc.ShowRoutingTableRequest) (*lnrpc.ShowRoutingTableResponse, error) { rpcsLog.Debugf("[ShowRoutingTable]") rtCopy := r.server.routingMgr.GetRTCopy() + channels := make([]*lnrpc.RTChannel, 0) + for _, channel := range rtCopy.AllChannels() { + channels = append(channels, + &lnrpc.RTChannel{ + Id1: channel.Id1.String(), + Id2: channel.Id2.String(), + EdgeID: channel.EdgeID.String(), + Capacity: channel.Info.Capacity(), + Weight: channel.Info.Weight(), + }, + ) + } return &lnrpc.ShowRoutingTableResponse{ - Rt: rtCopy.String(), + Channels: channels, }, nil } From d8bceb16f9bde680816953e4bd6c03cc1b78ce3c Mon Sep 17 00:00:00 2001 From: BitfuryLightning Date: Tue, 23 Aug 2016 15:41:41 -0400 Subject: [PATCH 2/3] routing: Fix bugs with not sending routing messages LIGHT-138, LIGHT-141. Due to some issues in sending/receiving parts of lnd, messages with zero length are not sent. So added some mock content to NeighborAck. Moved sender/receiver from routing message to wrap message which contains lnwire routing message. --- fundingmanager.go | 8 +++--- lnwire/neighbor_ack.go | 9 ++++--- lnwire/neighbor_ack_test.go | 44 ++++++++++++++++++++++++++++++++ lnwire/neighbor_hello.go | 3 +-- lnwire/neighbor_hello_test.go | 35 +++++++++++++++++++++++-- lnwire/neighbor_rst.go | 3 +-- lnwire/neighbor_upd.go | 3 +-- lnwire/routing_messages.go | 35 ------------------------- lnwire/routing_table_request.go | 3 +-- lnwire/routing_table_transfer.go | 3 +-- peer.go | 6 ++--- server.go | 10 +++++--- 12 files changed, 100 insertions(+), 62 deletions(-) create mode 100644 lnwire/neighbor_ack_test.go delete mode 100644 lnwire/routing_messages.go diff --git a/fundingmanager.go b/fundingmanager.go index 7c2b43c4..8010d40f 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -585,10 +585,9 @@ func (f *fundingManager) handleFundingSignComplete(fmsg *fundingSignCompleteMsg) // finding. chanInfo := openChan.StateSnapshot() capacity := float64(chanInfo.Capacity) - fmsg.peer.server.routingMgr.AddChannel( - graph.NewID(fmsg.peer.server.lightningID), + fmsg.peer.server.routingMgr.OpenChannel( graph.NewID(chanInfo.RemoteID), - graph.NewEdgeID(fundingPoint.Hash.String()), + graph.NewEdgeID(fundingPoint.String()), &rt.ChannelInfo{ Cpt: capacity, }, @@ -657,8 +656,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) { // Notify the L3 routing manager of the newly active channel link. capacity := float64(resCtx.reservation.OurContribution().FundingAmount + resCtx.reservation.TheirContribution().FundingAmount) - fmsg.peer.server.routingMgr.AddChannel( - graph.NewID(fmsg.peer.server.lightningID), + fmsg.peer.server.routingMgr.OpenChannel( graph.NewID([32]byte(fmsg.peer.lightningID)), graph.NewEdgeID(resCtx.reservation.FundingOutpoint().String()), &rt.ChannelInfo{ diff --git a/lnwire/neighbor_ack.go b/lnwire/neighbor_ack.go index d1fa13fe..8f6ea453 100644 --- a/lnwire/neighbor_ack.go +++ b/lnwire/neighbor_ack.go @@ -10,11 +10,10 @@ import ( ) type NeighborAckMessage struct { - RoutingMessageBase } func (msg *NeighborAckMessage) String() string { - return fmt.Sprintf("NeighborAckMessage{%v %v}", msg.SenderID, msg.ReceiverID) + return fmt.Sprintf("NeighborAckMessage{}",) } func (msg *NeighborAckMessage) Command() uint32 { @@ -22,6 +21,8 @@ func (msg *NeighborAckMessage) Command() uint32 { } func (msg *NeighborAckMessage) Encode(w io.Writer, pver uint32) error { + // Transmission function work incorrect with empty messages so write some random string to make message not empty + w.Write([]byte("NeighborAckMessage")) return nil } @@ -30,7 +31,9 @@ func (msg *NeighborAckMessage) Decode(r io.Reader, pver uint32) error { } func (msg *NeighborAckMessage) MaxPayloadLength(uint32) uint32 { - return 0 + // Some random number. Transmission functions work bad if it is 0 + return 100 + } func (msg *NeighborAckMessage) Validate() error { diff --git a/lnwire/neighbor_ack_test.go b/lnwire/neighbor_ack_test.go new file mode 100644 index 00000000..6e921d72 --- /dev/null +++ b/lnwire/neighbor_ack_test.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016 Bitfury Group Limited +// Distributed under the MIT software license, see the accompanying +// file LICENSE or http://www.opensource.org/licenses/mit-license.php + +package lnwire + +import ( + "bytes" + "testing" + + "github.com/roasbeef/btcd/wire" +) + +func TestNeighborAckMessageEncodeDecode(t *testing.T) { + b := new(bytes.Buffer) + msg1 := NeighborAckMessage{} + err := msg1.Encode(b, 0) + if err != nil { + t.Fatalf("Can't encode message ", err) + } + msg2 := new(NeighborAckMessage) + err = msg2.Decode(b, 0) + if err != nil { + t.Fatalf("Can't decode message ", err) + } +} + +func TestNeighborAckMessageReadWrite(t *testing.T){ + b := new(bytes.Buffer) + msg1 := &NeighborAckMessage{} + _, err := WriteMessage(b, msg1, 0, wire.SimNet) + if err != nil { + t.Fatalf("Can't write message %v", err) + } + _, msg2, _, err := ReadMessage(b, 0, wire.SimNet) + if err != nil { + t.Fatalf("Can't read message %v", err) + } + _, ok := msg2.(*NeighborAckMessage) + if !ok { + t.Fatalf("Can't convert to *NeighborAckMessage") + } +} + diff --git a/lnwire/neighbor_hello.go b/lnwire/neighbor_hello.go index 01645c12..53a57a2a 100644 --- a/lnwire/neighbor_hello.go +++ b/lnwire/neighbor_hello.go @@ -12,7 +12,6 @@ import ( ) type NeighborHelloMessage struct { - RoutingMessageBase RT *rt.RoutingTable } @@ -42,7 +41,7 @@ func (msg *NeighborHelloMessage) Validate() error { } func (msg *NeighborHelloMessage) String() string { - return fmt.Sprintf("NeighborHelloMessage{%v %v %v}", msg.SenderID, msg.ReceiverID, msg.RT) + return fmt.Sprintf("NeighborHelloMessage{%v}", msg.RT) } var _ Message = (*NeighborHelloMessage)(nil) diff --git a/lnwire/neighbor_hello_test.go b/lnwire/neighbor_hello_test.go index 25285979..b2549c2e 100644 --- a/lnwire/neighbor_hello_test.go +++ b/lnwire/neighbor_hello_test.go @@ -10,6 +10,7 @@ import ( "github.com/BitfuryLightning/tools/rt" "github.com/BitfuryLightning/tools/rt/graph" + "github.com/roasbeef/btcd/wire" ) func TestNeighborHelloMessageEncodeDecode(t *testing.T) { @@ -31,10 +32,40 @@ func TestNeighborHelloMessageEncodeDecode(t *testing.T) { if msg2.RT == nil { t.Fatal("After decoding RT should not be nil") } - if !msg2.RT.HasChannel(Id1, Id2, nil) { + if !msg2.RT.HasChannel(Id1, Id2, graph.NewEdgeID("1")) { t.Errorf("msg2.RT.HasChannel(Id1, Id2) = false, want true") } - if !msg2.RT.HasChannel(Id2, Id1, nil) { + if !msg2.RT.HasChannel(Id2, Id1, graph.NewEdgeID("1")) { + t.Errorf("msg2.RT.HasChannel(Id2, Id1) = false, want true") + } +} + +func TestNeighborHelloMessageReadWrite(t *testing.T) { + Id1 := graph.NewID(1) + Id2 := graph.NewID(2) + rt1 := rt.NewRoutingTable() + rt1.AddChannel(Id1, Id2, graph.NewEdgeID("1"), &rt.ChannelInfo{1, 1}) + b := new(bytes.Buffer) + msg1 := &NeighborHelloMessage{RT: rt1} + _, err := WriteMessage(b, msg1, 0, wire.SimNet) + if err != nil { + t.Fatalf("Can't write message %v", err) + } + _, msg2, _, err := ReadMessage(b, 0, wire.SimNet) + if err != nil { + t.Fatalf("Can't read message %v", err) + } + msg2c, ok := msg2.(*NeighborHelloMessage) + if !ok { + t.Fatalf("Can't convert to *NeighborHelloMessage") + } + if msg2c.RT == nil { + t.Fatal("After decoding RT should not be nil") + } + if !msg2c.RT.HasChannel(Id1, Id2, graph.NewEdgeID("1")) { + t.Errorf("msg2.RT.HasChannel(Id1, Id2) = false, want true") + } + if !msg2c.RT.HasChannel(Id2, Id1, graph.NewEdgeID("1")) { t.Errorf("msg2.RT.HasChannel(Id2, Id1) = false, want true") } } diff --git a/lnwire/neighbor_rst.go b/lnwire/neighbor_rst.go index f04421e4..3ecf46e0 100644 --- a/lnwire/neighbor_rst.go +++ b/lnwire/neighbor_rst.go @@ -10,11 +10,10 @@ import ( ) type NeighborRstMessage struct { - RoutingMessageBase } func (msg *NeighborRstMessage) String() string { - return fmt.Sprintf("NeighborRstMessage{%v %v}", msg.SenderID, msg.ReceiverID) + return fmt.Sprintf("NeighborRstMessage{}") } func (msg *NeighborRstMessage) Command() uint32 { diff --git a/lnwire/neighbor_upd.go b/lnwire/neighbor_upd.go index 59ff781a..17d35203 100644 --- a/lnwire/neighbor_upd.go +++ b/lnwire/neighbor_upd.go @@ -13,7 +13,6 @@ import ( ) type NeighborUpdMessage struct { - RoutingMessageBase DiffBuff *rt.DifferenceBuffer } @@ -46,7 +45,7 @@ func (msg *NeighborUpdMessage) Validate() error { } func (msg *NeighborUpdMessage) String() string { - return fmt.Sprintf("NeighborUpdMessage{%v %v %v}", msg.SenderID, msg.ReceiverID, *msg.DiffBuff) + return fmt.Sprintf("NeighborUpdMessage{%v}", *msg.DiffBuff) } var _ Message = (*NeighborUpdMessage)(nil) diff --git a/lnwire/routing_messages.go b/lnwire/routing_messages.go deleted file mode 100644 index be67f98c..00000000 --- a/lnwire/routing_messages.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2016 Bitfury Group Limited -// Distributed under the MIT software license, see the accompanying -// file LICENSE or http://www.opensource.org/licenses/mit-license.php - -package lnwire - -import ( - "github.com/BitfuryLightning/tools/rt/graph" -) - -// RoutingMessageBase is the base struct for all routing messages within the -// lnwire package. -type RoutingMessageBase struct { - // SenderID is the ID of the sender of the routing message. - SenderID graph.ID - - // ReceiverID is the ID of the receiver of the routig message. - ReceiverID graph.ID -} - -// GetReceiverID returns the ID of the receiver of routing message. -func (msg RoutingMessageBase) GetReceiverID() graph.ID { - return msg.ReceiverID -} - -// GetSenderID returns the ID of the sender of the routing message. -func (msg RoutingMessageBase) GetSenderID() graph.ID { - return msg.SenderID -} - -// RoutingMessageBase is a shared interface for all routing messages. -type RoutingMessage interface { - GetSenderID() graph.ID - GetReceiverID() graph.ID -} diff --git a/lnwire/routing_table_request.go b/lnwire/routing_table_request.go index 4780d89f..69f5bc6f 100644 --- a/lnwire/routing_table_request.go +++ b/lnwire/routing_table_request.go @@ -10,11 +10,10 @@ import ( ) type RoutingTableRequestMessage struct { - RoutingMessageBase } func (msg *RoutingTableRequestMessage) String() string { - return fmt.Sprintf("RoutingTableRequestMessage{%v %v}", msg.SenderID, msg.ReceiverID) + return fmt.Sprintf("RoutingTableRequestMessage{}") } func (msg *RoutingTableRequestMessage) Command() uint32 { diff --git a/lnwire/routing_table_transfer.go b/lnwire/routing_table_transfer.go index b4138dce..b06a54bd 100644 --- a/lnwire/routing_table_transfer.go +++ b/lnwire/routing_table_transfer.go @@ -13,12 +13,11 @@ import ( ) type RoutingTableTransferMessage struct { - RoutingMessageBase RT *rt.RoutingTable } func (msg *RoutingTableTransferMessage) String() string { - return fmt.Sprintf("RoutingTableTransferMessage{%v %v %v}", msg.SenderID, msg.ReceiverID, msg.RT) + return fmt.Sprintf("RoutingTableTransferMessage{%v %v %v}", msg.RT) } func (msg *RoutingTableTransferMessage) Decode(r io.Reader, pver uint32) error { diff --git a/peer.go b/peer.go index a5f73ceb..a37fdf90 100644 --- a/peer.go +++ b/peer.go @@ -19,6 +19,7 @@ import ( "github.com/roasbeef/btcd/txscript" "github.com/roasbeef/btcd/wire" "github.com/roasbeef/btcutil" + "github.com/BitfuryLightning/tools/rt/graph" ) var ( @@ -385,9 +386,8 @@ out: *lnwire.NeighborUpdMessage, *lnwire.RoutingTableRequestMessage, *lnwire.RoutingTableTransferMessage: - - // TODO(mkl): determine sender and receiver of message - p.server.routingMgr.ChIn <- msg + // Convert to base routing message and set sender and receiver + p.server.routingMgr.ReceiveRoutingMessage(msg, graph.NewID(([32]byte)(p.lightningID))) } if isChanUpate { diff --git a/server.go b/server.go index e8c591e2..4fab56c0 100644 --- a/server.go +++ b/server.go @@ -13,7 +13,6 @@ import ( "github.com/lightningnetwork/lnd/lndc" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lnwallet" - "github.com/lightningnetwork/lnd/lnwire" "github.com/roasbeef/btcd/btcec" "github.com/roasbeef/btcutil" @@ -284,8 +283,11 @@ out: s.handleOpenChanReq(msg) } case msg := <-s.routingMgr.ChOut: - msg1 := msg.(lnwire.RoutingMessage) - receiverID := msg1.GetReceiverID().ToByte32() + msg1 := msg.(*routing.RoutingMessage) + if msg1.ReceiverID == nil{ + peerLog.Critical("msg1.GetReceiverID() == nil") + } + receiverID := msg1.ReceiverID.ToByte32() var targetPeer *peer for _, peer := range s.peers { // TODO: threadsafe api // We found the the target @@ -297,7 +299,7 @@ out: if targetPeer != nil { fndgLog.Info("Peer found. Sending message") done := make(chan struct{}, 1) - targetPeer.queueMsg(msg.(lnwire.Message), done) + targetPeer.queueMsg(msg1.Msg, done) } else { srvrLog.Errorf("Can't find peer to send message %v", receiverID) } From 2bcff188e872b42bf1de7b8e8cb657f6a5f625b7 Mon Sep 17 00:00:00 2001 From: BitfuryLightning Date: Sun, 21 Aug 2016 17:46:54 +0300 Subject: [PATCH 3/3] lncli: Add graphical output of routing table LIGHT-131, LIGHT-140, LIGHT-138 `lncli showroutingtable` may output routing table as image. Use graphviz for graph rendering. Add explicit version dependency for tools. Add error checking. --- cmd/lncli/commands.go | 214 +++++++++++++++++++++++++++++++++++----- fundingmanager.go | 4 +- glide.lock | 41 +++++--- glide.yaml | 1 + lnrpc/rpc.pb.go | 217 ++++++++++++++++++++--------------------- lnrpc/rpc.proto | 8 +- lnwire/neighbor_ack.go | 14 ++- rpcserver.go | 14 +-- 8 files changed, 347 insertions(+), 166 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 43470068..917dea4d 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -6,7 +6,9 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "os" + "path/filepath" "strings" "github.com/lightningnetwork/lnd/lnrpc" @@ -14,8 +16,10 @@ import ( "github.com/urfave/cli" "golang.org/x/net/context" "github.com/BitfuryLightning/tools/rt" - "github.com/BitfuryLightning/tools/rt/graph/prefix_tree" + "github.com/BitfuryLightning/tools/prefix_tree" "github.com/BitfuryLightning/tools/rt/graph" + + "github.com/BitfuryLightning/tools/rt/visualizer" ) // TODO(roasbeef): cli logic for supporting both positional and unix style @@ -528,54 +532,212 @@ func sendPaymentCommand(ctx *cli.Context) error { var ShowRoutingTableCommand = cli.Command{ Name: "showroutingtable", Description: "shows routing table for a node", - Usage: "showroutingtable [--table]", - Flags: []cli.Flag{ - cli.BoolFlag{ - Name: "table", - Usage: "Show the routing table in table format. Print only a few first symbols of id", + Usage: "showroutingtable text|image", + Subcommands: []cli.Command{ + { + Name: "text", + Usage: "[--table|--human]", + Description: "Show routing table in textual format. By default in JSON", + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "table", + Usage: "Print channels in routing table in table format.", + }, + cli.BoolFlag{ + Name: "human", + Usage: "Print channels in routing table in table format. Output lightning_id partially - only a few first symbols which uniquelly identifies it.", + }, + }, + Action: showRoutingTableAsText, }, - cli.BoolFlag{ - Name: "human", - Usage: "Simplify output to human readable form. Output lightning_id partially. Only work with --table option.", + { + Name: "image", + Usage: "[--type ] [--dest OUTPUT_FILE] [--open]", + Description: "Create image with graphical representation of routing table", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "type", + Usage: "Type of image file. Use one of: http://www.graphviz.org/content/output-formats. Usage of this option supresses textual output", + }, + cli.StringFlag{ + Name: "dest", + Usage: "Specifies where to save the generated file. If don't specified use os.TempDir Usage of this option supresses textual output", + }, + cli.BoolFlag{ + Name: "open", + Usage: "Open generated file automatically. Uses command line \"open\" command", + }, + }, + Action: showRoutingTableAsImage, }, }, - - Action: showRoutingTable, } -func showRoutingTable(ctx *cli.Context) error { - ctxb := context.Background() - client := getClient(ctx) - +func getRoutingTable(ctxb context.Context, client lnrpc.LightningClient) (*rt.RoutingTable, error) { req := &lnrpc.ShowRoutingTableRequest{} resp, err := client.ShowRoutingTable(ctxb, req) if err != nil { - return err + return nil, err } - // TODO(mkl): maybe it is better to print output directly omitting - // conversion to RoutingTable. This part is not performance critical so - // I think it is ok because it enables code reuse + r := rt.NewRoutingTable() for _, channel := range resp.Channels { r.AddChannel( graph.NewID(channel.Id1), graph.NewID(channel.Id2), - graph.NewEdgeID(channel.EdgeID), + graph.NewEdgeID(channel.Outpoint), &rt.ChannelInfo{channel.Capacity, channel.Weight}, ) } - if err != nil { - fmt.Println("Can't unmarshall routing table") + return r, nil +} + +func showRoutingTableAsText(ctx *cli.Context) error { + ctxb := context.Background() + client := getClient(ctx) + + r, err := getRoutingTable(ctxb, client) + if err != nil{ return err } + + if ctx.Bool("table") && ctx.Bool("human"){ + return fmt.Errorf("--table and --human cannot be used at the same time") + } + if ctx.Bool("table") { - printRTAsTable(r, ctx.Bool("human")) + printRTAsTable(r, false) + } else if ctx.Bool("human") { + printRTAsTable(r, true) } else { printRTAsJSON(r) } return nil } +func showRoutingTableAsImage(ctx *cli.Context) error { + ctxb := context.Background() + client := getClient(ctx) + + r, err := getRoutingTable(ctxb, client) + if err != nil{ + return err + } + + reqGetInfo := &lnrpc.GetInfoRequest{} + respGetInfo, err := client.GetInfo(ctxb, reqGetInfo) + if err != nil { + return err + } + selfLightningId, err := hex.DecodeString(respGetInfo.LightningId) + if err != nil { + return err + } + + imgType := ctx.String("type") + imgDest := ctx.String("dest") + if imgType == "" && imgDest == "" { + return fmt.Errorf("One or both of --type or --dest should be specified") + } + + tempFile, err := ioutil.TempFile("", "") + if err != nil { + return err + } + var imageFile *os.File + // if the type is not specified explicitly parse the filename + if imgType == "" { + imgType = filepath.Ext(imgDest)[1:] + } + // if the filename is not specified explicitly use tempfile + if imgDest == "" { + imageFile, err = TempFileWithSuffix("", "rt_", "."+ imgType) + if err != nil { + return err + } + } else { + imageFile, err = os.Create(imgDest) + if err != nil { + return err + } + } + if _, ok := visualizer.SupportedFormatsAsMap()[imgType]; !ok { + fmt.Printf("Format: '%v' not recognized. Use one of: %v\n", imgType, visualizer.SupportedFormats()) + return nil + } + // generate description graph by dot language + err = writeToTempFile(r, tempFile, selfLightningId) + if err != nil { + return err + } + err = writeToImageFile(tempFile, imageFile) + if err != nil { + return err + } + if ctx.Bool("open") { + if err := visualizer.Open(imageFile); err != nil { + return err + } + } + return nil +} + +func writeToTempFile(r *rt.RoutingTable, file *os.File, self []byte) error { + slc := []graph.ID{graph.NewID(string(self))} + viz := visualizer.New(r.G, slc, nil, nil) + viz.ApplyToNode = func(s string) string { return hex.EncodeToString([]byte(s)) } + viz.ApplyToEdge = func(info interface{}) string { + if info, ok := info.(*rt.ChannelInfo); ok { + return fmt.Sprintf(`"%v"`, info.Capacity()) + } + return "nil" + } + // need to call method if plan to use shortcut, autocomplete, etc + viz.BuildPrefixTree() + viz.EnableShortcut(true) + dot := viz.Draw() + _, err := file.Write([]byte(dot)) + if err != nil { + return err + } + err = file.Sync() + if err != nil { + return err + } + return nil +} + +func writeToImageFile(TempFile, ImageFile *os.File) error { + err := visualizer.Run("neato", TempFile, ImageFile) + if err != nil { + return err + } + err = TempFile.Close() + if err != nil { + return err + } + err = os.Remove(TempFile.Name()) + if err != nil { + return err + } + err = ImageFile.Close() + if err != nil { + return err + } + return nil +} + +// get around a bug in the standard library, add suffix param +func TempFileWithSuffix(dir, prefix, suffix string) (*os.File, error) { + f, err := ioutil.TempFile(dir, prefix) + if err != nil { + return nil, err + } + defer os.Remove(f.Name()) + f, err = os.Create(f.Name()+suffix) + return f, err +} + // Prints routing table in human readable table format func printRTAsTable(r *rt.RoutingTable, humanForm bool) { // Minimum length of data part to which name can be shortened @@ -589,7 +751,7 @@ func printRTAsTable(r *rt.RoutingTable, humanForm bool) { tmpl = "%-64v %-64v %-66v %-10v %-10v\n" minLen = 100 } - fmt.Printf(tmpl, "ID1", "ID2", "EdgeID", "Capacity", "Weight") + fmt.Printf(tmpl, "ID1", "ID2", "Outpoint", "Capacity", "Weight") channels := r.AllChannels() if humanForm { // Generate prefix tree for shortcuts @@ -639,8 +801,8 @@ func printRTAsJSON(r *rt.RoutingTable) { type ChannelDesc struct { ID1 string `json:"lightning_id1"` ID2 string `json:"lightning_id2"` - EdgeId string `json:"edge_id"` - Capacity float64 `json:"capacity"` + EdgeId string `json:"outpoint"` + Capacity int64 `json:"capacity"` Weight float64 `json:"weight"` } var channels struct { diff --git a/fundingmanager.go b/fundingmanager.go index 8010d40f..3748f77a 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -584,7 +584,7 @@ func (f *fundingManager) handleFundingSignComplete(fmsg *fundingSignCompleteMsg) // so this new channel can be utilized during path // finding. chanInfo := openChan.StateSnapshot() - capacity := float64(chanInfo.Capacity) + capacity := int64(chanInfo.Capacity) fmsg.peer.server.routingMgr.OpenChannel( graph.NewID(chanInfo.RemoteID), graph.NewEdgeID(fundingPoint.String()), @@ -654,7 +654,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) { resCtx.reservation.FundingOutpoint, fmsg.peer.id) // Notify the L3 routing manager of the newly active channel link. - capacity := float64(resCtx.reservation.OurContribution().FundingAmount + + capacity := int64(resCtx.reservation.OurContribution().FundingAmount + resCtx.reservation.TheirContribution().FundingAmount) fmsg.peer.server.routingMgr.OpenChannel( graph.NewID([32]byte(fmsg.peer.lightningID)), diff --git a/glide.lock b/glide.lock index 81c92794..52221620 100644 --- a/glide.lock +++ b/glide.lock @@ -1,22 +1,31 @@ -hash: 02d4ee92f22da78cae1ef93beb72f1814e12714ec4b76bc1d009769990084f83 -updated: 2016-08-11T11:35:40.811837309-07:00 +hash: 348cab6c25a05211caed34dc711bd1cb5a51800bc87d3609127ff9271b206c42 +updated: 2016-09-02T08:34:25.843272647-04:00 imports: +- name: github.com/awalterschulze/gographviz + version: cafbade2d58068c3992f12afe46742195c673d2b + subpackages: + - ast + - parser + - scanner + - token - name: github.com/BitfuryLightning/tools - version: 5559e9eeb613446747dd43026ab60f63ad6eeb05 + version: b36ae00916b800503504455f7afeb3159bd5ee35 subpackages: - routing - rt - rt/graph + - prefix_tree + - rt/visualizer - pbuffer - pqueue - name: github.com/boltdb/bolt - version: dfb21201d9270c1082d5fb0f07f500311ff72f18 + version: 583e8937c61f1af6513608ccc75c97b6abdf4ff9 - name: github.com/btcsuite/bolt - version: 38b9bbfde72d4b62b6a038a3adfca64c44da0133 + version: da4838c39653ed69caa78c99ca68001a89eb973f - name: github.com/btcsuite/btclog - version: f96df2375f37300305f329b8e5258764b4f19a7f + version: 73889fb79bd687870312b6e40effcecffbd57d30 - name: github.com/btcsuite/fastsha256 - version: 302ad4db268b46f9ebda3078f6f7397f96047735 + version: 637e656429416087660c84436a2a035d69d54e2e - name: github.com/btcsuite/go-flags version: 6c288d648c1cc1befcb90cb5511dcacf64ae8e61 - name: github.com/btcsuite/go-socks @@ -42,15 +51,15 @@ imports: - name: github.com/codahale/chacha20poly1305 version: f8a5c48301822c3d7dd26d78e68ea2968db0ab20 - name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d + version: 6cf5744a041a0022271cefed95ba843f6d87fd51 subpackages: - spew - name: github.com/golang/protobuf - version: 2c1988e8c18d14b142c0b472624f71647cf39adb + version: 1f49d83d9aa00e6ce4fc8258c71cc7786aec968a subpackages: - proto - name: github.com/howeyc/gopass - version: b63a7d07e65df376d14e2d72907a93d4847dffe4 + version: 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d - name: github.com/roasbeef/btcd version: baea7691cc3c59480703fe1a3fb5595c838c963c subpackages: @@ -79,9 +88,9 @@ imports: - waddrmgr - wallet - walletdb/bdb - - walletdb - internal/zero - snacl + - walletdb - wtxmgr - internal/prompt - wallet/txauthor @@ -91,9 +100,9 @@ imports: - wallet/internal/txsizes - internal/legacy/rename - name: github.com/urfave/cli - version: 1efa31f08b9333f1bd4882d61f9d668a70cd902e + version: a14d7d367bc02b1f57d88de97926727f2d936387 - name: golang.org/x/crypto - version: 595bbbd7f5f308415a544d3c55743c91427c8d99 + version: f160b6bf95857cd862817875dd958be022e587c4 subpackages: - hkdf - nacl/secretbox @@ -104,7 +113,7 @@ imports: - pbkdf2 - ssh/terminal - name: golang.org/x/net - version: 075e191f18186a8ff2becaf64478e30f4545cdad + version: 1358eff22f0dd0c54fc521042cc607f6ff4b531a subpackages: - context - http2 @@ -117,11 +126,11 @@ imports: subpackages: - unix - name: google.golang.org/grpc - version: 13edeeffdea7a41d5aad96c28deb4c7bd01a9397 + version: 0032a855ba5c8a3c8e0d71c2deef354b70af1584 subpackages: + - grpclog - codes - credentials - - grpclog - internal - metadata - naming diff --git a/glide.yaml b/glide.yaml index dab2170f..eeb9e2a5 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,7 @@ package: github.com/lightningnetwork/lnd import: - package: github.com/BitfuryLightning/tools + version: ^0.0.2 subpackages: - routing - rt diff --git a/lnrpc/rpc.pb.go b/lnrpc/rpc.pb.go index bccb44f7..0c62b63d 100644 --- a/lnrpc/rpc.pb.go +++ b/lnrpc/rpc.pb.go @@ -40,7 +40,7 @@ It has these top-level messages: PendingChannelResponse WalletBalanceRequest WalletBalanceResponse - RTChannel + RoutingTableLink ShowRoutingTableRequest ShowRoutingTableResponse */ @@ -799,18 +799,18 @@ func (m *WalletBalanceResponse) String() string { return proto.Compac func (*WalletBalanceResponse) ProtoMessage() {} func (*WalletBalanceResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } -type RTChannel struct { +type RoutingTableLink struct { Id1 string `protobuf:"bytes,1,opt,name=id1" json:"id1,omitempty"` Id2 string `protobuf:"bytes,2,opt,name=id2" json:"id2,omitempty"` - EdgeID string `protobuf:"bytes,3,opt,name=edgeID" json:"edgeID,omitempty"` - Capacity float64 `protobuf:"fixed64,4,opt,name=capacity" json:"capacity,omitempty"` + Outpoint string `protobuf:"bytes,3,opt,name=outpoint" json:"outpoint,omitempty"` + Capacity int64 `protobuf:"varint,4,opt,name=capacity" json:"capacity,omitempty"` Weight float64 `protobuf:"fixed64,5,opt,name=weight" json:"weight,omitempty"` } -func (m *RTChannel) Reset() { *m = RTChannel{} } -func (m *RTChannel) String() string { return proto.CompactTextString(m) } -func (*RTChannel) ProtoMessage() {} -func (*RTChannel) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } +func (m *RoutingTableLink) Reset() { *m = RoutingTableLink{} } +func (m *RoutingTableLink) String() string { return proto.CompactTextString(m) } +func (*RoutingTableLink) ProtoMessage() {} +func (*RoutingTableLink) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } type ShowRoutingTableRequest struct { } @@ -821,7 +821,7 @@ func (*ShowRoutingTableRequest) ProtoMessage() {} func (*ShowRoutingTableRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } type ShowRoutingTableResponse struct { - Channels []*RTChannel `protobuf:"bytes,1,rep,name=channels" json:"channels,omitempty"` + Channels []*RoutingTableLink `protobuf:"bytes,1,rep,name=channels" json:"channels,omitempty"` } func (m *ShowRoutingTableResponse) Reset() { *m = ShowRoutingTableResponse{} } @@ -829,7 +829,7 @@ func (m *ShowRoutingTableResponse) String() string { return proto.Com func (*ShowRoutingTableResponse) ProtoMessage() {} func (*ShowRoutingTableResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } -func (m *ShowRoutingTableResponse) GetChannels() []*RTChannel { +func (m *ShowRoutingTableResponse) GetChannels() []*RoutingTableLink { if m != nil { return m.Channels } @@ -869,7 +869,7 @@ func init() { proto.RegisterType((*PendingChannelResponse_PendingChannel)(nil), "lnrpc.PendingChannelResponse.PendingChannel") proto.RegisterType((*WalletBalanceRequest)(nil), "lnrpc.WalletBalanceRequest") proto.RegisterType((*WalletBalanceResponse)(nil), "lnrpc.WalletBalanceResponse") - proto.RegisterType((*RTChannel)(nil), "lnrpc.RTChannel") + proto.RegisterType((*RoutingTableLink)(nil), "lnrpc.RoutingTableLink") proto.RegisterType((*ShowRoutingTableRequest)(nil), "lnrpc.ShowRoutingTableRequest") proto.RegisterType((*ShowRoutingTableResponse)(nil), "lnrpc.ShowRoutingTableResponse") proto.RegisterEnum("lnrpc.ChannelStatus", ChannelStatus_name, ChannelStatus_value) @@ -1401,102 +1401,101 @@ var _Lightning_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("rpc.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x57, 0x5d, 0x6f, 0x1a, 0x57, - 0x13, 0xce, 0x1a, 0x30, 0x30, 0x80, 0x0d, 0xc7, 0x5f, 0x98, 0x24, 0xef, 0x9b, 0xf7, 0x28, 0x89, - 0xac, 0xc8, 0x71, 0x12, 0xf2, 0x5e, 0x44, 0x89, 0x9a, 0xca, 0xc1, 0x6e, 0xec, 0xc6, 0xb5, 0xdd, - 0x40, 0x14, 0xf5, 0x6a, 0xb5, 0xec, 0x1e, 0x9b, 0x55, 0x96, 0x5d, 0xca, 0x1e, 0xe2, 0xd0, 0x1f, - 0xd0, 0xdb, 0xde, 0xf6, 0x47, 0x54, 0x55, 0xff, 0x43, 0xd5, 0xab, 0x4a, 0xfd, 0x4d, 0x9d, 0xf3, - 0xb1, 0xb0, 0x1f, 0x38, 0x52, 0x2f, 0x7a, 0x85, 0x76, 0xce, 0x9c, 0xf9, 0x78, 0x66, 0xe6, 0x39, - 0x03, 0x94, 0xc7, 0x23, 0x7b, 0x6f, 0x34, 0x0e, 0x78, 0x40, 0x0a, 0x9e, 0x8f, 0x1f, 0xf4, 0x5b, - 0xa8, 0x74, 0x99, 0xef, 0xbc, 0x65, 0xdf, 0x4f, 0x58, 0xc8, 0x49, 0x15, 0xf2, 0x0e, 0xfe, 0x36, - 0x8d, 0x3b, 0xc6, 0x4e, 0x95, 0x54, 0x20, 0x67, 0x0d, 0x79, 0x73, 0x09, 0x3f, 0x72, 0x64, 0x1d, - 0xaa, 0x23, 0x6b, 0x3a, 0x64, 0x3e, 0x37, 0x07, 0x56, 0x38, 0x68, 0xe6, 0xa4, 0x4a, 0x03, 0xca, - 0x17, 0x56, 0xc8, 0xcd, 0x10, 0x8d, 0x34, 0xf3, 0x28, 0x2a, 0xd1, 0x15, 0xa8, 0x2a, 0x93, 0xe1, - 0x28, 0xf0, 0x43, 0x46, 0x9f, 0x43, 0xb5, 0x33, 0xb0, 0x7c, 0x9f, 0x79, 0xe7, 0x81, 0xeb, 0x73, - 0x61, 0xe8, 0x62, 0xe2, 0x3b, 0xae, 0x7f, 0x69, 0xf2, 0x4f, 0xae, 0xa3, 0x7d, 0xa1, 0x34, 0x98, - 0xf0, 0xd1, 0x84, 0x9b, 0xae, 0xef, 0xb0, 0x4f, 0xd2, 0x69, 0x8d, 0xfe, 0x1f, 0xea, 0x27, 0xee, - 0xe5, 0x80, 0xfb, 0xa8, 0xbd, 0xef, 0x38, 0x63, 0x16, 0x86, 0x84, 0x00, 0x8c, 0x26, 0xfd, 0x37, - 0x6c, 0x7a, 0x24, 0xc2, 0x10, 0xb7, 0xcb, 0x22, 0xee, 0x41, 0x10, 0xaa, 0x50, 0xcb, 0xf4, 0x47, - 0x03, 0x56, 0x45, 0x08, 0xdf, 0x58, 0xfe, 0x34, 0xca, 0xec, 0x25, 0x54, 0x85, 0x81, 0x5e, 0xb0, - 0x3f, 0x0c, 0x26, 0xbe, 0xc8, 0x30, 0xb7, 0x53, 0x69, 0xef, 0xec, 0x49, 0x18, 0xf6, 0x52, 0xda, - 0x7b, 0x71, 0xd5, 0x43, 0x9f, 0x8f, 0xa7,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, 0x98, 0xd9, 0x1f, 0x65, 0xf0, 0x79, 0x91, 0x7d, 0x68, 0x71, 0xa5, 0xa5, 0x62, - 0xd6, 0x12, 0xa9, 0x53, 0x94, 0x12, 0x34, 0xee, 0xfa, 0x7d, 0x2c, 0x88, 0x23, 0xa3, 0x2b, 0x91, - 0xfb, 0x08, 0x99, 0x42, 0x32, 0x6c, 0x96, 0x65, 0x46, 0xeb, 0x3a, 0xa3, 0x44, 0x11, 0x28, 0x11, - 0xcc, 0x11, 0xca, 0x0e, 0x88, 0x3a, 0x9b, 0x3e, 0x82, 0x46, 0x4c, 0xa6, 0xdb, 0xa2, 0x05, 0x05, - 0x91, 0x4f, 0xa8, 0x19, 0x21, 0xc2, 0x47, 0x28, 0xd1, 0x3a, 0xac, 0xbc, 0x66, 0xfc, 0xd8, 0xbf, - 0x08, 0x22, 0x13, 0x3f, 0x21, 0xb5, 0xcc, 0x44, 0xda, 0xc2, 0x62, 0x9c, 0x9a, 0x50, 0x77, 0x1d, - 0x4c, 0x0d, 0x6b, 0x6b, 0x46, 0xf8, 0xa8, 0xaa, 0xdf, 0x82, 0x75, 0x81, 0x7a, 0x54, 0x9d, 0x59, - 0x3a, 0x02, 0xbd, 0x1a, 0xb9, 0x09, 0x6b, 0xe2, 0xd4, 0x92, 0xd9, 0xcc, 0x0f, 0xf3, 0xf2, 0x10, - 0x5b, 0x4b, 0x5d, 0x15, 0x01, 0x17, 0x24, 0x45, 0xbe, 0x93, 0xa3, 0x72, 0xe1, 0x8e, 0x87, 0x16, - 0x77, 0x03, 0xff, 0x9d, 0xac, 0xa5, 0x50, 0xec, 0x8b, 0x9e, 0x35, 0xc3, 0x81, 0x35, 0x67, 0x58, - 0x25, 0x1a, 0x30, 0x11, 0xad, 0xae, 0x1e, 0x76, 0x96, 0xb0, 0x68, 0xa3, 0x89, 0xd0, 0xf4, 0xd8, - 0x05, 0x57, 0x61, 0xd0, 0x2f, 0xa1, 0xa1, 0xa1, 0x3c, 0xc3, 0x40, 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0x49, 0x62, 0x74, - 0x91, 0x5a, 0x4b, 0x5b, 0xad, 0x45, 0x47, 0xf3, 0x44, 0x66, 0x2b, 0x07, 0x99, 0xb3, 0x69, 0x72, - 0x31, 0x99, 0x25, 0x92, 0xdd, 0x4e, 0x9e, 0x41, 0x51, 0xaf, 0x1b, 0x64, 0x43, 0x2b, 0x25, 0x37, - 0x92, 0xd6, 0x66, 0x5a, 0xac, 0x6f, 0x76, 0xa0, 0x12, 0x63, 0xff, 0x59, 0xfc, 0xd9, 0x17, 0x61, - 0x56, 0x85, 0x34, 0xcd, 0x3e, 0x36, 0x90, 0x74, 0xaa, 0xf1, 0x77, 0x98, 0xcc, 0x52, 0xcd, 0x3e, - 0xce, 0xb3, 0x24, 0x32, 0xaf, 0x28, 0xda, 0x39, 0x85, 0xd5, 0x24, 0xe7, 0xe0, 0x0b, 0x72, 0x0d, - 0x6b, 0x29, 0x63, 0xb7, 0x3f, 0xcb, 0x69, 0xe4, 0xb9, 0xfa, 0xdb, 0x7a, 0xae, 0xfe, 0x90, 0x12, - 0x12, 0x6b, 0x84, 0xc8, 0xc2, 0x5a, 0x42, 0xa6, 0xee, 0xed, 0x18, 0x18, 0x4b, 0x17, 0xff, 0x72, - 0xa5, 0xc6, 0x8c, 0xfc, 0x27, 0x52, 0x5e, 0x3c, 0x9a, 0xad, 0xff, 0x5e, 0x7b, 0xae, 0x0c, 0xf7, - 0x97, 0xe5, 0xbf, 0xea, 0xa7, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x86, 0xfc, 0xda, 0xe9, 0x62, - 0x0f, 0x00, 0x00, + // 1535 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x57, 0x5d, 0x6f, 0x13, 0x57, + 0x13, 0xc6, 0xdf, 0xf6, 0xd8, 0x4e, 0xec, 0x93, 0x2f, 0xc7, 0xc0, 0xfb, 0xf2, 0xae, 0x00, 0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, 0x4a, 0xa7, 0x75, 0xeb, 0x33, 0x68, 0x1c, 0x79, 0xef, 0x86, + 0x3c, 0x40, 0xed, 0xfd, 0xc1, 0x60, 0x42, 0x19, 0x23, 0x04, 0x60, 0x3c, 0xed, 0xbf, 0xa2, 0xb3, + 0x43, 0x11, 0x86, 0xb8, 0x5d, 0x11, 0x71, 0x0f, 0x43, 0xa6, 0x42, 0xad, 0x58, 0x3f, 0x66, 0x60, + 0x55, 0x84, 0xf0, 0xb5, 0x13, 0xcc, 0x4c, 0x66, 0x4f, 0xa1, 0x26, 0x0c, 0x9c, 0x85, 0xfb, 0xa3, + 0x70, 0x1a, 0x88, 0x0c, 0x73, 0x3b, 0xd5, 0xce, 0xce, 0x9e, 0x84, 0x61, 0x2f, 0xa1, 0xbd, 0x17, + 0x55, 0x3d, 0x08, 0xf8, 0x64, 0xd6, 0x7e, 0x08, 0xcd, 0x94, 0x50, 0x00, 0xf4, 0x9e, 0xce, 0x74, + 0x0c, 0x75, 0x28, 0x7c, 0x70, 0xfc, 0x29, 0x55, 0x78, 0x3d, 0xce, 0x3e, 0xca, 0x58, 0x37, 0xa0, + 0xb1, 0xb0, 0xac, 0xe0, 0x10, 0xa1, 0xce, 0xd3, 0xae, 0x58, 0xf7, 0x95, 0x46, 0x17, 0x91, 0x61, + 0x91, 0x22, 0x38, 0xe8, 0x4a, 0x9b, 0x5d, 0x81, 0xa2, 0xa3, 0x42, 0x96, 0x76, 0xad, 0xff, 0x41, + 0x33, 0x72, 0x63, 0xa9, 0xd1, 0x9f, 0x33, 0xd0, 0x3c, 0xa6, 0x17, 0x1a, 0x30, 0x63, 0xb6, 0x83, + 0x3a, 0xb3, 0x31, 0x95, 0x3a, 0x2b, 0x9d, 0x9b, 0x3a, 0xf3, 0x94, 0xde, 0x9e, 0xfe, 0x3c, 0x43, + 0x5d, 0xeb, 0x04, 0xaa, 0x91, 0x4f, 0xb2, 0x05, 0x6b, 0x6f, 0x5f, 0x9e, 0x1d, 0x1f, 0x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x53, 0xcc, 0x8d, 0x73, 0x9f, 0x0e, 0xec, 0x3e, 0x55, 0x47, 0x45, 0x79, 0x64, 0x41, + 0x7d, 0x4c, 0xd5, 0x33, 0x1b, 0x72, 0xdf, 0x65, 0xad, 0x92, 0xec, 0xf8, 0xaa, 0x46, 0x4d, 0x66, + 0xbe, 0x06, 0xd5, 0x60, 0x3a, 0xb2, 0xa7, 0xe3, 0x81, 0xc3, 0x29, 0x6b, 0x95, 0xf1, 0x62, 0xde, + 0xfa, 0x3d, 0x03, 0x79, 0x01, 0x9c, 0x78, 0x92, 0xbe, 0xc1, 0x76, 0x91, 0x4a, 0x04, 0x46, 0x91, + 0x44, 0x21, 0x5a, 0xbc, 0x9c, 0xd4, 0x40, 0x40, 0xfb, 0x33, 0xb4, 0x27, 0x48, 0x81, 0xcb, 0x04, + 0xf2, 0x0b, 0xd9, 0x84, 0xba, 0x1f, 0x64, 0xf0, 0x79, 0x91, 0x3d, 0x73, 0xb8, 0xd2, 0x52, 0x31, + 0x6b, 0x89, 0xd4, 0x29, 0x49, 0x09, 0x1a, 0xf7, 0x82, 0x3e, 0x16, 0x64, 0x20, 0xa3, 0x2b, 0x93, + 0xdb, 0x08, 0x99, 0x42, 0x92, 0xb5, 0x2a, 0x32, 0xa3, 0x75, 0x9d, 0x51, 0xac, 0x08, 0x16, 0x11, + 0xcc, 0xc1, 0x64, 0x07, 0x98, 0xce, 0xb6, 0xee, 0x41, 0x33, 0x22, 0xd3, 0x6d, 0xd1, 0x86, 0x82, + 0xc8, 0x87, 0x69, 0x46, 0x30, 0xf8, 0x08, 0x25, 0xab, 0x01, 0x2b, 0x2f, 0x28, 0x7f, 0x19, 0x9c, + 0x87, 0xc6, 0xc4, 0x4f, 0x48, 0x2d, 0x73, 0x91, 0xb6, 0xb0, 0x1c, 0xa7, 0x16, 0x34, 0xbc, 0x01, + 0xa6, 0x86, 0xb5, 0xb5, 0x0d, 0x3e, 0xaa, 0xea, 0xd7, 0x60, 0x5d, 0xa0,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xdd, 0xdb, 0xc9, 0x60, 0x2c, 0x3d, 0xfc, 0x0b, 0x96, 0x78, 0x6d, 0xe4, + 0x3f, 0x46, 0x79, 0xf9, 0x0b, 0x6d, 0xff, 0xf7, 0xd2, 0x73, 0x65, 0xb8, 0x5f, 0x94, 0xff, 0xb2, + 0x1f, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x68, 0x21, 0x22, 0x40, 0x72, 0x0f, 0x00, 0x00, } diff --git a/lnrpc/rpc.proto b/lnrpc/rpc.proto index 86d25dad..c2fccfc1 100644 --- a/lnrpc/rpc.proto +++ b/lnrpc/rpc.proto @@ -222,11 +222,11 @@ message WalletBalanceResponse { double balance = 1; } -message RTChannel { +message RoutingTableLink { string id1 = 1; string id2 = 2; - string edgeID = 3; - double capacity = 4; + string outpoint = 3; + int64 capacity = 4; double weight = 5; } @@ -234,5 +234,5 @@ message ShowRoutingTableRequest { } message ShowRoutingTableResponse { - repeated RTChannel channels = 1; + repeated RoutingTableLink channels = 1; } diff --git a/lnwire/neighbor_ack.go b/lnwire/neighbor_ack.go index 8f6ea453..c2888325 100644 --- a/lnwire/neighbor_ack.go +++ b/lnwire/neighbor_ack.go @@ -7,6 +7,7 @@ package lnwire import ( "fmt" "io" + "bytes" ) type NeighborAckMessage struct { @@ -27,12 +28,21 @@ func (msg *NeighborAckMessage) Encode(w io.Writer, pver uint32) error { } func (msg *NeighborAckMessage) Decode(r io.Reader, pver uint32) error { + buff := make([]byte, 18) + _, err := r.Read(buff) + if err != nil { + return err + } + if !bytes.Equal(buff, []byte("NeighborAckMessage")) { + fmt.Errorf("Can't decode NeighborAckMessage message") + } return nil } func (msg *NeighborAckMessage) MaxPayloadLength(uint32) uint32 { - // Some random number. Transmission functions work bad if it is 0 - return 100 + // Length of the string "NeighborAckMessage" used in Encode + // Transmission functions work bad if it is 0 + return 18 } diff --git a/rpcserver.go b/rpcserver.go index 7a0f8904..621958af 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -512,15 +512,15 @@ func (r *rpcServer) ShowRoutingTable(ctx context.Context, in *lnrpc.ShowRoutingTableRequest) (*lnrpc.ShowRoutingTableResponse, error) { rpcsLog.Debugf("[ShowRoutingTable]") rtCopy := r.server.routingMgr.GetRTCopy() - channels := make([]*lnrpc.RTChannel, 0) + channels := make([]*lnrpc.RoutingTableLink, 0) for _, channel := range rtCopy.AllChannels() { channels = append(channels, - &lnrpc.RTChannel{ - Id1: channel.Id1.String(), - Id2: channel.Id2.String(), - EdgeID: channel.EdgeID.String(), - Capacity: channel.Info.Capacity(), - Weight: channel.Info.Weight(), + &lnrpc.RoutingTableLink{ + Id1: channel.Id1.String(), + Id2: channel.Id2.String(), + Outpoint: channel.EdgeID.String(), + Capacity: channel.Info.Capacity(), + Weight: channel.Info.Weight(), }, ) }