Make miner optional
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
792a068792
commit
71ead214b7
3 changed files with 9 additions and 11 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[Flexpool.io](https://flexpool.io) is a next-generation [Ethereum](https://ethereum.org/en/) mining pool known for their
|
[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
|
[#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
|
## Installation
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ bot. You'll need the `chat_id` and `auth_key` for the next section.
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configuration file use the JSON format with the following keys:
|
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)
|
* `currency`: symbol of the currency to convert (optional)
|
||||||
* `telegram`: send notifications with Telegram (optional)
|
* `telegram`: send notifications with Telegram (optional)
|
||||||
* `auth_key`: Telegram authentication key for the bot API
|
* `auth_key`: Telegram authentication key for the bot API
|
||||||
|
|
|
@ -22,8 +22,5 @@
|
||||||
"state_file": {
|
"state_file": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"required": [
|
|
||||||
"miner"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
11
main.py
11
main.py
|
@ -118,11 +118,12 @@ def main():
|
||||||
logger.debug('saving block number to state file')
|
logger.debug('saving block number to state file')
|
||||||
write_state(state_file, block_number=block.number)
|
write_state(state_file, block_number=block.number)
|
||||||
|
|
||||||
miner = watch_miner(last_balance=state.get('balance'), address=config['miner'], config=config,
|
if config.get('miner'):
|
||||||
disable_notifications=args.disable_notifications, exchange_rate=exchange_rate,
|
miner = watch_miner(last_balance=state.get('balance'), address=config['miner'], config=config,
|
||||||
currency=currency)
|
disable_notifications=args.disable_notifications, exchange_rate=exchange_rate,
|
||||||
logger.debug('saving miner balance to state file')
|
currency=currency)
|
||||||
write_state(state_file, miner_balance=miner.raw_balance)
|
logger.debug('saving miner balance to state file')
|
||||||
|
write_state(state_file, miner_balance=miner.raw_balance)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Reference in a new issue