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 50 forks source link

most CLI args should move to the config file #424

Open nicolasochem opened 3 years ago

nicolasochem commented 3 years ago

I suggest to dramatically decrease the number of CLI arguments and move most of them to config.

The args that should remain are:

-h                          # show help message and exit
-M {1,2,3,4}                # Waiting decision after making pending payments. 1: default option. Run forever. 2: Run all pending payments and exit. 3: Run for one cycle and exit. Suitable to use with -C option.
                            # 4: Retry failed payments and exit
-D                          # Run without injecting payments. Suitable for testing. Does not require locking.
-Dc                         # Run without any consumers. Suitable for testing. Does not require locking.
-s                          # Marker to indicate that TRD is running in daemon mode. When not given it indicates that TRD is in interactive mode.

Right now there is a separation between CLI args and the TRD config file.. This separation feels arbitrary to me.

I suggest a new criteria:

Does the parameter apply to this one unique run or to all my runs?

If it's unique to this run, it should go to CLI args. Otherwise, it belongs to the config file.

The rationale is that configuration is something you do when you set things up and then are unlikely to change. For example, you are not very likely to switch RPC backend, signer endpoint or RELEASE_OVERRIDE once you start baking. For sure, you wouldn't want to change it each time you run the command.

You may however want to re-run a failed payment run, or perform a one-shot payment run. In this case, it makes sense to specify this in the args, because your intent may change each time you run the command.

jdsika commented 3 years ago

I think it should rather be redundant like in tezos-client: every argument can also be in the config and vice versa?

nicolasochem commented 3 years ago

Yes, although in some cases it's difficult to input some data with CLI arguments (like the table of delegates and where you want their rewards to go).

jdsika commented 3 years ago

I see this as part of #466 as well. A general overhaul of the CLI