Skip to main content

Validation model

WhenWhatError
setter callvalue types, ranges and formats (ports, hex, mnemonics, URLs, headers, paths)AnvilConfigurationError (flag)
setter callconflicts with flags already setAnvilConfigurationError (flag, relatedFlags)
withExtraArgs()known flags must use the fluent APIAnvilConfigurationError
validate() / build() / prepare() / start()dependencies between flags, hardfork familyAnvilConfigurationError (one listing every problem)
prepare() / start()host files exist and are filesAnvilConfigurationError
test client settersetting valuesAnvilTestClientConfigurationError (setting)
prepare() / start() / createTestClient()test client vs. anvil flagsAnvilTestClientConfigurationError (setting, flag, relatedFlags)
start()anvil exits, never answers, Docker failsAnvilStartupError (command, logs)

Everything up to prepare() runs without Docker (unit-test it).

Where the rules come from​

The flag registry mirrors anvil --help. The end-to-end suite runs every flag and every pair through anvil's own parser, expecting the same verdict, and boots every flag and hardfork. A few rules are stricter than anvil where it ignores a flag. Newer flags: withExtraArgs().

Related: Errors.