mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-22 05:50:29 +00:00
update some documentation, fix links in map, replace pointless version with coords field
This commit is contained in:
parent
96cf6caabc
commit
d48c10f7e2
@ -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
|
## 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
|
## Web server
|
||||||
```bash
|
```bash
|
||||||
|
@ -8,10 +8,10 @@ def position_nodes(nodes, edges):
|
|||||||
G = pgv.AGraph(strict=True, directed=False, size='10!')
|
G = pgv.AGraph(strict=True, directed=False, size='10!')
|
||||||
|
|
||||||
for n in nodes.values():
|
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:
|
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')
|
G.layout(prog='neato', args='-Gepsilon=0.0001 -Gmaxiter=100000')
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ def get_graph_json(G):
|
|||||||
'id': n.name,
|
'id': n.name,
|
||||||
'label': name if name else n.attr['label'],
|
'label': name if name else n.attr['label'],
|
||||||
'name': name,
|
'name': name,
|
||||||
'version': n.attr['version'],
|
'coords': n.attr['coords'],
|
||||||
'x': float(pos[0]),
|
'x': float(pos[0]),
|
||||||
'y': float(pos[1]),
|
'y': float(pos[1]),
|
||||||
'color': _gradient_color(neighbor_ratio, [(100, 100, 100), (0, 0, 0)]),
|
'color': _gradient_color(neighbor_ratio, [(100, 100, 100), (0, 0, 0)]),
|
||||||
|
@ -174,7 +174,7 @@ function showNodeInfo(node) {
|
|||||||
'<h2>' + node.label + '</h2>' +
|
'<h2>' + node.label + '</h2>' +
|
||||||
'<span class="tt">' + node.id + '</span><br>' +
|
'<span class="tt">' + node.id + '</span><br>' +
|
||||||
'<br>' +
|
'<br>' +
|
||||||
'<strong>Version:</strong> ' + node.version + '<br>' +
|
'<strong>Coords:</strong> ' + node.coords + '<br>' +
|
||||||
'<strong>Peers:</strong> ' + node.peers.length + '<br>' +
|
'<strong>Peers:</strong> ' + node.peers.length + '<br>' +
|
||||||
'<strong>Centrality:</strong> ' + node.centrality + '<br>' +
|
'<strong>Centrality:</strong> ' + node.centrality + '<br>' +
|
||||||
'<table>' +
|
'<table>' +
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<br>
|
<br>
|
||||||
|
|
||||||
<h3>Network map</h3>
|
<h3>Network map</h3>
|
||||||
<p>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 <a href="http://y.yakamo.org:3000/">Yakamo's API</a>. You can submit your node's view of the network by periodically running <a href="https://github.com/yakamok/Niflheim-api/blob/master/send-view.py">send-view.py</a>.</p>
|
<p>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 <a href="http://y.yakamo.org:3000/">Yakamo's API</a>.</p>
|
||||||
<!--
|
<!--
|
||||||
<h3>Node names</h3>
|
<h3>Node names</h3>
|
||||||
<p>For now, node names are assigned manually. You can submit Pull Request to <a href="https://github.com/zielmicha/nodedb">nodedb</a> if you want to have your node named.
|
<p>For now, node names are assigned manually. You can submit Pull Request to <a href="https://github.com/zielmicha/nodedb">nodedb</a> if you want to have your node named.
|
||||||
|
@ -40,6 +40,7 @@ def generate_graph(time_limit=60*60*3):
|
|||||||
nodes = dict()
|
nodes = dict()
|
||||||
def addAncestors(info):
|
def addAncestors(info):
|
||||||
parent = NodeInfo("?", info.getParent())
|
parent = NodeInfo("?", info.getParent())
|
||||||
|
parent.label = "{} {}".format(parent.ip, parent.coords)
|
||||||
nodes[parent.coords] = parent
|
nodes[parent.coords] = parent
|
||||||
if parent.coords != parent.getParent(): addAncestors(parent)
|
if parent.coords != parent.getParent(): addAncestors(parent)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user