CLI
Deploy and manage L3 chains using the ADI CLI
The ADI CLI is a Rust-based tool that manages the full lifecycle of L3 chain deployment. It runs all operations inside pre-built Docker toolkit containers (zkstack, foundry-zksync, era-contracts) and outputs the resulting state files and generated wallets to your host machine.
Source: ADI-Foundation-Labs/ADI-CLI Changelog: CHANGELOG.md
Prerequisites
Docker
Running daemon. The CLI pulls and runs toolkit images automatically
Rust
Install via rustup
Funded wallet
~270 ADI tokens on the settlement layer for deployment gas costs. Testnet faucet: faucet.ab.testnet.adifoundation.ai
Installation
cargo install --git https://github.com/ADI-Foundation-Labs/ADI-CLIVerify the installation:
adi versionOptionally generate shell completions:
mkdir -p ~/.oh-my-zsh/completions
adi completions zsh > ~/.oh-my-zsh/completions/_adimkdir -p ~/.local/share/bash-completion/completions/
adi completions bash > ~/.local/share/bash-completion/completions/adiRestart your shell to activate:
source ~/.zshrcsource ~/.bashrcConfiguration
The CLI reads configuration from a YAML file. Default location is ~/.adi_cli/.adi.yml — the same directory that holds ecosystem state. The legacy ~/.adi.yml location still works as a fallback, but is deprecated.
Minimal Config
Wallet funding amounts and the funder key are not required in the config — they can be provided via CLI flags or environment variables during adi deploy. The only required config fields are the ecosystem definition and chain parameters.
Key Options
settlement
ecosystem
l1 (chain is an L2) or l2 (chain is an L3; default). For L3s on ADI, keep l2
prover_mode
chain
no-proofs (testing, default) or gpu (production)
pubdata_mode
chain
blobs, calldata (default), or custom_da. blobs requires settlement: l1
base_token_address
chain
Custom Gas Token (CGT) contract address on the settlement layer
governor_cgt_units
funding
Amount of CGT to fund the governor wallet
operators.operator
chain/global
Address for batch commit/revert roles
operators.prove_operator
chain/global
Address for proof submission
operators.execute_operator
chain/global
Address for batch execution
ownership.new_owner
ecosystem/chain
Transfer ownership to this address after deploy
ownership.private_key
ecosystem/chain
If provided, ownership is accepted automatically
gas_multiplier
global
Gas price buffer percentage (default: 200)
Set the funder wallet private key via environment variable:
For the full annotated config, environment variables, and S3 state sync, see the CLI Configuration Reference.
Ownership Transfer
Verify the merged configuration:
Deployment Workflow
1. Initialize
The init command creates the ecosystem and chain configuration. It spins up a Docker container, generates wallets and configs inside it, then drops the resulting state files to your host.
--chain
Select chain from config chains[] by name
--force
Overwrite existing ecosystem state
--yes
Skip confirmation prompts
Example output:
After init, state is written to ~/.adi_cli/state/<ecosystem>/:
2. Deploy
The deploy command funds the generated wallets and deploys all contracts to the settlement layer (L2).
The funder private key can be provided in three ways (in priority order): --funder-key flag, ADI_FUNDER_KEY env var, or funding.funder_key in config.
Example output:
This command:
Connects to the settlement layer and checks wallet balances
Funds deployer, governor, and operator wallets from the funder
Deploys ecosystem and chain contracts (Bridgehub, STM, Diamond Proxy)
Configures validator roles on chain contracts
Handles ownership transfer if configured
State
All state lives in ~/.adi_cli/state/. This directory contains wallets (with private keys), deployed contract addresses, and chain configurations. Back it up.
State can optionally sync to S3-compatible storage with adi state sync / adi state restore. See the CLI Configuration Reference for details.
Next Steps
Once contracts are deployed, set up the chain infrastructure (sequencer, prover, explorer, bridge) using Docker Compose:
Run a Rollup with Docker ComposeAdditional CLI commands for post-deployment:
adi verify
Verify deployed contracts on block explorers
adi server-params
Output server parameters for docker-compose configuration
adi owners
Display current contract owners
adi transfer
Transfer ownership to a new address
adi upgrade
Upgrade contracts to a new protocol version
Last updated
