连接到 Ethereum Ropsten Testnet 网络失败

Connection failed to Ethereum Ropsten Testnet network

我想用以太坊区块链做Dapp。对于 运行 智能合约演示,我指的是下面 link :

https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-2-30b3d335aa1f

其中,第 1 步发出命令以连接到以太坊的 Testnet 网络以部署智能合约。其中,我在我的控制台上看不到任何正在下载的数据库,我已经分享了相同的屏幕截图。

然后我切换到下载松露的后续步骤。当我启动松露控制台命令时,再次出现以下错误:

Could not connect to your Ethereum client. Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle.js)

那么,如何运行 link 中给出的投票申请。如果有人有任何其他 link 智能合约演示,请与我分享。

如果您想按原样学习本教程,则需要在继续执行第 2 步之前解决第 1 步(您可以 运行 只使用 Truffle 的示例,但步骤不同)。看起来您的节点根本没有同步。通过启动控制台验证节点的完整性(您可以在 geth 运行ning geth attach '//./pipe/geth.ipc' 时连接到您的节点)。进入控制台后,运行 eth.syncing 并查看结果。

如果您的节点工作正常,您应该会看到如下内容:

$ geth attach '//./pipe/geth.ipc'
Welcome to the Geth JavaScript console!

instance: Geth/TrustDevTestNode/v1.8.2-stable-b8b9f7f4/windows-amd64/go1.9.2
coinbase: 0x0a78c28257b40d5076ea180bc6a9e4c597c5ea98
at block: 280377 (Tue, 03 Jan 2017 19:36:08 PST)
 datadir: C:\cygwin\home\adamk\eth\geth\data\testnet
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> eth.syncing

{
  currentBlock: 282100,
  highestBlock: 2803215,
  knownStates: 0,
  pulledStates: 0,
  startingBlock: 0
}

如果看到这个,让节点同步,直到currentBlock和highestBlock相同。如果 eth.syncing returns 为 false,则您的节点未 运行 正确(这可能基于您发布的内容)。如果是这样,请执行以下操作:

  1. 停止你的节点
  2. 完全删除您的区块链数据(/home/riyasoni/.ethereum/testnet 在您的情况下)
  3. 升级到最新版本的 geth(您正在 运行ning 1.7.3。截至 2018 年 3 月 9 日,最新版本为 1.8.2)
  4. 重启geth。你的 运行ning geth 的方式没有任何问题,但我个人不会使用 --bootnodes 选项,我会花时间 运行 和 --syncmode "full"。 运行 快速同步模式有限制,如果您停止节点一段时间然后尝试重新启动,您的节点将完全停止同步。您的节点需要时间才能完全同步。

完成这些步骤后,在继续使用 Truffle 之前再次检查控制台中节点的状态。