I have my Metamask open connected to the Rinkeby network.

In Andreas' Mastering Ethereum book he has the following instructions to interact with Web3.

"Open a Javascript Console in a Broswer with Metamask running... and then type web3.eth.getTransactionCount('0xF962e09a92F4127bbC770c22aF41a0c3BaF0b66a')"

Why is this not working for me? Thank you

enter image description here

  • The error-message web3 is not defined tells you exactly what the problem is. Do you import web3 anywhere??? Oct 7 '20 at 8:53
  • I didn't import Web3 on my machine. There was no mention of this step in the book unless I missed it. I thought Web3 was installed as part of the Metamask extension.
    – Picard78
    Oct 7 '20 at 9:35
  • I'd like to install as little as possible on my machine. I use remix currently to compile my solidity code. Do I need to install NodeJs to get access to Web3? Thank you. medium.com/b2expand/install-web3-fc96b885a7b
    – Picard78
    Oct 7 '20 at 9:39
  • I watched some videos on YouTube in regards to Web3. It appears I need to install Node.js. I will hold off on doing this right now.
    – Picard78
    Oct 8 '20 at 11:07
  • @Picard78 Metamask has been deprecating web3 for some time, it seems in the last release they have removed it enterely. The book as a github repo, perhaps you can ask there if there's an update to that part of the book github.com/ethereumbook/ethereumbook.
    – Ismael
    Oct 8 '20 at 18:50

I just learned that I can interact with web3 from the Remix Terminal. As Ismael stated web3 has been deprecated from Metamask. Note: for this to work with Rinkeby, a connection must be made via Injected Web3 to Metamask from Remix.

enter image description here

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.