- Add ETC to the list of supported coins. A new `coin` setting can be configured to avoid conflict with `eth`. Mind the lowercase. By default, flexassitant will try to deduce the coin from the miner's address (with eth by default, not etc). (#5) - Add `test` (true/false) to `notifications` section to test notifications with random values fetched from the Flexpool API - Fix typo in the configuration example (#6) BREAKING CHANGE: `notification-templates` configuration settings have been renamed to `notifications`, with sections to configure balance, payment, block and offline workers notifications, with `template` and `test` settings. Signed-off-by: Julien Riou <julien@riou.xyz> |
||
|---|---|---|
| migrations | ||
| static | ||
| templates | ||
| .gitignore | ||
| client.go | ||
| config.go | ||
| db.go | ||
| flexassistant.example.yaml | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| miner.go | ||
| notification.go | ||
| pool.go | ||
| README.md | ||
| UPGRADES.md | ||
| utils.go | ||
| VERSION | ||
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.example.yaml 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 APImax-payments(optional): maximum number of payments to retreive from the APIpools(optional): list of poolscoin: coin of the pool (ex:etc,eth,xch)enable-blocks(optional): enable block notifications for this pool (disabled by default)min-block-reward(optional): send notifications when block reward has reached this minimum threshold in crypto currency unit (ETH, XCH, etc)
miners(optional): list of miners and/or farmersaddress: address of the miner or the farmer registered on the APIcoin(optional): coin of the miner (ex:etc,eth,xch) (deduced by default, can be wrong foretccoin)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 configurationtoken: token of the Telegram botchat-id(optional ifchannel-nameis present): chat identifier to send Telegram notificationschannel-name(optional ifchat-idis present): channel name to send Telegram notifications
notifications(optional): Notifications configurationsbalance(optional): balance notifications settingstemplate(optional): path to template filetest(optional): send a test notification
payment(optional): payment notifications settingstemplate(optional): path to template filetest(optional): send a test notification
block(optional): block notification settingstemplate(optional): path to template filetest(optional): send a test notification
offline-worker(optional): offline workers notification settingstemplate(optional): path to template filetest(optional): send a test notification
Templating
Notifications can be customized with templating.
The following functions are available to templates:
upper(str string): convert string to upper caselower(str string): convert string to lower caseconvertCurrency(coin string, value int64): convert the smallest unit of a coin to a human readable unitformatBlockURL(coin string, hash string): return the URL on the explorer website of the coin of the block identified by its hashformatTransactionURL(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 template 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