Ozon-cli (PLEASE NOTE - We are currently in the development stage , so mainnet deployments are not live yet. Please stick to Devnet and have fun).
Command-line interface for interacting with the Ozon restaking protocol on Solana. Manage operators and AVS (Actively Validated Services) registrations directly from your terminal.
π Features
- Operator Management: Register, update, and de-register operators with bond staking
- AVS Management: Register and manage Actively Validated Services
- Multi-Cluster Support: Works with Solana devnet, testnet, and mainnet
- Flexible Wallet Options: Use default or custom wallet configurations
- Transaction Verification: Get detailed transaction signatures for all operations
π¦ Installation
Install from crates.io (Recommended)
Install from Source (Repo is private as of now - use the above option)
Verify Installation
π§ Prerequisites
Before using ozon-cli, ensure you have:
- Rust and Cargo installed (rustup)
- Solana CLI tools installed (Solana Docs)
- A Solana wallet configured
Setting Up Your Solana Wallet
# Create a new wallet (if you don't have one)
# Set cluster to devnet for testing
# Check your wallet address
# Get devnet SOL for testing (devnet only)
π Usage
Basic Command Structure
Global Options
--cluster <CLUSTER>: Specify Solana cluster (devnet, testnet, mainnet) [default: devnet]--wallet <PATH>: Path to wallet keypair file [default: ~/.config/solana/id.json]--help: Display help information--version: Display version information
π― Commands
1. Initialize Operator
Register a new operator with the Ozon protocol by staking a bond amount.
Syntax:
Parameters:
--bond-amount: Amount of SOL to bond in lamports (minimum: 2 SOL = 2,000,000,000 lamports)--metadata: Metadata describing your operator (e.g., "My Operator Node")--cluster: Network cluster (devnet, testnet, mainnet) [default: devnet]--wallet: Path to wallet file [default: ~/.config/solana/id.json]
Example:
# Register operator with 5 SOL bond on devnet
# Register on mainnet with custom wallet
Output:
π Debug info:
Program ID: 6UqcKJ3U7zfr5JkhzjDZQsunbJeFBxgCKYbuMw8Scv6B
Operator key: 8xYz...AbCd
Operator account PDA: 9pQw...XyZa
Vault PDA: 7mNb...LmNo
Bond amount: 5000000000
Metadata: Acme Validator Services
β
Operator initialized with tx 3kL9...8fH2
2. De-register Operator
Remove your operator registration and reclaim your bonded SOL.
Syntax:
Parameters:
--cluster: Network cluster [default: devnet]--wallet: Path to wallet file [default: ~/.config/solana/id.json]
Example:
# De-register operator on devnet
# De-register on mainnet with custom wallet
Output:
π Debug info:
Program ID: 6UqcKJ3U7zfr5JkhzjDZQsunbJeFBxgCKYbuMw8Scv6B
Operator key: 8xYz...AbCd
Operator account PDA: 9pQw...XyZa
Vault PDA: 7mNb...LmNo
β
Operator de-registered with tx 2jK8...9gI1
3. Register AVS
Register a new Actively Validated Service (AVS) with the protocol.
Syntax:
Parameters:
--metadata: Name/metadata for your AVS--registration-fee: Registration fee in lamports (minimum: 3 SOL = 3,000,000,000 lamports)--cluster: Network cluster [default: devnet]--wallet: Path to wallet file [default: ~/.config/solana/id.json]
Example:
# Register AVS on devnet
# Register on mainnet
Output:
π Debug info:
Program ID: 6UqcKJ3U7zfr5JkhzjDZQsunbJeFBxgCKYbuMw8Scv6B
AVS owner: 8xYz...AbCd
AVS account PDA: 4sWx...KlMn
Treasury PDA: 6tRy...PqRs
Registration fee: 3000000000
Avs Name: Oracle Price Feeds
β
Avs registered with tx 5nM7...3pQ9
4. Update AVS Metadata
Update the metadata/name of your registered AVS.
Syntax:
Parameters:
--metadata: New name/metadata for your AVS--cluster: Network cluster [default: devnet]--wallet: Path to wallet file [default: ~/.config/solana/id.json]
Example:
# Update AVS metadata
# Update on mainnet
Output:
π Debug info:
Program ID: 6UqcKJ3U7zfr5JkhzjDZQsunbJeFBxgCKYbuMw8Scv6B
AVS owner: 8xYz...AbCd
AVS account PDA: 4sWx...KlMn
New Avs Name: Oracle Price Feeds v2.0
β
AVS metadata updated with tx 7oL6...4rH8
5. De-register AVS
Remove your AVS registration from the protocol.
Syntax:
Parameters:
--cluster: Network cluster [default: devnet]--wallet: Path to wallet file [default: ~/.config/solana/id.json]
Example:
# De-register AVS on devnet
# De-register on mainnet(comming soon)
Output:
π Debug info:
Program ID: 6UqcKJ3U7zfr5JkhzjDZQsunbJeFBxgCKYbuMw8Scv6B
AVS owner: 8xYz...AbCd
AVS account PDA: 4sWx...KlMn
β
AVS de-registered with tx 9kP4...2sG7
6. Opt Into AVS (Operator Registration)
Allow an operator to opt into an Actively Validated Service to start providing services.
Syntax:
Parameters:
--avs-owner: The public key of the AVS owner you want to opt into--cluster: Network cluster [default: devnet]--wallet: Path to wallet file [default: ~/.config/solana/id.json]--interactive: Launch the Ozon AVS Selection dashboard in your browser [optional]
Example:
# Opt into an AVS using the AVS owner's public key
# Use interactive mode to browse and select AVS from the dashboard
# Opt in on mainnet with custom wallet
Output:
π Debug info:
Operator: CLuH...btHN
AVS Owner: 8xYz...zxc
AVS Account: 4sWx...KlMn
Registration PDA: 9pQw...XyZa
β
Opted into AVS with tx 7mN8...5kL2
7. Run Operator Daemon
Run a local operator daemon that polls for active tasks and submits results automatically.
Syntax:
Parameters:
--poll-interval-seconds: Poll interval in seconds [default: 10]
Example:
8. Create Task (AVS Owner)
Create a new task under your AVS.
Syntax:
Example:
9. Submit Task Result (Operator)
Submit a task result manually (the daemon usually handles this automatically).
Syntax:
10. Verify Task (AVS Owner)
Verify an operator's submission and slash if incorrect.
Syntax:
Notes:
--actual-pricemust be an integer i64 scaled to 8 decimals (e.g., 67321.12 β 6732112000000000).
11. Close Task (AVS Owner)
Close a task after the submission window has passed.
Syntax:
12. Get Task PDA (Helper)
Derive the task account PDA for a given task_id and avs_owner.
Syntax:
Interactive Mode: When using --interactive, the command will open the Ozon AVS Selection dashboard in your default browser, where you can:
Browse available AVS services View AVS metadata and requirements Select an AVS to opt into Complete the opt-in process through a user-friendly interface
π‘ Common Workflows
Setting Up as an Operator
# 1. Check your balance
# 2. Request airdrop if on devnet
# 3. Register as operator
# 4. Browse available AVS services interactively
# 5. Or opt into a specific AVS directly
# 6. Verify transaction on explorer
# Visit: https://explorer.solana.com/tx/<SIGNATURE>?cluster=devnet
Setting Up an AVS
# 1. Ensure you have enough SOL
# 2. Register your AVS
# 3. Update name later if needed
# 5. Share your AVS owner pubkey with operators
π Finding AVS to Opt Into
There are two methods to find and opt into an AVS:
Method 1: Interactive Dashboard (Recommended)
The easiest way to discover and opt into AVS services is through the interactive web dashboard:
# Launch the Ozon AVS Selection dashboard in your browser
What you'll see:
- Browse all registered AVS services
- View detailed service descriptions
- Check AVS requirements and status
- Select and opt-in with one click
- Visual interface for easier navigation
Method 2: Get AVS Owner Pubkey Directly
If you already know which AVS you want to join, you can opt in directly using the AVS owner's public key:
Ways to obtain the AVS owner pubkey:
-
Ask the AVS provider directly
- Contact the AVS team through their official channels
- They will provide their wallet public key
-
Check the AVS registry on Solana Explorer
- Visit: https://explorer.solana.com/?cluster=devnet
- Search for AVS account addresses
- Verify the owner field
-
Use the AVS provider's documentation
- Check their official website or GitHub
- Look for integration guides
- Find published wallet addresses
Example:
# Once you have the AVS owner pubkey, opt in directly
π₯ Managing Multiple Operators/AVS
You can run multiple operators and have them opt into different AVS services using separate wallets.
Setting Up Multiple Operators
# Create and fund separate wallets for each operator
# Fund each wallet (on devnet)
# Register first operator
# Register second operator
Opting Multiple Operators into Different AVS
# Operator 1 opts into Oracle AVS
# Operator 2 opts into Bridge AVS
# One operator can also opt into multiple AVS
Organizing Your Wallets
Best practices:
- Use descriptive names for wallet files:
oracle-operator.json,bridge-operator.json - Keep a spreadsheet tracking which operator is in which AVS
- Store mainnet wallets separately and securely
- Test all configurations on devnet first
Example directory structure:
~/solana-wallets/
βββ devnet/
β βββ operator-1-oracle.json
β βββ operator-2-bridge.json
β βββ operator-3-backup.json
βββ mainnet/
βββ production-operator-1.json
βββ production-operator-2.json
π Command Quick Reference
| Command | Purpose | Minimum Requirement |
|---|---|---|
initialize-operator |
Register as an operator | 2 SOL bond |
de-register-operator |
Unregister operator | Must be registered |
register-avs |
Register an AVS | 3 SOL registration fee |
update-avs-metadata |
Update AVS information | Must own AVS |
de-register-avs |
Unregister AVS | Must own AVS |
opt-in-avs |
Operator joins an AVS | Must be registered operator |
initialize-reward-treasury |
Setup reward system | Protocol authority only |
run-operator |
Run operator daemon to auto-submit tasks | Registered operator |
create-task |
Create a new task | AVS owner |
submit-task-result |
Manually submit result | Operator opted into AVS |
verify-task |
Verify submission and slash if wrong | AVS owner |
close-task |
Close an expired task | AVS owner |
get-task-pda |
Derive task PDA | None |
π State Transitions
Operator Lifecycle
βββββββββββ
β Start β
ββββββ¬βββββ
β
βΌ
βββββββββββββββββββββββ
β Initialize Operator β βββ Bond 2+ SOL
ββββββββββββ¬βββββββββββ
β
βΌ
ββββββββββββββββ
βActive Operatorβ
ββββββββ¬ββββββββ
β
βΌ
βββββββββββββββ
βOpt Into AVS β βββ Join one or more services
ββββββββ¬βββββββ
β
βΌ
ββββββββββββββββββ
βProviding Servicesβ
ββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββββββ
β De-register Operator β βββ Reclaim bond
ββββββββββββ¬ββββββββββββ
β
βΌ
βββββββ
β End β
βββββββ
AVS Lifecycle
βββββββββββ
β Start β
ββββββ¬βββββ
β
βΌ
βββββββββββββββββββββββ
βInitialize Treasury β βββ Protocol setup (once)
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββ
βRegister AVS β βββ Pay 3+ SOL fee
ββββββββ¬βββββββ
β
βΌ
ββββββββββββ
βActive AVSβ
ββββββ¬ββββββ
β
βΌ
ββββββββββββββββ
βUpdate Metadataβ βββ Optional updates
ββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββ
βAccept Operatorsβ βββ Operators opt in
βββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββ
βDe-register AVSβ βββ Close service
ββββββββ¬ββββββββ
β
βΌ
βββββββ
β End β
βββββββ
πΌ Real-World Scenarios
Scenario 1: Single Operator, Multiple AVS
Use case: You run one operator node that provides multiple services.
# 1. Initialize your operator once
# 2. Opt into multiple AVS services
Scenario 2: Multiple Operators, Specialized Services
Use case: You run separate operators for different service types.
# Oracle-specialized operator
# Bridge-specialized operator
Scenario 3: Testing Before Production
Use case: Test your setup on devnet before going live on mainnet.
# Test on devnet first
# Once confident, deploy to mainnet
Switching Between Clusters
# Development/Testing on devnet
# Production on mainnet
π Security Best Practices
- Protect Your Wallet: Never share your private key file
- Test on Devnet First: Always test operations on devnet before mainnet
- Use Hardware Wallets: Consider using Ledger for mainnet operations
- Backup Your Keys: Store wallet backups in secure locations
- Verify Transactions: Always check transaction signatures on Solana Explorer
π Troubleshooting
Issue: "Command not found"
# Ensure cargo bin is in your PATH
# Add to your shell profile (~/.bashrc, ~/.zshrc)
Issue: "Insufficient funds"
# Check your balance
# On devnet, request airdrop
# On mainnet, ensure you have enough SOL
Issue: "Invalid cluster"
Supported clusters are:
devnet(default)testnetmainnetormainnet-beta(coming soon)
Issue: "Unauthorized action"
Ensure you're using the correct wallet that owns the operator/AVS you're trying to modify.
π Transaction Verification
After each command, you'll receive a transaction signature. Verify it on Solana Explorer:
Devnet:
https://explorer.solana.com/tx/<SIGNATURE>?cluster=devnet
Mainnet:
https://explorer.solana.com/tx/<SIGNATURE>
Bonus - you can monitor your operator slashed info by running ozon-inbuilt slashboard.
Syntax:
π Program Information
- Program ID:
6UqcKJ3U7zfr5JkhzjDZQsunbJeFBxgCKYbuMw8Scv6B - Network: Solana (devnet, testnet, mainnet)
- Repository: [
we will share this once we make our repo public]
π Resources
π License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
π¬ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
π Acknowledgments
Built with:
Made with β€οΈ by the Ozon Team