Cosmos节点常用命令
September 30th, 2022

1、修改默认端口

命令修改

export DAEMON_HOME=$HOME/.<节点默认路径>  
sed -i 's/:6060/:6040/g' $DAEMON_HOME/config/config.toml
sed -i 's/:26657/:26647/g' $DAEMON_HOME/config/config.toml
sed -i 's/:26656/:26646/g' $DAEMON_HOME/config/config.toml
sed -i 's/:9090/:9040/g' $DAEMON_HOME/config/app.toml
sed -i 's/:9091/:9041/g' $DAEMON_HOME/config/app.toml
sed -i 's/:1317/:1347/g' $DAEMON_HOME/config/app.toml

4就是修改的端口

client.toml文件里的也要修改,可以手动修改下,修改为跟rpc端口一样,rpc端口是在config.toml文件里,默认为26657

查看同步状态

curl -s localhost:<rpc端口>/status | jq .result | jq .sync_info

查看运行日志

sudo journalctl -u <创建的linux server服务名> -f -o cat

server服务一般位于/etc/systemd/system/

创建钱包

<项目命令符> keys add <钱包名>

导入钱包

<项目命令符> keys add <钱包名> --recover

质押报错原因

1、没有指定具体网络

--chain-id=XXX

2、地址不是质押地址而是钱包地址

使用命令查看val地址

<项目命令符> debug addr 钱包地址

3、gas不足但代币足够

示例报错

raw_log: 'insufficient fees; got:  required: 5000umpwr: insufficient fee'

解决:强制使用gas

报错解决示例

--fees 5000umpwr
Subscribe to 狂神
Receive the latest updates directly to your inbox.
Nft graphic
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from 狂神

Skeleton

Skeleton

Skeleton