Code Monkey home page Code Monkey logo

pls_admin's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @raskitoma
  • ๐Ÿ‘€ Iโ€™m interested in creating things to make life easier...
  • ๐ŸŒฑ Iโ€™m currently learning about... I don't know... I'm always learning...
  • ๐Ÿ” Iโ€™m looking to collaborate on any project you need to automate, etc...
  • ๐Ÿ“’ I'm not attached to one language, framework, etc. I can adapt fast... I want/like to solve problems!
  • ๐Ÿ“ซ You can reach me at [email protected]

My Stats

Raskitoma's github stats GitHub Streak

GitHub followers GitHub Stars Twitter Followers Twitch Status

Visit my website Raskitoma dot COM

pls_admin's People

Contributors

eliaspcs avatar raskitoma avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

terry-sydaus

pls_admin's Issues

docker-compose.yml modifications

I had to modify the docker-compose.yml file to the following in order to get this app working, specifically to allow the adminpls docker instance to connect to the local postgresql database. If I did not make this change, then the adminpls container could not connect to the local postgresql database.

services:
  adminpls:
    build: .
    image: adminpls:v1
    container_name: adminpls
    hostname: adminpls
    restart: always
    ports:
      - 8123:5000
    environment:
      - TZ=America/Guayaquil
      - APP_SETTINGS_MODULE=config.prod
    network_mode: "host"
    # networks setup depends on intercomm between other container stacks. Depends on declaration near the end of this file. This is optional
    # it's required if you setup a proxy reverse like nginx or connection to a DB inside the same machine
    # networks:
    #   master_network: # this is the network name

# setup other packages/services like db, proxy reverse, etc.
# setup network if required look at the "networks" section above
# networks:
#   master_network:
#     external: True

The change from the original file involves the addition of the following directive:

    network_mode: "host"

Docker compose command in README.md

The docker compose command specified in the README.md does not work.

I had to run the following command to get the docker image to build and run.

sudo docker compose up

Timestamp in postgresql database is not UTC time - problems with Grafana queries

I have noted that the time stamp in the withdrawals table/panel of the Grafana validator stats dashboard was incorrect by an amount equal to my time zone.
This problem was also observed in other panels of the Grafana validator stats dashboard (eg. Wallet Balance History panel, all 3 of the Validator Rewards bar chart panels).

I fixed the Wallet Balance History by changing the query from

SELECT 
"timeStamp", 
"index",
"blockNumber", 
"validatorIndex",
amount * $pls_precision as PLS, 
amount * $pls_precision * $pls_price as USD,
"priceUSD" as "$ at W"

FROM pls_validator_withdrawals WHERE address = '$pls_wallet'
order by 2 desc

to

SELECT 
"timeStamp" - interval 'x hour' as timeStamp, 
"index",
"blockNumber", 
"validatorIndex",
amount * $pls_precision as PLS, 
amount * $pls_precision * $pls_price as USD,
"priceUSD" as "$ at W"

FROM pls_validator_withdrawals WHERE address = '$pls_wallet'
order by 2 desc

where x equals the number of hours added by Grafana to the time stamp recorded in the postgresql database by the pls_admin app.

I implemented similar changes to the underlying queries of other affected Grafana panels that reference either a date or timestamp field from the postgresql database source.

The above query modifications are, IMHO, a hack and clumsy. It seems to me that it would be better to have the pls_admin app write UTC timestamps to the database.

Enable / Disable Cron not working

The following commands do not work:

docker exec -it adminpls enable_cron.sh

and

docker exec -it adminpls disable_cron.sh

I ran the following command instead to keep the db synced.

docker exec -it adminpls python3 -m flask scheduler

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.