| | | 1 | | namespace NLightning.Client.Printers; |
| | | 2 | | |
| | | 3 | | using NLightning.Transport.Ipc.Responses; |
| | | 4 | | |
| | | 5 | | public sealed class NodeInfoPrinter : IPrinter<NodeInfoIpcResponse> |
| | | 6 | | { |
| | | 7 | | public void Print(NodeInfoIpcResponse item) |
| | 0 | 8 | | { |
| | 0 | 9 | | Console.WriteLine("Node Information:"); |
| | 0 | 10 | | Console.WriteLine(" Pubkey: {0}", item.PubKey); |
| | 0 | 11 | | Console.WriteLine(" Listening to:"); |
| | 0 | 12 | | foreach (var t in item.ListeningTo) |
| | 0 | 13 | | { |
| | 0 | 14 | | Console.WriteLine(" {0}", t); |
| | 0 | 15 | | } |
| | | 16 | | |
| | 0 | 17 | | Console.WriteLine(); |
| | 0 | 18 | | Console.WriteLine("Network Information:"); |
| | 0 | 19 | | Console.WriteLine(" Network: {0}", item.Network); |
| | 0 | 20 | | Console.WriteLine(" Best Block Height: {0}", item.BestBlockHeight); |
| | 0 | 21 | | Console.WriteLine(" Best Block Hash: {0}", item.BestBlockHash); |
| | 0 | 22 | | if (item.BestBlockTime is not null) |
| | 0 | 23 | | Console.WriteLine($" Best Block Time: {item.BestBlockTime:O}"); |
| | 0 | 24 | | Console.WriteLine(" Implementation: {0}", item.Implementation); |
| | 0 | 25 | | Console.WriteLine(" Version: {0}", item.Version); |
| | 0 | 26 | | } |
| | | 27 | | } |