Skip to main content

Module common

Module common 

Source
Expand description

Shared CLI types and helpers.

Structs§

CommonChainArgs
Blockchain coordinates + keys shared by every on-chain command, flattened into each command’s args so they expose an identical flag group and can’t drift. Each field is taken from a flag when present, otherwise the [blockchain] / [identity] tables of the TOML config (the same file the daemon reads). ChainArgs / PublishChainArgs layer their contract-address flags on top of this; the shared resolver (chain_ctx::resolve_common) reads these fields so the flag > config > default precedence lives in one place.

Enums§

ConfigPathSource
Whether a TOML config path was chosen by the operator or defaulted. Drives the “missing file” policy for config-file lookups in the decdn node * subcommands: an explicit path that isn’t there is almost certainly a typo and should error, while a default path that isn’t there is normal (operator just hasn’t made a config yet).
LogFormat
Log output format.
LogLevel
Log verbosity level.

Functions§

default_client_data_dir
Returns the client-scoped default data directory (~/.decdn/client).
default_config_path
Returns the default config file path (~/.decdn/node.toml).
default_data_dir
Returns the platform-appropriate default data directory (~/.decdn).
expand_tilde
Expands a leading ~/ or bare ~ in a path to the user’s home directory.