mlabs-haskell / ogmios-datum-cache

6 stars 4 forks source link

Use CLI parameters instead of config.toml #61

Closed micahkendall closed 2 years ago

micahkendall commented 2 years ago

Using .toml is annoying, you cannot easily define exclusive options like in optparse-applicative. -@t4ccer Pab team already generates the config.toml with nix.

klntsky commented 2 years ago

Having at least an option to provide config path would be great. I'm creating a temporary directory just to provide a config, this is awkward.

t4ccer commented 2 years ago

@klntsky It's possible now https://github.com/mlabs-haskell/ogmios-datum-cache/pull/45

micahkendall commented 2 years ago

blockFetcher.firstBlock should be able to be specified as either a combination of slot,id, or simply the string "origin". Suggestion use similar syntax to ip:port to indicate firstBlock in one option rather than multiple. (i.e value may be "origin" or "slot:id"). Do this

t4ccer commented 2 years ago

With optparse you can easily define parser that would throw error when you use slot and origin at the same time so no need to introduce some custom formats, just require to either use --origin or (--block-slot and --block-hash) (I'm not attached to those names)