Skip to content

RaulBernal/cosmos-api-endpoints

 
 

Repository files navigation

Cosmos-api-endpoints

Cosmos chains endpoints for CMC & Coingecko, etc

Config

Edit config.py with LCD & DENOM Customize endpoints if necessary

## Install python deps. pip3 install flask flask_cors requests

Run the JSON maker engine

python3 calculated_metrics.py

Run the API web server

python3 endpoints-server.py

Optional. Create systemd service files:

### Create the systemd for the Webserver:

 cd $HOME
 echo "[Unit]
 Description=endpoints-server Script
 After=network-online.target
 [Service]
 User=${USER}
 ExecStart=$(which python3) /home/raul/cosmos-api-endpoints/endpoints-server.py
 Restart=always
 RestartSec=3
 LimitNOFILE=4096
 [Install]
 WantedBy=multi-user.target
 " >endpoints-server.service

Enable and activate the endpoints-server service.

sudo mv endpoints-server.service /lib/systemd/system/
sudo systemctl enable endpoints-server.service && sudo systemctl start endpoints-server.service

Check the logs to see if everything is working correct:

sudo journalctl -fu endpoints-server -o cat

### Create the systemd for the Calculate Engine:

 cd $HOME
 echo "[Unit]
 Description=endpoints-calculate Script
 After=network-online.target
 [Service]
 User=${USER}
 ExecStart=$(which python3) /home/raul/cosmos-api-endpoints/calculated_values.py
 Restart=always
 RestartSec=3
 LimitNOFILE=4096
 [Install]
 WantedBy=multi-user.target
 " >endpoints-calculate.service

Enable and activate the endpoints-calculate service.

sudo mv endpoints-calculate.service /lib/systemd/system/
sudo systemctl enable endpoints-calculate.service && sudo systemctl start endpoints-calculate.service

Check the logs to see if everything is working correct:

sudo journalctl -fu endpoints-calculate -o cat

About

Cosmos chains endpoints for CMC & Coingecko

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 85.9%
  • HTML 14.1%