1

我正在尝试在这里完成“运行节点”教程:https ://github.com/cosmos/cosmos-sdk/blob/master/docs/run-node/run-node.md

不过,我似乎有一些问题,创世交易无法设置验证器,因此验证器集为空,应用程序停止。我错过了什么吗?

我正在运行script.sh并收到错误消息error.log

simd versiongoz-phase-1-1119-g8572a84eb

script.sh

#!/bin/bash
set -eu

PATH=build:$PATH

MONIKER=foobar

simd init $MONIKER --chain-id my-test-chain

simd keys add my_validator --keyring-backend test

# Put the generated address in a variable for later use.
MY_VALIDATOR_ADDRESS=$(simd keys show my_validator -a --keyring-backend test)

simd add-genesis-account $MY_VALIDATOR_ADDRESS 100000000stake

# Create a gentx.
simd gentx my_validator 100000stake --chain-id my-test-chain --keyring-backend test

# Add the gentx to the genesis file.
simd collect-gentxs

simd start

error.log

5:09PM INF starting ABCI with Tendermint
5:09PM INF Starting multiAppConn service impl={"Logger":{}} module=proxy
5:09PM INF Starting localClient service connection=query impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
5:09PM INF Starting localClient service connection=snapshot impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
5:09PM INF Starting localClient service connection=mempool impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
5:09PM INF Starting localClient service connection=consensus impl="marshaling error: json: unsupported type: abcicli.Callback" module=abci-client
5:09PM INF Starting EventBus service impl={"Logger":{}} module=events
5:09PM INF Starting PubSub service impl={"Logger":{}} module=pubsub
5:09PM INF Starting IndexerService service impl={"Logger":{}} module=txindex
5:09PM INF ABCI Handshake App Info hash= height=0 module=consensus protocol-version=0 software-version=
5:09PM INF ABCI Replay Blocks appHeight=0 module=consensus stateHeight=0 storeHeight=0
5:09PM INF asserting crisis invariants inv=0/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=1/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=2/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=3/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=4/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=5/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=6/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=7/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=8/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=9/11 module=x/crisis
5:09PM INF asserting crisis invariants inv=10/11 module=x/crisis
5:09PM INF asserted all invariants duration=0.844065 height=0 module=x/crisis
5:09PM INF created new capability module=ibc name=ports/transfer
5:09PM INF port binded module=x/ibc/port port=transfer
5:09PM INF claimed capability capability=1 module=transfer name=ports/transfer
Error: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain
Usage:
  simd start [flags]

Flags:
      --abci string                                     specify abci transport (socket | grpc) (default "socket")
... [other usage info]
4

2 回答 2

1

我自己尝试过,看到了同样的错误,但能够通过将simd gentx命令中的股份数量增加到100000000stake. 它现在的工作方式如下:

#!/bin/bash
set -eu

PATH=build:$PATH

MONIKER=foobar

simd init $MONIKER --chain-id my-test-chain

simd keys add my_validator --keyring-backend test

# Put the generated address in a variable for later use.
MY_VALIDATOR_ADDRESS=$(simd keys show my_validator -a --keyring-backend test)

simd add-genesis-account $MY_VALIDATOR_ADDRESS 100000000stake

# Create a gentx.
simd gentx my_validator 100000000stake --chain-id my-test-chain --keyring-backend test

# Add the gentx to the genesis file.
simd collect-gentxs

# simd start

你从哪里得到的script.sh文件?我没有在https://github.com/cosmos/cosmos-sdk/blob/master/docs/run-node/run-node.md中看到它

于 2021-01-27T11:31:23.083 回答
0

okwme 的回答是正确的。但是,simd add-genesis-account如果您想更多地使用该帐户,也应该增加初始余额(用 设置)。在本教程中,稍后该帐户将一些发送stake到另一个帐户。但是使用上面的脚本,全部金额都$MY_VALIDATOR_ADDRESS被委托了,所以不能发送。

于 2021-01-27T15:01:45.187 回答