1
0
Fork 0
The cryptocurrency mining pool companion. Be notified for new blocks, new balance and new payments.
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 9d75604869
Parametrize Flexpool tests
Signed-off-by: Julien Riou <julien@riou.xyz>
2021-02-16 09:29:55 +01:00
companion Add fiat conversion to payments on Flexpool 2021-02-15 16:55:22 +01:00
requirements Add initial flexpool tests 2021-02-15 16:49:24 +01:00
tests Parametrize Flexpool tests 2021-02-16 09:29:55 +01:00
.gitignore Add "state" tests 2021-02-12 09:43:38 +01:00
.pre-commit-config.yaml Initial commit 2021-01-22 18:00:18 +01:00
.pydocstyle Initial commit 2021-01-22 18:00:18 +01:00
config.example.json Rename tool, add ethermine and refactorization 2021-01-27 17:44:55 +01:00
Dockerfile Initial commit 2021-01-22 18:00:18 +01:00
LICENSE Initial commit 2021-01-22 17:48:37 +01:00
pytest.ini Add "state" tests 2021-02-12 09:43:38 +01:00
README.md Add "state" tests 2021-02-12 09:43:38 +01:00
requirements.txt Add "state" tests 2021-02-12 09:43:38 +01:00

mining-companion

Cryptocurrency mining interest has raised recently due to high Ethereum profitability. You can opt for the solo-mining path or use a mining pool to increase your chances to receive block rewards.

mining-companion is able to listen and notify for the following events:

  • new block is mined by the mining pool
  • unpaid balance is updated
  • new payment has been sent by the mining pool

Notifications are sent via Telegram Messenger.

Supported pools

Installation

sudo apt install python3-virtualenv
virtualenv venv
source venv/bin/activate

Pool libraries are loaded at execution time. For example, if you use only "flexpool" mining pool, you don't need to install "ethermine" libraries. Requirements files have been splitted to install only libraries you need.

pip install -r requirements/base.txt
pip install -r requirements/ethermine.txt
pip install -r requirements/flexpool.txt

To install all libraries at once:

pip install -r requirements.txt

Telegram bot

This tutorial explains how to create a Telegram bot. You'll need the chat_id and auth_key for the next section.

Configuration

Configuration file use the JSON format with the following keys:

  • pools: list of mining pools
  • miner: wallet address of the miner
  • currency: symbol of the currency to convert
  • telegram: send notifications with Telegram
    • auth_key: Telegram authentication key for the bot API
    • chat_id: Telegram chat room id (where to send the message)
  • state_file: persist data between runs into this file (default: state.json)

See configuration example.

All options are optional (but the companion would do nothing).

Usage

python3 companion/main.py --help

Contribute

Contributions are welcomed! Feel free to update the code and create a pull-request.

Be sure to lint the code and run tests before:

docker build -t pre-commit .
docker run -it -v $(pwd):/mnt/ --rm pre-commit bash
# cd /mnt/
# pip install -r requirements.txt
# pre-commit run --all-files
# pytest
# exit