Expand description
Shared plumbing for the on-chain node subcommands (register, bond).
Resolves the blockchain coordinates (flag > [blockchain]/[identity]
TOML config > default) and loads the operator’s keystore signer. Commands
then build a wallet-filled provider with
decdn_client::provider::build_provider and construct their
CapacityBond instance against it.
Structs§
- File
Config - Partial deserializer for the TOML config — only the
[blockchain],[identity], andnetwork.bind_portfields these commands need. Deliberately partial (likenode.rs’sAdminPortConfig) so an operator’s typo in an unrelated section can’t block onboarding; serde-toml ignores unknown fields. - Resolved
- Coordinates resolved from flags > config file > defaults.
- Resolved
Appeal - Coordinates for
decdn appeal slash, resolved from flags > config > defaults. Requiresrpc_url+slash_appeal_address; unlikeResolvedit does not requirecapacity_bond_address(the appeal path doesn’t touchCapacityBonddirectly). - Resolved
Publish - Publisher-command coordinates resolved from flags > config > defaults. The two contract addresses are optional here; each subcommand requires only the one it targets and errors with a specific message if it is unset.
Functions§
- load_
operator_ signer - Load the operator’s Ethereum keystore signer, sourcing the password per
password_sources— the same precedence the daemon uses. - load_
optional_ config - Load the partial config from
config_path(or the--configflag folded in by the caller). An explicit path that is missing/unreadable is an error; the default path simply falls through to an empty config (every field can also come from a flag). - load_
signer_ with_ password_ file - Load an Ethereum keystore signer, sourcing the password per
password_sources. The scrypt KDF is offloaded tospawn_blockingso it doesn’t stall the async executor. - parse_
address - Parse a contract/account address with a labelled error.
- parse_
nonzero_ address - Parse a contract address and reject the zero address.
Address::ZEROparses cleanly but is never a real deployment — it would surface only as an opaque on-chain revert at call time, so reject it here with a clear, labelled error. - resolve
- Resolve the chain coordinates with flag > config > default precedence. Pure so the precedence is unit-testable.
- resolve_
appeal - Resolve appeal-command coordinates. Pure so precedence is unit-testable.
slash_appeal_flagis the command’s--slash-appeal-addressoverride. - resolve_
publish - Resolve publisher-command coordinates. Pure so precedence is unit-testable.