最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

我找不到web3.eth.personal.newAccount

运维笔记admin20浏览0评论

我找不到web3.eth.personal.newAccount

我找不到web3.eth.personal.newAccount

[Geth客户端命令]

geth --rinkeby --rpc --rpcaddr "0.0.0.0" --rpcvhosts=* --rpcport "8545" --rpcapi "eth,net,web3,personal,admin" --syncmode "light" --cache "64"

[node.js Web3代码]

var Web3 = require("web3");
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
web3.eth.personal.newAccount("test").then(console.log)

这是我在下面得到的错误消息

> TypeError:最新参数应该是一个函数,否则它不能作为NewAccountMethod.set的回调(C:\ Users \ june \ Documents \ WebProject \ webWalletTest \ node_modules \ web3-core-method \ dist \ web3-core- method.cjs.js:411:17)在Proxy.anonymousFunction(C:\ Users \ june \ Documents \ WebProject \ webWalletTest \ node_modules \ web3-core-method \ dist \ web3-core-method.cjs.js:224: 28)

我想看一个函数“web3.eth.personal.newAccount”。但我找不到这个功能。

即使我试图找出双标签(自动完成),但它不存在。

它消失了吗?

回答如下:

我直接使用web3.personal,我能够再次访问其中的方法。

这很奇怪,因为在控制台中,web3.eth.personal仍然有效,但在浏览器的脚本中,它没有

我希望这有帮助。

发布评论

评论列表(0)

  1. 暂无评论