current position:Home>When setting the default initiating account, the console reports an error: Web3 eth. defaultAccounts is not a function

When setting the default initiating account, the console reports an error: Web3 eth. defaultAccounts is not a function

2022-02-03 20:47:57 Q & A of Denglian community




Take the answer 1:

Pay attention to check web3 Documents , Should be :

        web3.eth.defaultAccount = web3.eth.accounts[0];

You check your own web3 Version of ? View the corresponding version of the document .web3.js v1.2 file

web3.js v0.20 file




copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032047555598.html

Random recommended