-
Notifications
You must be signed in to change notification settings - Fork 6
DIN CLI
🚧 This wiki describes DevNet 2.0, soon to be launched. It follows the contracts and
dinclion thedevelopbranch; the currently running DevNet may still use older contracts and commands. Pre-launch discussion: #102.
dincli is the command-line interface to the DIN Protocol — the tool through which every participant interacts with the network. It is a Python application (Typer-based, Python ≥ 3.12) that wraps the on-chain contracts and the IPFS layer behind role-oriented commands, so participants never have to hand-craft transactions or manage CIDs themselves.
Commands are grouped into sub-apps, one per role or concern:
| Command group | Who uses it | What it covers |
|---|---|---|
dincli system |
everyone | init, network/logging/demo-mode config, wallet registration and connection, IPFS provider setup, importing platform deployments, ABI export |
dincli dinrep |
DIN-Representative | slasher authorization, model registration and manifest-update approvals, disabling models, setting registry fees, sweeping fees to DinFeeRouter
|
dincli model-owner |
model owners | task contract deployment, genesis model, driving every GI phase (registration windows, LMS, evaluation, aggregation batches, slashing) |
dincli client |
clients (model trainees) | local training on private data and local model submission |
dincli auditor |
auditors | registration, staking, seed locking, evaluating (commit) and revealing scores for assigned audit batches |
dincli aggregator |
aggregators | registration, staking, seed locking, T1/T2 aggregation (commit) and reveal for assigned batches |
dincli dintoken |
everyone | buying DIN with ETH, staking, reading stake and the DIN-per-ETH rate |
dincli task |
model owners, everyone | model registration and manifest update requests on DINModelRegistry (task model-owner …), GI state (task gi show-state), registry counters |
dincli ipfs |
everyone | direct IPFS upload/retrieve utilities |
A typical Global Iteration is literally a conversation between these sub-apps: the model owner opens a phase (dincli model-owner lms open), participants act within it (dincli client train-lms, then dincli client submit-lm), and the owner closes it — the CLI enforcing the on-chain state machine at every step.
-
Network selection per command. Every command resolves its network (
local,sepolia_devnet,sepolia_op_devnet,mainnet) from the global--networkoption (accepted anywhere on the command line) or the configured default. The choice drives which.env.<network>file, RPC endpoint, and deployed contract addresses are used. The live DevNet issepolia_op_devnet(Optimism Sepolia). -
Wallets & keys. A key is first registered as a named, encrypted wallet with
dincli system register-wallet: from a hidden prompt (recommended),--keystore(import a JSON keystore),--key-file, or--account <n>(readsETH_PRIVATE_KEY_<n>from.env), then selected withdincli system connect-wallet <name>(orregister-wallet … --connect). Per invocation,--wallet <name>orDIN_WALLET_NAMEoverride the connected wallet. Production validators use an encrypted keystore protected byDIN_WALLET_PASSWORD; see the wallet setup guide. A demo mode exists for local experimentation (connect-demo-wallet,--demokey; plaintext dev keys, never with real funds). -
Manifest-driven model logic.
dinclicontains no model-specific code. Each model's training, scoring, and aggregation functions are Python service files written by the model owner, pinned to IPFS, and referenced by CID in the model'smanifest.json. The CLI fetches and executes them on demand, caching by CID — so a new model means a new manifest, not a new CLI release. See Manifest & Services. -
Pluggable IPFS. All artifact traffic goes through one abstraction with three interchangeable backends — a self-hosted IPFS node (
env), managed Filebase (recommended), or a fully custom Python provider. See the IPFS Layer page. -
Config & cache.
dincli system initcreates per-user config and cache directories (viaplatformdirs) with demo mode off;dincli system get-config-dir/get-cache-dirprint them. Fetched artifacts are cached by CID so files are only re-downloaded when their CID changes. -
Platform addresses. After the DIN-Representative deploys the platform contracts,
dincli system import-deploymentsloads their addresses fromfoundry/deployments/<network>.json;dincli system din-infoshows what is configured.
# install from a checkout (in a virtualenv, Python 3.12 recommended)
git clone https://github.com/InfiniteZeroFoundation/DevNet.git && cd DevNet
pip install -e .
# initialize and configure
dincli system init
dincli system configure-demo --mode no
dincli --network sepolia_op_devnet system configure-network
dincli system register-wallet --account 0 --connect
dincli system configure-ipfs --provider filebase --api-key <key>Requirements: an RPC endpoint for Optimism Sepolia in your project .env (SEPOLIA_OP_DEVNET_RPC_URL, e.g. from Alchemy/Infura/Ankr) and an IPFS provider.
- Setup Guide — full installation & configuration walkthrough
- Common Commands — commands shared across all roles
- Role guides: Model Owners · Clients · Auditors · Aggregators
- Model Workflow — every command in GI order
-
DIN SDK — the planned extraction of
dincli's reusable core
- Platform Contracts
- Task Contracts
- DIN CLI
- DIN SDK (in progress)
- DIN Daemon (in progress)
- DIN Indexer (in progress)
- DIN DAO (deferred)
- IPFS Layer
- DIN Node
- Worker Node