CardanoSolutions / ogmios

❇️ A WebSocket JSON/RPC bridge for Cardano
https://ogmios.dev
Mozilla Public License 2.0
304 stars 90 forks source link

Incongruous error message from the command-line parsing network parameters. #242

Closed eMCeee89 closed 2 years ago

eMCeee89 commented 2 years ago

Hello, I have a question regarding this error message: https://github.com/CardanoSolutions/ogmios/blob/master/server/src/Ogmios/Options.hs#L288-L290

Is it really like this, that parameters networkMagic, systemStart and/or epochLength might be missing? In a block above, epochLength is not parsed: https://github.com/CardanoSolutions/ogmios/blob/master/server/src/Ogmios/Options.hs#L280-L283 Instead, protocolConsts.k is parsed from byronGenesis hence the error message can be confusing.

Could you please check this one? I have a problem to start an Ogmios container using my own private testnet and I crossed this error message yet an output printed below the error message with all defined parameters contains all allegedly required network parameters (networkMagic, systemStart and/or epochLength) hence it is confusing what is really required.

Thank you in advance.

KtorZ commented 2 years ago

Ho, good catch! I used to pull the epochLength from the Shelley genesis but that ended up not being needed and replaced with the security parameter (k) from the Byron genesis; the error message is an artifact from the past and is indeed now confusing; also because the error shows only the Shelley genesis but pulls things from the Byron genesis as well (this k parameter).

Folding everything into a Maybe also makes it a little harder to know which one of the three parameter is actually causing an issue; so it could definitely be improved here.