0

[Geth client command]

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

[node.js Web3 code]

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

This is the error message I've got right below

> TypeError: The latest parameter should be a function otherwise it can't be as callback at NewAccountMethod.set (C:\Users\june\Documents\WebProject\webWalletTest\node_modules\web3-core-method\dist\web3-core-method.cjs.js:411:17) at Proxy.anonymousFunction (C:\Users\june\Documents\WebProject\webWalletTest\node_modules\web3-core-method\dist\web3-core-method.cjs.js:224:28)

I wanted to see a function "web3.eth.personal.newAccount". but I can't find the function.

Even I tried to find out with double tab (auto completion) but it didn't exist.

Was it gone?

TylerH
  • 20,799
  • 66
  • 75
  • 101
June
  • 346
  • 4
  • 16

1 Answers1

0

I used web3.personal directly and I was able to access the methods inside it again.

This is weird because in the console, web3.eth.personal is still what works but in the script for a browser, it doesn't.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Willower
  • 1,099
  • 8
  • 22