Skill站外收录 @skilllib/skill-2014279425251028995
wallet-cli
提供多币种钱包的全周期操作支持,涵盖观察型钱包的交易创建与广播、密钥生成钱包的种子管理及首签,以及签名钱包的多签协同,适用于比特币、以太坊等主流加密货币的自动化运维与测试场景。
区块链 AI 技能
Skills.MD
# Wallet CLI Usage
Guide for running the three wallet types: watch, keygen, and sign.
## Prerequisites
- Wallets must be built: `make build`
- Configuration files must exist in `config/wallet/`
- For BTC/BCH: Bitcoin Core node running (for watch wallet)
- For ETH: Ethereum node running (for watch wallet)
## Required Flags
All wallet commands require the `--config` flag:
| Flag | Short | Required | Description |
|------|-------|----------|-------------|
| `--config` | `-c` | **Yes** | Path to configuration file |
| `--coin` | | No | Coin type: `btc`, `bch`, `eth`, `xrp`, `hyt` (default: `btc`) |
| `--account-config` | | No | Path to account config for multisig |
| `--wallet` | `-w` | No | Bitcoin Core wallet name (BTC/BCH only) |
## Configuration Files
```
config/wallet/
├── btc/
│ ├── watch.yaml # Watch wallet config
│ ├── keygen.yaml # Keygen wallet config
│ ├── sign1.yaml # Sign wallet config (auth1)
│ └── sign2.yaml # Sign wallet config (auth2)
├── bch/
│ └── ... # Same structure as btc/
├── eth/
│ └── ...
├── xrp/
│ └── ...
└── account/
├── account.yaml # Single-sig account config
├── account_2of3.yaml # 2-of-3 multisig config
└── account_3of3.yaml # 3-of-3 multisig config
```
## Watch Wallet
Online wallet for creating unsigned transactions and sending signed transactions.
### Common Commands
```bash
# Create deposit transaction
watch --config config/wallet/btc/watch.yaml --coin btc create deposit
# Create payment transaction
watch --config config/wallet/btc/watch.yaml --coin btc create payment
# Send signed transaction
watch --config config/wallet/btc/watch.yaml --coin btc send --file data/tx/btc/payment_signed.psbt
# Import addresses
watch --config config/wallet/btc/watch.yaml --coin btc import address --file data/address/btc/addresses.csv
# Import descriptors (BTC only)
watch --config config/wallet/btc/watch.yaml --coin btc import descriptor --file data/descriptor/btc/descriptors.json
# Monitor transactions
watch --config config/wallet/btc/watch.yaml --coin btc monitor senttx --account deposit
# API commands
watch --config config/wallet/btc/watch.yaml --coin btc api balance --account payment
watch --config config/wallet/btc/watch.yaml --coin btc api listunspent --account payment
```
## Keygen Wallet
Offline cold wallet for key generation and first signature.
### Common Commands
```bash
# Create seed
keygen --config config/wallet/btc/keygen.yaml --coin btc create seed
# Generate HD keys
keygen --config config/wallet/btc/keygen.yaml --coin btc create hdkey --account client --keynum 10
# Export addresses
keygen --config config/wallet/btc/keygen.yaml --coin btc export address --account client
# Export descriptors (BTC only)
keygen --config config/wallet/btc/keygen.yaml --coin btc descriptor export --account payment --output data/descriptor/btc/payment.json
# Import private keys to Bitcoin Core
keygen --config config/wallet/btc/keygen.yaml --coin btc import privkey --account client
# Sign transaction (first signature)
keygen --config config/wallet/btc/keygen.yaml --coin btc sign signature --file data/tx/btc/payment_unsigned.psbt
# Create multisig addresses (with account config)
keygen --config config/wallet/btc/keygen.yaml --account-config config/wallet/account/account_2of3.yaml --coin btc create multisig --account payment
```
## Sign Wallet
Offline cold wallet for additional signatures on multisig transactions.
**Note**: Sign wallet only supports `btc` and `bch` coins.
### Common Commands
```bash
# Create seed
sign1 --config config/wallet/btc/sign1.yaml --coin btc create seed
# Generate HD key for auth account
sign1 --config config/wallet/btc/sign1.yaml --coin btc create hdkey
# Export full public key
sign1 --config config/wallet/btc/sign1.yaml --coin btc export fullpubkey
# Import private key
sign1 --config config/wallet/btc/sign1.yaml --coin btc import privkey
# Sign transaction (second/additional signature)
sign1 --config config/wallet/btc/sign1.yaml --coin btc sign signature --file data/tx/btc/payment_unsigned_1.psbt
```
## Multi-Coin Examples
### Ethereum
```bash
# Watch wallet
watch --config config/wallet/eth/watch.yaml --coin eth create deposit
watch --config config/wallet/eth/watch.yaml --coin eth api syncing
# Keygen wallet
keygen --config config/wallet/eth/keygen.yaml --coin eth create seed
keygen --config config/wallet/eth/keygen.yaml --coin eth create hdkey --account client --keynum 10
```
### Ripple (XRP)
```bash
# Watch wallet
watch --config config/wallet/xrp/watch.yaml --coin xrp create deposit
# Keygen wallet
keygen --config config/wallet/xrp/keygen.yaml --coin xrp create seed
keygen --config config/wallet/xrp/keygen.yaml --coin xrp create hdkey --account client --keynum 10
```
## E2E Script Usage
E2E scripts set config paths as variables and use `-c` short flag:
```bash
# From scripts/operation/btc/e2e/*.sh
BTC_CONFIG_WATCH="${PROJECT_ROOT}/config/wallet/btc/watch.yaml"
BTC_CONFIG_KEYGEN="${PROJECT_ROOT}/config/wallet/btc/keygen.yaml"
watch -c "${BTC_CONFIG_WATCH}" --coin btc create payment
keygen -c "${BTC_CONFIG_KEYGEN}" --coin btc sign signature --file tx.psbt
```
## Troubleshooting
### Error: "--config flag is required"
All wallet commands now require explicit config path:
```bash
# Wrong (old way with env vars - no longer works)
export BTC_WATCH_WALLET_CONF=./config/wallet/btc/watch.yaml
watch create deposit
# Correct (new way)
watch --config ./config/wallet/btc/watch.yaml --coin btc create deposit
```
### Error: "coin args is invalid"
Ensure `--coin` flag has valid value:
- Watch/Keygen: `btc`, `bch`, `eth`, `xrp`, `hyt`
- Sign: `btc`, `bch` only
## Related
- `docs/commands.md` - Full command reference
- `docs/crypto/btc/psbt/user-guide.md` - PSBT workflow
- `docs/crypto/btc/taproot/user-guide.md` - Taproot usage
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「wallet-cli」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次