节点要求要使用 query 和 tx 命令,你的 evmd 节点必须满足以下任一条件:
  • 与你正在交互的网络完全同步,或
  • 已配置为在 ~/.evmd/config/client.toml 中使用外部 RPC 端点
client.toml 配置示例:

# The network chain ID
chain-id = "myapp-1"

# The keyring's backend
keyring-backend = "os"

# CLI output format
output = "text"

# <host>:<port> to CometBFT RPC interface for this chain
node = "tcp://localhost:26657"

# Transaction broadcasting mode (sync|async)
broadcast-mode = "sync"
如果要使用外部 RPC,请更新 node 字段,使其指向一个公共或私有 RPC 端点。

全局参数

这些参数适用于所有命令:
参数说明默认值
-b, --broadcast-mode交易广播模式(sync|async)sync
--chain-id指定发送交易时使用的 Chain ID
--fees与交易一同支付的手续费(例如 10atest)
--from用于签名的私钥名称或地址
--gas-adjustment乘以交易模拟返回估算值的调整系数1
--gas-prices用于确定交易手续费的 Gas 价格(例如 10atest)
--home配置和数据目录~/.evmd
--keyring-backend选择 keyring 后端os
--log_format日志格式(json|plain)plain
--log_level日志级别info
--log_no_color禁用彩色日志
--node连接到 CometBFT RPC 接口的 <host>:<port>tcp://localhost:26657
--trace出错时打印完整堆栈跟踪

命令

启动节点

evmd start

节点初始化

evmd init my-node --chain-id cosmos-evm-1

节点状态

evmd status

交易索引

evmd index-eth-tx forward

示例

完整工作流

# 创建新的 Cosmos 账户
evmd keys add my-account

# 请妥善保存助记词!
# 将显示地址,格式为 cosmos1...

配置

  • 配置目录:~/.evmd/
  • 密钥存储:由 keyring 后端管理(os、file、test)
  • 节点配置:~/.evmd/config/config.toml
  • 应用配置:~/.evmd/config/app.toml
如果你在初始化轻客户端时使用 --home 标志,根目录/config 目录将会在该位置生成

Node RequirementsTo use the query and tx commands, your evmd node must either:
  • Be fully synced with the network you’re interacting with, OR
  • Be configured to use an external RPC endpoint in ~/.evmd/config/client.toml
Example client.toml configuration:
# The network chain ID
chain-id = "myapp-1"
# The keyring's backend
keyring-backend = "os"
# CLI output format
output = "text"
# <host>:<port> to CometBFT RPC interface for this chain
node = "tcp://localhost:26657"
# Transaction broadcasting mode (sync|async)
broadcast-mode = "sync"
To use an external RPC, update the node field to point to a public or private RPC endpoint.

Global Flags

These flags are available for all commands:
FlagDescriptionDefault
-b, --broadcast-modeTransaction broadcasting mode (sync|async)sync
--chain-idSpecify Chain ID for sending Tx
--feesFees to pay along with transaction (e.g., 10atest)
--fromName or address of private key with which to sign
--gas-adjustmentAdjustment factor to multiply against the estimate returned by tx simulation1
--gas-pricesGas prices to determine the transaction fee (e.g., 10atest)
--homeDirectory for config and data~/.evmd
--keyring-backendSelect keyring’s backendos
--log_formatThe logging format (json|plain)plain
--log_levelThe logging levelinfo
--log_no_colorDisable colored logs
--node<host>:<port> to CometBFT RPC interfacetcp://localhost:26657
--tracePrint out full stack trace on errors

Commands

Starting the Node

evmd start

Node Initialization

evmd init my-node --chain-id cosmos-evm-1

Node Status

evmd status

Transaction Indexing

evmd index-eth-tx forward

Examples

Complete Workflows

# Create new Cosmos account
evmd keys add my-account

# Save mnemonic safely!
# Address will be shown as cosmos1...

Configuration

  • Configuration directory: ~/.evmd/
  • Key storage: Managed by the keyring backend (os, file, test)
  • Node configuration: ~/.evmd/config/config.toml
  • App configuration: ~/.evmd/config/app.toml
If you use the --home flag upon initializing the light client, the root/config directory will be generated there