1
0
Fork 0

Make miner optional

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2021-01-25 13:13:13 +01:00
parent 792a068792
commit 71ead214b7
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7
3 changed files with 9 additions and 11 deletions

View file

@ -2,7 +2,7 @@
[Flexpool.io](https://flexpool.io) is a next-generation [Ethereum](https://ethereum.org/en/) mining pool known for their
[#STOPEIP1559](https://stopeip1559.org/) move. `flexpool-activity` is able to listen and notify when a new **block** is
mined by the pool and display the up-to-date **miner balance** and convert it to **fiat**.
mined by the pool, display the up-to-date **miner balance** and convert it to **fiat**.
## Installation
@ -21,7 +21,7 @@ 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:
* `miner`: wallet address of the miner
* `miner`: wallet address of the miner (optional)
* `currency`: symbol of the currency to convert (optional)
* `telegram`: send notifications with Telegram (optional)
* `auth_key`: Telegram authentication key for the bot API

View file

@ -22,8 +22,5 @@
"state_file": {
"type": "string"
}
},
"required": [
"miner"
]
}
}

11
main.py
View file

@ -118,11 +118,12 @@ def main():
logger.debug('saving block number to state file')
write_state(state_file, block_number=block.number)
miner = watch_miner(last_balance=state.get('balance'), address=config['miner'], config=config,
disable_notifications=args.disable_notifications, exchange_rate=exchange_rate,
currency=currency)
logger.debug('saving miner balance to state file')
write_state(state_file, miner_balance=miner.raw_balance)
if config.get('miner'):
miner = watch_miner(last_balance=state.get('balance'), address=config['miner'], config=config,
disable_notifications=args.disable_notifications, exchange_rate=exchange_rate,
currency=currency)
logger.debug('saving miner balance to state file')
write_state(state_file, miner_balance=miner.raw_balance)
if __name__ == '__main__':