Archived
1
0
Fork 0
Telegram bot to notify for Flexpool mined or farmed blocks, unpaid balance and transactions
This repository has been archived on 2024-12-18. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Julien Riou eccb06383b
chore: Bump to 1.3
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-10-15 18:23:27 +02:00
migrations fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
static feat: Initial release (1.0) 2021-10-06 19:07:41 +02:00
templates feat: Add notification templates (#2) 2021-10-13 15:09:59 +02:00
.gitignore feat: Initial release (1.0) 2021-10-06 19:07:41 +02:00
client.go fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
config.go feat: Add notification templates (#2) 2021-10-13 15:09:59 +02:00
db.go feat: Add offline/online workers notifications (#1) 2021-10-10 20:56:50 +02:00
flexassistant.yaml.example feat: Add notification templates (#2) 2021-10-13 15:09:59 +02:00
go.mod feat: Add notification templates (#2) 2021-10-13 15:09:59 +02:00
go.sum feat: Add notification templates (#2) 2021-10-13 15:09:59 +02:00
LICENSE Initial commit 2021-09-29 16:00:24 +02:00
main.go fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
Makefile docs: Update Makefile and README for release 2021-10-06 19:12:49 +02:00
miner.go fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
notification.go feat: Add notification templates (#2) 2021-10-13 15:09:59 +02:00
pool.go fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
README.md style: Set max line to 120 chars in the README 2021-10-13 15:25:50 +02:00
UPGRADES.md fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
utils.go fix: Convert big integers to float64 2021-10-15 18:22:48 +02:00
VERSION chore: Bump to 1.3 2021-10-15 18:23:27 +02:00

flexassistant

Flexpool.io is a famous cryptocurrency mining or farming pool supporting Ethereum and Chia blockchains. As a miner, or a farmer, we like to get notified when a block is mined, or farmed. We also like to keep track of our unpaid balance and our transactions to our personal wallet.

flexassistant is a tool that parses the Flexpool API and sends notifications via Telegram.

Installation

Note: this guide has been written with Linux x86_64 in mind.

Binaries

Go to Releases to download the binary in the version you like (latest is recommended) into a bin directory.

Write checksum information to a local file:

echo checksum > flexassistant-VERSION-Linux-x86_64.sha256sum

Verify checksums to avoid binary corruption:

sha256sum -c flexassistant-VERSION-Linux-x86_64.sha256sum

Compilation

You will need to install Go, Git and a development toolkit (including make) for your environment.

Then, you'll need to download and compile the source code:

git clone https://github.com/jouir/flexassistant.git
cd flexassistant
make

The binary will be available under the bin directory:

ls -l bin/flexassistant

Configuration

flexassistant can be configured using a YaML file. By default, the flexassistant.yaml file is used but it can be another file provided by the -config argument.

As a good start, you can copy the configuration file example:

cp -p flexassistant.yaml.example flexassistant.yaml

Then edit this file at will.

Reference:

  • database-file (optional): file name of the database file to persist information between two executions (SQLite database)
  • max-blocks (optional): maximum number of blocks to retreive from the API
  • max-payments (optional): maximum number of payments to retreive from the API
  • pools (optional): list of pools
    • coin: coin of the pool (ex: eth, xch)
    • enable-blocks (optional): enable block notifications for this pool (disabled by default)
  • miners (optional): list of miners and/or farmers
    • address: address of the miner or the farmer registered on the API
    • enable-balance (optional): enable balance notifications (disabled by default)
    • enable-payments (optional): enable payments notifications (disabled by default)
    • enable-offline-workers (optional): enable offline/online notifications for associated workers (disabled by default)
  • telegram: Telegram configuration
    • token: token of the Telegram bot
    • chat-id (optional if channel-name is present): chat identifier to send Telegram notifications
    • channel-name (optional if chat-id is present): channel name to send Telegram notifications
  • notification-templates (optional): path to template files for each notification type
    • balance (optional): path to template file to format balance notifications
    • payment (optional): path to template file to format payment notifications
    • block (optional): path to template file to format block notifications
    • offline-worker (optional): path to template file to format offline worker notifications

Templating

Notifications can be customized with templating.

The following functions are available to templates:

  • upper(str string): convert string to upper case
  • lower(str string): convert string to lower case
  • convertCurrency(coin string, value int64): convert the smallest unit of a coin to a human readable unit
  • convertAction(coin string): return "Farmed" word for Chia coin or "Mined" for other coins
  • formatBlockURL(coin string, hash string): return the URL on the explorer website of the coin of the block identified by its hash
  • formatTransactionURL(coin string, hash string): return the URL on the explorer website of the coin of the transaction identified by its hash

The following data is available to templates:

  • balance: .Miner
  • payment: .Miner, .Payment
  • block: .Pool, .Block
  • offline-worker: .Worker

Default templates are available in the templates directory.

Custom template files can be used with the notification-templates settings (see Configuration section).

Usage

Usage of ./flexassistant:
  -config string
        Configuration file name (default "flexassistant.yaml")
  -debug
        Print even more logs
  -quiet
        Log errors only
  -verbose
        Print more logs
  -version
        Print version and exit