Coder Social home page Coder Social logo

jouir / flexassistant Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 248 KB

Telegram bot to notify for Flexpool mined or farmed blocks, unpaid balance and transactions

License: The Unlicense

Makefile 1.76% Go 98.24%
chia ethereum flexpool go telegram

flexassistant's People

Contributors

jouir avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

flexassistant's Issues

Payment notification not sent for my ETH wallet

Debug log:

DEBU[0000] Deleting inactive workers                    
DEBU[0000] Connected to Telegram as **redacted** 
DEBU[0000] Fetching payments for Miner<**redacted**> 
DEBU[0000] Requesting https://api.flexpool.io/v2/miner/payments/?coin=eth&address=**redacted**&page=0 
DEBU[0000] Requesting https://api.flexpool.io/v2/miner/payments/?coin=eth&address=**redacted**&page=1 
WARN[0000] Could not fetch payments: Flexpool API error: Page out of range

The last payment timestamp is 0:

sqlite> select last_payment_timestamp from miners where address = '**redacted**';
0

I don't have this issue with my XCH wallet:

DEBU[0000] Fetching payments for Miner<**redacted**> 
DEBU[0000] Requesting https://api.flexpool.io/v2/miner/payments/?coin=xch&address=**redacted**&page=0 
DEBU[0000] Fetched Payment<**redacted**> 
DEBU[0000] Fetched Payment<**redacted**> 
DEBU[0000] Fetched Payment<**redacted**> 
DEBU[0000] Fetched Payment<**redacted**> 
DEBU[0000] Fetched Payment<**redacted**>

Add workers notifications

Register workers' state then notify when it changes.
Update workers every time they have been discovered on the API to keep them alive.
Remove workers not updated since 1 week (and make it configurable).

File templates are considered as embedded templates

With customblock.tmpl file:

๐ŸŽ‰ *{{ if (eq .Pool.Coin "xch") }}Farmed{{ else }}Mined{{ end }}* [#{{ .Block.Number }}]({{ formatBlockURL .Pool.Coin .Block.Hash }}) _{{ printf "%.6f" (convertCurrency .Pool.Coin .Block.Reward) }} {{ upper .Pool.Coin }}_

And notification templates in the configuration file:

notification-templates:
  block: customblock.tmpl

When a new block is detected, flexassistant fails to send the notification:

DEBU[0000] Parsing embeded template file customblock.tmpl 
WARN[0000] Cannot send notification: parse failed: template: pattern matches no files: `customblock.tmpl` 

Because it tried to parse an embedded template instead of a file template.

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.