【发布时间】:2019-06-23 12:46:40
【问题描述】:
我已经知道accounts.create() 和personal.newAccount() 之间的区别。
我的Geth设置是这样的,
--rpcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3"
web3.eth.getBalance()运行良好。
但是web3.eth.accounts.create() 和web3.eth.personal.newAccount() 都不起作用。
没有任何错误消息。只是没有回应。
对于这种情况我该怎么办?请帮帮我。
这是示例代码。
const Web3 = require("web3");
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); // Geth RPC is working.
...
const password = "test1234";
const account = web3.eth.personal.newAccount(password); // not work.
console.log(account); // not work. not print anything.
【问题讨论】: