Installation
The CLI is built as part of the Minichain project:Command Structure
All Minichain commands follow a consistent structure:minichain init --authorities 2minichain account new --name aliceminichain block produce --authority authority_0
Available Commands
init
Initialize a new blockchain with genesis block
account
Manage accounts, check balances, mint tokens
tx
Send transfer transactions
block
Produce blocks and query block information
deploy
Deploy smart contracts from assembly
call
Execute contract functions
explore
Browse blockchain state and history
Quick Reference
| Command | Description | Example |
|---|---|---|
init | Initialize new blockchain | minichain init --authorities 2 |
account new | Generate keypair | minichain account new --name alice |
account mint | Mint tokens (authority only) | minichain account mint --from authority_0 --to 0xABC... --amount 50000 |
account balance | Query balance | minichain account balance 0xABC... |
account info | Show account details | minichain account info 0xABC... |
account list | List all keypairs | minichain account list |
tx send | Send transfer | minichain tx send --from alice --to 0xABC... --amount 100 |
block list | List recent blocks | minichain block list --count 10 |
block info | Show block details | minichain block info 5 |
block produce | Produce new block | minichain block produce --authority authority_0 |
deploy | Deploy contract | minichain deploy --from alice --source contract.asm --gas-limit 80000 |
call | Call contract | minichain call --from alice --to 0xABC... |
Common Options
Most commands support the following common options:Data Directory
./data.
Example:
Help
Typical Workflow
Here’s a common sequence of operations:Output Format
The CLI uses colored output with symbols for visual clarity:- ✓ (green) - Success
- ✗ (red) - Error
- Yellow text - Addresses and hashes
- Cyan text - Numeric values and commands
- Gray text - Supplementary information
If colors don’t display correctly in your terminal, check that your terminal supports ANSI color codes.
Error Handling
When commands fail, the CLI provides clear error messages:Next Steps
Initialize Blockchain
Learn how to create a new blockchain
Manage Accounts
Create accounts and manage balances
Send Transactions
Transfer tokens between accounts
Deploy Contracts
Deploy and interact with smart contracts