Riya Soni
Riya Soni

Reputation: 197

Connection failed to Ethereum Ropsten Testnet network

I want to make Dapp by using Ethereum Blockchain. And for running the smart contracts demo, I am referring below link :

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

In that, step-1 is giving command to connect to the Testnet network of Ethereum for deploying the smart contracts. In which, I can't see any database is downloading on my console, I have shared the screenshot of the same.

Then I switch to the next steps for downloading the truffle. When I fired truffle console command, again I got the below error :

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)

So, how to run the voting application which is given in that link. If anybody have any other link for smart contracts demo, them please share with me.

enter image description here

Upvotes: 1

Views: 1381

Answers (1)

Adam Kipnis
Adam Kipnis

Reputation: 10971

If you want to follow the tutorial as is, you need to address step 1 before moving on to step 2 (you can run the example with just Truffle, but the steps are different). It looks like your node isn't syncing at all. Verify the integrity of your node by starting a console (you can attach to your node while geth is running geth attach '//./pipe/geth.ipc'). Once in the console, run eth.syncing and look at the results.

If your node is working correctly, you should see something like this:

$ 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
}

If you see this, let the node sync until the currentBlock and highestBlock are the same. If eth.syncing returns false, your node isn't running properly (which is likely based on what you posted). If so, do the following:

  1. Stop your node
  2. Completely remove your blockchain data (/home/riyasoni/.ethereum/testnet in your case)
  3. Upgrade to the latest version of geth (you're running 1.7.3. As of 3/9/2018, the latest version is 1.8.2)
  4. Restart geth. There's nothing wrong with the way your running geth, but personally I would not use the --bootnodes option and I would spend the time to run with --syncmode "full". Running in fast sync mode has limitations and your node will stop syncing entirely if you stop your node for some time and then try to restart. It will take time for your node to fully sync.

After completing those steps, check the status of the node in the console again before moving on to Truffle.

Upvotes: 2

Related Questions