Code Monkey home page Code Monkey logo

yggdrasil-map's Introduction

Yggdrasil map

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). You may alternatively generate your own view of the network by running a crawler script, 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

git clone https://github.com/Arceliar/yggdrasil-map.git
sudo apt-get install python-flask python-flup python-mysqldb python-pygraphviz python-networkx

cd yggdrasil-map/web
cp web_config.example.cfg web_config.cfg
python web.py

You would need to edit web.py to adjust the address/port the server listens on, and may want to edit the web_config.cfg file. Note that most of the options in web_config.cfg are unused after forking from the fc00.org code, so this is mostly just a workaround until we have time to clean up this code.

Run web/updateGraph.py periodically to rerender nodes graph. You may want to customize reverse-proxy IP retrieval logic in web.py.

Web server with Docker

1. Copy files from contrib/Docker/ to your folder of choice.

2. Build image

Example folder is /docker/yggdrasil/map

sudo docker build -t Arceliar/yggdrasil-map /docker/yggdrasil/map/

3. Create container

Run with using Docker host network

sudo docker run --name yggdrasil-map -d --net host --restart always Arceliar/yggdrasil-map

You can also use other Docker networks

sudo docker run --name yggdrasil-map -d --net local --ip 10.254.1.3 --ip6 fd80:deaf:1::3 --mac-address 02:42:01:00:00:03 -e HOST=fd80:deaf:1::3 -e PORT=80 --restart always Arceliar/yggdrasil-map

yggdrasil-map's People

Contributors

arceliar avatar cwchristerw avatar interfect avatar izzette avatar kpcyrd avatar kyrias avatar progval avatar randati avatar vdloo avatar zielmicha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yggdrasil-map's Issues

crawel.py: TypeError: argument of type 'NoneType' is not iterable

