tezos-reward-distributor-organization / tezos-reward-distributor

Tezos Reward Distributor (TRD): A reward distribution software for tezos bakers.
https://tezos-reward-distributor-organization.github.io/tezos-reward-distributor/
GNU General Public License v3.0
87 stars 51 forks source link

make tzpro_api_key optional #694

Closed nicolasochem closed 5 months ago

nicolasochem commented 5 months ago

Screenshot from 2024-02-06 15-14-28

Most TRD users use tzkt as backend. Right now, we make it mandatory to pass tzpro_api_key = '' in the config.

I'm introducing a new method to set default attributes in code. In this case, the default tzpro_api_key is None.

I verified that when using the tzpro provider, the program still fails later when the key is unset:

2024-02-06 15:07:29,721 - MainThread - INFO - Failed to get network
configuration constants from a local node (http://127.0.0.1:8732).
2024-02-06 15:07:29,731 - MainThread - INFO - Loading baking
configuration file baker_actual_tzkt/cfg/baker.yaml
2024-02-06 15:07:29,737 - MainThread - ERROR - [Process Life Cycle
completing With Failure] Error Details: Please set a tzpro api key in
 the config to use this block api!

I also verified that tzkt payout works with the param missing from the config.

All previous parameters remain mandatory, for now.

Work effort: 1hr