How to solve The method personal newAccount does not exist is not available Error

0 votes

I am working on web3 and running a private blockchain

The app.ts file:

import * as Web3 from 'web3';
var web3   = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:8546'));
web3.eth.getAccounts().then(accounts => {
    var sender = accounts[0];
    web3.eth.personal.unlockAccount(sender, 'password');
});

And I am getting the following error:

Unhandled rejection Error: Returned error: The method personal_newAccount does not exist/is not available
Jul 27, 2018 in Blockchain by digger
• 26,740 points
3,129 views

1 answer to this question.

0 votes
You are connecting using WS but have added personal to rpcapi. To make it work, you have add wsapi to your code and it will work.

Always be careful through what you are trying to connect and what you have written in your code.
answered Jul 27, 2018 by slayer
• 29,370 points

Related Questions In Blockchain

+1 vote
1 answer

How does a miner get to know that a transaction is verified by all the nodes?

Contrary to the popular belief, it is ...READ MORE

answered Mar 27, 2018 in Blockchain by Johnathon
• 9,090 points
2,839 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,923 views
+1 vote
5 answers

How to solve "truffle: command not found" error in blockchain?

First try restarting the system and then ...READ MORE

answered Jul 16, 2018 in Blockchain by slayer
• 29,370 points
11,947 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP