Server to collect DHT views from yggdrasil nodes and store in a data base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
893 B

6 years ago
# niflheim-api.py
6 years ago
6 years ago
Niflheim-api provides both a web interface and an api. The web interface is used to see some basic stats on the data vserv.py has collected and the API provides raw data in JSON format.
6 years ago
6 years ago
## Install & Setup
6 years ago
Install the following python packages either via your package manager or Pip:
6 years ago
flask
flask_restful
psycopg2
6 years ago
6 years ago
Configure niflheim-api.py to use the Postgres databse you setup for vserv.py.
6 years ago
6 years ago
__So open niflheim-api.py:__
6 years ago
DB_PASSWORD = "password"
DB_USER = "yggindex"
DB_NAME = "yggindex"
DB_HOST = "localhost"
5 years ago
Make sure the above matches what you have in the crawler.
6 years ago
The API will startup on port 3000 and accept all ipv6 connections if you want to change this edit the last line:
app.run(host='::', port=3000)
6 years ago
6 years ago
__Accessing the API data:__
6 years ago
http://exmaple.com:3000/current
Add yggapi.services to systemd.