0

I'm following the tutorial here: https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2

First, I got the error "Error: Invalid JSON RPC response". Then I search for answers and I found that I didn't run testrpc ( very "fullstack" tutorial, really, like the all other "complete" tutorials about ethereum...

Anyway, I found a solution here, open another terminal and run geth console and type:

admin.startRPC("127.0.0.1", 8545, "*", "web3,db,net,eth")

This time I got an "empty" list for web3.eth.accounts. I tried to add manually but I couldn't do it also.

Is there any possible solution for this?

1

Edit: Answering my own question, I did not want to delete it, if someone encounters with the same problem, maybe get benefit from here.

To use web3js, solc and testrpc, first of all update your node via nvm. Than the problem will be solved. No need to run TestRPC inside of the geth. Just run it from node_modules/.bin/testrpc.

1

In one console window run

testrpc

if you don't have it run

npm install ethereumjs-testrpc web3

Then in another console run

node

Web3 = require('web3')

web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

web3.eth.accounts

  • yes I knew it but without updating node version, it doesn't work. There's conflict because of the JS versioning (ES5-ES6). In the tesrpc code, as I understood, ES6 arrow functions used, so testrpc doesn't work on older versions of node. – Melih Nov 15 '17 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.