$sudo python2 crawl.py 
{"yggnodes": {
"000000003718d2775a9d3cbb25d932f8a4db72d169ca99321270dc8f57ad5c4b": {"peers": ["000000004d995b978cb4f3a6f60a1a6290209abad65109b8006718fd0f9abbea", "0000000087ee9949eeab56bd430ee8f324cad55abf3993ed9b9be63ce693e18a", "3fec05758b2a4b2813ad5d44d9fa376ad8e97b40c703a39c6b5298f51d8dff85", "ac9f05534062a32ba3f715da23b60f1870d9bcc3d83609e86367b26220162ee0", "00000104ee097472631b0a5cfbf6e94feeb45fcf46b229f079e3df534d4452f9", "00000044887a2984ed2765b8aa03221f47bda3ea7f97210563f918e4ca3d3f18", "e32edba9ac30b2717218a1a2bc73003a43db4fc16e8238d2c3b78cfd65369a93", "0000000002243079eba5a6b72d20f7ef79c363a5575b10dd7ee807366a4fa65d", "690000e796ca062b16fc10821fb28be52750a4563b7f2d24ec8a62f71505710a"], "nodeinfo": {}, "address": "222:4739:6c45:2b16:1a26:d136:683a:d924", "coords": "[2 81 1 74]", "time": 1648228137.155251, "dht": ["513dacc17142b5cd8f3e5fe73d24f303de7486623fb19b7a220fb2028ef4c29a", "000000003befe1c551192f28ba22dbf225743b8c5383218572e239affb231c70", "000000003718d2775a9d3cbb25d932f8a4db72d169ca99321270dc8f57ad5c4b"]},
"00000104ee097472631b0a5cfbf6e94feeb45fcf46b229f079e3df534d4452f9": {"peers": ["00000002e71368e36f2fae8fe437e09f935dcf69ee08dc00afe02ad7eae2f5f7", "0000000087ee9949eeab56bd430ee8f324cad55abf3993ed9b9be63ce693e18a", "00000044887a2984ed2765b8aa03221f47bda3ea7f97210563f918e4ca3d3f18", "000000003718d2775a9d3cbb25d932f8a4db72d169ca99321270dc8f57ad5c4b", "000000351c92ef0dfc77d5b70151fa1de8c78b1b1cf1299a727c9f8fe70c7351", "0000000002243079eba5a6b72d20f7ef79c363a5575b10dd7ee807366a4fa65d", "000000004d995b978cb4f3a6f60a1a6290209abad65109b8006718fd0f9abbea", "0000000087ee9949eeab56bd430ee8f324cad55abf3993ed9b9be63ce693e18a", "690000e796ca062b16fc10821fb28be52750a4563b7f2d24ec8a62f71505710a"], "nodeinfo": {"buildname": "yggdrasil", "buildarch": "amd64", "buildplatform": "linux", "buildversion": "0.4.3", "name": "fourth.mk16.de"}, "address": "217:fb11:f68b:8d9c:e4f5:a304:916:b011", "coords": "[2 169 96 141]", "time": 1648228137.397441, "dht": ["00000111e77a96581eef71a1fed49954ece4e690fdc11c73cde0b6c11772b64b", "00000104ee097472631b0a5cfbf6e94feeb45fcf46b229f079e3df534d4452f9"]}Traceback (most recent call last):
  File "crawl.py", line 97, in <module>
    handleNodeInfoResponse(k, doRequest(getNodeInfoRequest(k)))
  File "crawl.py", line 60, in handleNodeInfoResponse
    if 'response' in peerInfo:
TypeError: argument of type 'NoneType' is not iterable

$python2 --version
Python 2.7.18

crawler.go: panic: unexpected end of JSON input

$sudo go run crawler.go
[some json]
panic: unexpected end of JSON input

goroutine 720 [running]:
main.doRequest(0x5022e0)
	/home/bandura/Downloads/crawler.go:57 +0x1bb
main.getPeers(...)
	/home/bandura/Downloads/crawler.go:79
main.doRumor.func1()
	/home/bandura/Downloads/crawler.go:126 +0x772
created by main.doRumor
	/home/bandura/Downloads/crawler.go:93 +0x9d
exit status 2

$go version
go version go1.17.8 linux/amd64

[feature request] Scrollbar in "nodes list" panel

"Search panel" placed at top-right of page.
If I press to central node (bifrost), this panel show list of nodes, which connecteed to selected node.
If nodes list more then screen size, then list of nodes resize page size, but image of map still limited to screen size and moved with list.

I want scrolling feature for "nodes list" part of search panel.

Timeline

I think it would be nice to have timeline which you can search different stages of network. Yakamo's API need changes because it would have to be possible to search different timestamps.

Clickable IPv6 links

Example Node:
201:a635:d55c:109e:1f54:d9cc:387e:7963
200:c00f:c8a1:2e17:b7b3:b90:3a72:ffed

Link should not be, because they cannot be clicked when wanting to follow nodelist
http://[21f:dd73:7cdb:773b:a924:7ec0:800b:221e]/#[2%2013]
(aka #[2 13])

it should be like in fc00.org, because it makes possible to click from ipv6 on list
http://[21f:dd73:7cdb:773b:a924:7ec0:800b:221e]/#201:a635:d55c:109e:1f54:d9cc:387e:7963
(aka #201:a635:d55c:109e:1f54:d9cc:387e:7963)

[feature request] Add button "Where I am", which navigate to own node in map

I want a quick way to navigate to my node, represented on the map.
Now, I can do it by copy my IP address from ygg interface (or "yggdrasilctl getself") and paste it to "search line".

I want button, which helps me to do it without needs to find and copy/paste my IP.

I want button like "Where I am" (or "My node", or "Show my node", or "Navigate to my node") in top-level menu (top line of page) or in search-box (top-right panel).

Why nodes form circles

Hello,

Just a general question, but why do the nodes form general concentric circles. What is the reasoning for this?

Thanks

Crawler script does not work

crawl-dht.py does not work. If I try to run, it will give an error:

Traceback (most recent call last):
  File "crawler.py", line 57, in <module>
    for k,v in selfInfo['response']['self'].iteritems(): rumored[k] = v
TypeError: 'NoneType' object has no attribute '__getitem__'

Сommand that I run it: python2.7 crawl-dht.py.

Issue with running

Traceback (most recent call last):
File "updateGraph.py", line 82, in
generate_graph()
File "updateGraph.py", line 33, in generate_graph
response = urllib.urlopen(url)
File "/usr/lib/python2.7/urllib.py", line 87, in urlopen
return opener.open(url)
File "/usr/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 350, in open_http
h.endheaders(data)
File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 821, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
IOError: [Errno socket error] [Errno 110] Connection timed out

My instance have not got any updates and have been stale. I updated Docker image and after that running code fails.

Docker Support

I'm going to make Dockerfile to run map on my network 😄

[Feature Request] Increase readability

It would be better to increase length of the lines between nodes to make map more readable. Originally map had less nodes and it was more readable with current settings but if one node has too many nodes connected to it, its harder to read map.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.