@crunchdao/cli
v1.2.0
Published
Crunch Protocol CLI
Readme
Crunch Protocol CLI
A command-line interface for the Crunch Protocol, allowing for Coordinator Management, Crunch Management and Staking Operations.
Documentation: https://protocol.crunchdao.com/cli/
Installation
npm install -g @crunchdao/cliQuick Start
# Configure your environment
crunch-cli config set network devnet
crunch-cli config set wallet ~/.config/solana/devnet.json
# Check your setup
crunch-cli config show
# Register as a coordinator
crunch-cli coordinator register "MyCoordinator"
Command Structure
The CLI is organized by functional domains rather than user roles:
crunch-cli coordinator- Coordinator-specific operationscrunch-cli cruncher- Participant/cruncher operationscrunch-cli staking- All staking-related operationscrunch-cli crunch- Crunch competition management and participationcrunch-cli model- Model & simulation tools (requires:pip install crunch-cli)crunch-cli config- Global configuration management
Global Options
All commands support these global options:
-n, --network <network>- Solana network (mainnet-beta|testnet|devnet|localhost)-w, --wallet <path>- Path to wallet keypair file-u, --url <url>- Custom RPC URL (overrides network)-o, --output <format>- Output format (json|table|yaml)-v, --verbose- Enable verbose logging-q, --quiet- Suppress non-error output--dry-run- Show what would be executed without running--timeout <seconds>- Command timeout in seconds
Examples
Staking Operations
# Deposit tokens for staking
crunch-cli staking deposit 1000
# Delegate to a coordinator
crunch-cli staking delegate 7x8yF...3k9L 500
# Check positions and rewards
crunch-cli staking positions
crunch-cli staking rewards
# Claim rewards
crunch-cli staking claimModel Management
# Add a model to a competition
crunch-cli cruncher model add "DataSci2024" "bot1" "submission123" "resource456" "gpu" "start"
# List models in a competition
crunch-cli cruncher model list "DataSci2024"
# Update model
crunch-cli cruncher model update "DataSci2024" "bot1" '{"state": "stop"}'Python Model & Simulation Tools
# Install Python companion
pip install crunch-cli
# Run simulations
crunch-cli model list
crunch-cli model run baseline
crunch-cli model validate scenario.yamlConfiguration
The CLI uses a global configuration file stored at ~/.crunch/config.json:
# Set default network
crunch-cli config set network devnet
# Set default wallet
crunch-cli config set wallet ~/.config/solana/devnet.json
# View current configuration
crunch-cli config show
# Validate configuration
crunch-cli config validateContributing
Please see the main repository's contributing guidelines.
License
MIT
