【发布时间】:2020-12-23 15:54:57
【问题描述】:
在旧版本的 web3 中,web3.eth.accounts[0] 返回一个特定的帐户。我将它用作投票函数的参数,如下所示:
app.vote(1, { from: web3.eth.accounts[0]})
从 1.2.x 版本开始,web3 使用 web3.eth.getAccounts() 返回节点控制的帐户列表。
如何像以前使用此 web3 版本一样获得特定帐户?
【问题讨论】:
标签: npm ethereum web3 truffle ganache