尝试启动Cosmos sdk教程中的testnet时出错

时间:2018-10-14 01:02:20

标签: blockchain tendermint

我正在关注Cosmos SDK教程here,并且在运行make localnet-start时遇到以下错误

docker-compose down
Removing network cosmos-sdk_localnet
WARNING: Network cosmos-sdk_localnet not found.
panic: Panicked on a Sanity Check: Could not create directory /gaiad/node0/gaiad. mkdir /gaiad/node0: permission denied

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/common.PanicSanity(0xd34fc0, 0xc420069f40)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/common/errors.go:224 +0xe4
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/config.EnsureRoot(0x7fffbc1c4f0e, 0x12)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/config/toml.go:27 +0x367
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/cmd/tendermint/commands.ParseConfig(0x10965e0, 0xc420ab3b90, 0x1)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/cmd/tendermint/commands/root.go:37 +0xf2
github.com/cosmos/cosmos-sdk/server.interceptLoadConfig(0xeb88ad, 0xeb89c5, 0x7)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/server/util.go:83 +0x15b
github.com/cosmos/cosmos-sdk/server.PersistentPreRunEFn.func1(0xc420b0f8c0, 0xc420484580, 0x0, 0x8, 0x0, 0x0)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/server/util.go:50 +0x88
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli.concatCobraCmdFuncs.func1(0xc420b0f8c0, 0xc420484580, 0x0, 0x8, 0x0, 0x0)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli/setup.go:115 +0x7d
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).execute(0xc420b0f8c0, 0xc420484500, 0x8, 0x8, 0xc420b0f8c0, 0xc420484500)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:677 +0x57e
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420b0eb40, 0xdb7580, 0xc420091e01, 0xc42000ad00)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:783 +0x2e4
github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420b0eb40, 0xc42000ad00, 0xc420091ed8)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/spf13/cobra/command.go:736 +0x2b
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc420b0eb40, 0x1021150, 0x2, 0xc420a8a480)
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/cli/setup.go:89 +0x4e
main.main()
    /Users/ryancheng/go/src/github.com/cosmos/cosmos-sdk/cmd/gaia/cmd/gaiad/main.go:38 +0x214
chmod: /gaiad: Operation not permitted
chmod: /gaiad: Operation not permitted
make: *** [localnet-start] Error 1

我尝试使用sudo,但遇到相同的错误。知道为什么吗?预先感谢。

2 个答案:

答案 0 :(得分:0)

问题似乎就在您的输出之上:

  

惊慌:在健全性检查中惊慌失措:无法创建目录/ gaiad / node0 / gaiad。 mkdir / gaiad / node0:权限被拒绝

正在发生的是,“ localnet”需要为所有节点预先创建配置,然后才能启动该节点。默认情况下,此操作在您的build/文件夹中完成,然后与docker作为卷(/gaiad)共享该文件夹。现在,似乎docker由于某种原因无法写入该文件夹。 错误的其余部分表明gaiad无法读取配置(因为我们无法编写配置),并且它无法更改未创建的文件夹的所有权。

要对此进行进一步的故障排除,我需要知道您使用的操作系统以及为Docker设置的权限。例如,对于OSX,您需要明确告诉Docker守护程序(顶部的小应用程序图标),您可能要在build/文件夹下附加一个卷。在Linux的情况下,您可能已启用SELinux-但该部分已包含在撰写文件中。在Windows上...尚未进行测试。

答案 1 :(得分:0)

该链接不再起作用。我相信现在可以在这里找到相同的信息:https://hub.cosmos.network/master/gaia-tutorials/deploy-testnet.html

自您发布此问题以来已经有一段时间了,使用新的说明时会发生错误吗?