mirror of
https://github.com/NeoCloud/NeoNetwork
synced 2024-12-26 10:59:24 +08:00
update peer-table to readme
This commit is contained in:
parent
2a65e8ba71
commit
6448b401df
1 changed files with 11 additions and 7 deletions
|
@ -255,13 +255,17 @@ def make_summary():
|
||||||
print("AS{:<15}{}".format(asn, name))
|
print("AS{:<15}{}".format(asn, name))
|
||||||
print()
|
print()
|
||||||
print("Peer table:")
|
print("Peer table:")
|
||||||
peers = list(iter_toml_file("peer"))
|
peers = {
|
||||||
maxUpstreamLength = max(map(lambda item: len(item[0].stem), peers))
|
item.stem: entity["to-peer"] for item, entity in iter_toml_file("peer")
|
||||||
print("{:>{}} ~ {}".format("Upstream", maxUpstreamLength, "Downstream"))
|
}
|
||||||
for item, entities in peers:
|
peers = [
|
||||||
upstream = item.stem
|
(upstream, downstream)
|
||||||
for downstream in sorted(entities["to-peer"], key=str.lower):
|
for upstream, downstream_list in peers.items()
|
||||||
print("{:>{}} ~ {}".format(upstream, maxUpstreamLength, downstream))
|
for downstream in downstream_list
|
||||||
|
]
|
||||||
|
print("{:>20} ~ {}".format("Upstream", "Downstream"))
|
||||||
|
for upstream, downstream in peers:
|
||||||
|
print("{:>20} ~ {}".format(upstream, downstream))
|
||||||
print()
|
print()
|
||||||
print("Route table:")
|
print("Route table:")
|
||||||
print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet"))
|
print("{:17}{:30}{:30}{}".format("ASN", "Name", "Prefix", "Supernet"))
|
||||||
|
|
Loading…
Reference in a new issue