From d48c10f7e2d93bd0ccbfccc8b682f5d9b4a9ffa1 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Wed, 12 Dec 2018 18:12:54 -0600 Subject: [PATCH] update some documentation, fix links in map, replace pointless version with coords field --- README.md | 2 +- web/graphPlotter.py | 6 +++--- web/static/network.js | 2 +- web/templates/about.html | 2 +- web/updateGraph.py | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fe09a27..1067e46 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Forked from the code for http://www.fc00.org (http://h.fc00.org on Hyperboria). ## Sending your view of the network -This code reads a map of known nodes from `y.yakamo.org:3000/current` (reachable over yggdrasil). In order to display an accurate map of the network, we need your help. If you run a yggdrasil node, plase send your network view using the [send-view.py](https://github.com/yakamok/Niflheim-api/blob/master/send-view.py) script. +This code reads a map of known nodes from `y.yakamo.org:3000/current` (reachable over yggdrasil). You may alternatively generate your own view of the network by running [a crawler script](scripts/crawl-dht.py), but this may take some time (figuring out how to run it and use the results is left as an exercise to the user). ## Web server ```bash diff --git a/web/graphPlotter.py b/web/graphPlotter.py index 53c882d..078c99b 100644 --- a/web/graphPlotter.py +++ b/web/graphPlotter.py @@ -8,10 +8,10 @@ def position_nodes(nodes, edges): G = pgv.AGraph(strict=True, directed=False, size='10!') for n in nodes.values(): - G.add_node(n.coords, label=n.ip, version=n.version) + G.add_node(n.ip, label=n.label, coords=n.coords) for e in edges: - G.add_edge(e.a.coords, e.b.coords, len=1.0) + G.add_edge(e.a.ip, e.b.ip, len=1.0) G.layout(prog='neato', args='-Gepsilon=0.0001 -Gmaxiter=100000') @@ -66,7 +66,7 @@ def get_graph_json(G): 'id': n.name, 'label': name if name else n.attr['label'], 'name': name, - 'version': n.attr['version'], + 'coords': n.attr['coords'], 'x': float(pos[0]), 'y': float(pos[1]), 'color': _gradient_color(neighbor_ratio, [(100, 100, 100), (0, 0, 0)]), diff --git a/web/static/network.js b/web/static/network.js index 235f430..21568a9 100644 --- a/web/static/network.js +++ b/web/static/network.js @@ -174,7 +174,7 @@ function showNodeInfo(node) { '

' + node.label + '

' + '' + node.id + '
' + '
' + - 'Version: ' + node.version + '
' + + 'Coords: ' + node.coords + '
' + 'Peers: ' + node.peers.length + '
' + 'Centrality: ' + node.centrality + '
' + '' + diff --git a/web/templates/about.html b/web/templates/about.html index f6f4b4c..d179e57 100644 --- a/web/templates/about.html +++ b/web/templates/about.html @@ -8,7 +8,7 @@

Network map

-

The network page has a map of Yggdrasil's spanning tree as it is now. The map is not complete since it is hard/impossible to get a full picture of the network, and it only includes the minimum subset of links needed to construct the spanning tree. The known nodes and tree coordinates are taken from Yakamo's API. You can submit your node's view of the network by periodically running send-view.py.

+

The network page has a map of Yggdrasil's spanning tree as it is now. The map is not complete since it is hard/impossible to get a full picture of the network, and it only includes the minimum subset of links needed to construct the spanning tree. The known nodes and tree coordinates are taken from Yakamo's API.