jouir / flexassistant Goto Github PK
View Code? Open in Web Editor NEWTelegram bot to notify for Flexpool mined or farmed blocks, unpaid balance and transactions
License: The Unlicense
Telegram bot to notify for Flexpool mined or farmed blocks, unpaid balance and transactions
License: The Unlicense
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**>
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).
Use text/template to customize each notification messages.
It'd be great to have a --test switch to send a test notification with each template, to make editing/testing easier.
The flexassistant.example.yaml has a typo for offline-workers template.
In the README, the Telegram setup miss the distinction between public and private channels.
See restockbot documentation.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.