美文网首页
刘月林 | Invalid JSON RPC response:

刘月林 | Invalid JSON RPC response:

作者: 刘月林Yuelin_MELB | 来源:发表于2018-07-18 16:41 被阅读0次

I'm very new Ethereum and trying to follow this tutorial:
https://www.zastrin.com/courses/simple-voting-vid/lessons/3-4

But when I run:
deployedContract = VotingContract.new(['Rama','Nick','Jose'],{data: byteCode, from: web3.eth.accounts[0], gas: 4700000})

I get an error:


屏幕快照 2018-07-18 下午4.32.50.png

Solution:
Install web3 and testrpc packages: npm install ethereumjs-testrpc web3@0.20.1 In the same terminal window, run testrpc:
node_modules/.bin/testrpc Open a NEW terminal window (with the first one still open and running), and run node :

deployedContract = VotingContract.new(['Rama','Nick','Jose'],{data: byteCode, from: web3.eth.accounts[0], gas: 4700000})


环境配置2.gif

Finally, succeeded!

刘月林
写于湖北沙洋
2018/07/18

相关文章

网友评论

      本文标题:刘月林 | Invalid JSON RPC response:

      本文链接:https://www.haomeiwen.com/subject/yltapftx.html