A complete blockchain implementation featuring: - synord: Full node with GHOSTDAG consensus - explorer-web: Modern React blockchain explorer with 3D DAG visualization - CLI wallet and tools - Smart contract SDK and example contracts (DEX, NFT, token) - WASM crypto library for browser/mobile
4.7 KiB
4.7 KiB
Phase 2, Milestone 2: CLI Commands
Complete CLI command implementation
Status: ✅ Complete
Priority: High
Application: synor-cli
Overview
Implement all 23 CLI commands for wallet management, transactions, block queries, and smart contract interaction.
Tasks
Task 2.1: Wallet Commands
synor wallet create- Generate new walletsynor wallet recover- Recover from mnemonicsynor wallet info- Display wallet infosynor wallet addresses- List addressessynor wallet new-address- Generate new addresssynor wallet export- Export wallet backupsynor wallet import- Import wallet backup
Files:
apps/cli/src/commands/wallet.rs
Validation:
./target/release/synor wallet create
./target/release/synor wallet info
./target/release/synor wallet addresses
Task 2.2: Balance & Transaction Commands
synor balance- Query UTXO balancesynor send <address> <amount>- Send SYNORsynor tx <hash>- View transaction detailssynor mempool- View pending transactionssynor utxos- List UTXOs
Files:
apps/cli/src/commands/balance.rsapps/cli/src/commands/send.rsapps/cli/src/commands/tx.rs
Validation:
./target/release/synor balance
./target/release/synor send synor:qz... 1.0
./target/release/synor tx <hash>
Task 2.3: Block Commands
synor block <hash|height>- Fetch blocksynor tips- Get current DAG tipssynor info- Chain information
Files:
apps/cli/src/commands/block.rsapps/cli/src/commands/info.rs
Validation:
./target/release/synor block 0
./target/release/synor tips
./target/release/synor info
Task 2.4: Network Commands
synor peers- List connected peerssynor peer add <addr>- Add peersynor peer ban <peer_id>- Ban peer
Files:
apps/cli/src/commands/peers.rs
Validation:
./target/release/synor peers
Task 2.5: Mining Commands
synor mining start- Start miningsynor mining stop- Stop miningsynor mining status- Mining statussynor mining set-address- Set coinbase address
Files:
apps/cli/src/commands/mining.rs
Validation:
./target/release/synor mining status
Task 2.6: Smart Contract Commands
synor contract deploy <wasm>- Deploy contractsynor contract call <id> <method>- Call contractsynor contract query <id> <method>- Query contract (read-only)
Files:
apps/cli/src/commands/contract.rs
Validation:
./target/release/synor contract deploy ./contract.wasm
./target/release/synor contract call <id> transfer --args '...'
Task 2.7: Governance Commands
synor gov propose- Create proposalsynor gov vote- Vote on proposalsynor gov list- List proposalssynor gov info- Governance info
Files:
apps/cli/src/commands/governance.rs
Validation:
./target/release/synor gov list
./target/release/synor gov info
Validation
Validation Commands
# List all commands
./target/release/synor --help
# Test each command category
./target/release/synor wallet --help
./target/release/synor mining --help
./target/release/synor contract --help
./target/release/synor gov --help
# Run CLI tests
cargo test -p synor-cli
Validation Agents
| Agent | Purpose |
|---|---|
code-reviewer |
Review command implementations |
Explore |
Verify all commands exist |
Command Matrix
| Command | Args | Output | RPC Method |
|---|---|---|---|
balance |
- | Amount | synor_getBalance |
send |
addr, amt | TxHash | synor_submitTransaction |
block |
hash/height | Block | synor_getBlock |
tips |
- | Hash[] | synor_getTips |
info |
- | NodeInfo | synor_getInfo |
peers |
- | Peer[] | synor_getPeerInfo |
mempool |
- | Tx[] | synor_getMempool |
Security Checks
- Sensitive data (keys, mnemonic) not logged
- Password input hidden
- RPC connection uses timeout
- Invalid addresses rejected early
- Amount overflow checked
UX Validation
- Help text for all commands
- Error messages are helpful
- Progress indicators for long operations
- Confirmation prompts for destructive actions
Output Formats
All commands support:
- Human-readable (default)
- JSON (
--format json) - Compact (
--format compact)
./target/release/synor balance --format json
Acceptance Criteria
- All 23 commands implemented
- Help text for every command
- JSON output format supported
- Error handling complete
- All commands tested
Completed: January 2025