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.
This commit is contained in:
BitfuryLightning
2016-08-21 17:46:54 +03:00
parent d8bceb16f9
commit 2bcff188e8
8 changed files with 347 additions and 166 deletions

View File

@@ -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(),
},
)
}