Closed sdaveas closed 2 years ago
Could we instead add a -m auto
flag to tofnd and do everything inside the executable?
EDIT: posted this before I saw #251
Instead of changing tofnd, we decided that the entrypoint script will perform a command based on the state of the kvstore (similar to the launch validator with binaries script) and ask the user to explicitly backup their mnemonics. See #252 and axelarnetwork/axelarate-community#268.
In addition to #228, we need to eliminate
mnemonic already reserved
error logs because they trigger pagerduty alerts. Other than logging these errors, tofnd binary needs not to return aTofndError
from main because these results are also captured by datadog. For example, here is the message logged by tofnd, and here is a the same message as the return value of the binary (notice the "Error:" prefix).However, we can't always return
Ok(())
because theauto
command relies on the results of-m import
and-m create
(ie ifimport
succeeds, proceed, else try tocreate
).One approach is to replace
TofndResult
with exit codes, (https://docs.rs/exitcode/latest/exitcode/ crate might be useful).⚠️ Attention
For users that rely on tofnd's returning messages or mnemonic reserve
Error
errors, this is a breaking change.