mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-22 01:10:28 +00:00
commit
08aa9fcacf
@ -1,5 +1,9 @@
|
||||
# Yggdrasil map
|
||||
|
||||
* Internet: https://yggdrasil-map.cwo.fi
|
||||
* Hyperboria: https://yggdrasil-map.h.cwo.fi
|
||||
* Yggdrasil Network: https://yggdrasil-map.y.cwo.fi
|
||||
|
||||
Forked from the code for http://www.fc00.org (http://h.fc00.org on Hyperboria).
|
||||
|
||||
## Sending your view of the network
|
||||
|
@ -65,6 +65,8 @@ def get_graph_json(G):
|
||||
centrality = centralities.get(n.name, 0)
|
||||
size = 5*(1 + 1*centrality)
|
||||
name = db.get(canonalize_ip(n.name))
|
||||
# If label isn't the default value, set name to that instead
|
||||
if n.attr['label'] != n.name.split(':')[-1]: name = n.attr['label']
|
||||
|
||||
out_data['nodes'].append({
|
||||
'id': n.name,
|
||||
|
@ -8,7 +8,7 @@
|
||||
<br>
|
||||
|
||||
<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>. Node names are taken from <a href="https://github.com/yakamok/yggdrasil-nodelist">Yakamo's node list</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>. Node can be configured by setting a "name" field in <a href="https://yggdrasil-network.github.io/configuration.html">NodeInfo</a>, or from <a href="https://github.com/yakamok/yggdrasil-nodelist">Yakamo's node list</a> as a fallback.</p>
|
||||
<!--
|
||||
<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.
|
||||
|
@ -35,13 +35,14 @@ def generate_graph(time_limit=60*60*3):
|
||||
toAdd = []
|
||||
for ip in data:
|
||||
info = NodeInfo(ip, data[ip][0])
|
||||
if len(data[ip]) >= 3: info.label = data[ip][2]
|
||||
toAdd.append(info)
|
||||
|
||||
nodes = dict()
|
||||
def addAncestors(info):
|
||||
coords = info.getParent()
|
||||
parent = NodeInfo("{} {}".format("?", coords), coords)
|
||||
parent.label = "?"
|
||||
parent.label = parent.ip
|
||||
nodes[parent.coords] = parent
|
||||
if parent.coords != parent.getParent(): addAncestors(parent)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user