Web3.js: The method personal_unlockAccount does not exist?

Created on 16 Nov 2016  Â·  5Comments  Â·  Source: ChainSafe/web3.js

how to unlock an account?
like this : web3.personal.unlock(accounts[0],'password').
When I use this way to unlock a account, the error occurs: the method personal_unlockAccount does not exist. How to solve this error?

Most helpful comment

The problem is probably that you have not enabled the "personal" module on your RPC server (typically geth or parity).

If you use geth, start geth with an option like --rpcapi eth,net,web3,personal. See geth --help or https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options.

If you use parity, start parity with an option like --jsonrpc-apis eth,net,web3,personal. See parity --help for details.

More at http://ethereum.stackexchange.com/questions/3996/error-personal-unlockaccount-method-not-implemented.

All 5 comments

The problem is probably that you have not enabled the "personal" module on your RPC server (typically geth or parity).

If you use geth, start geth with an option like --rpcapi eth,net,web3,personal. See geth --help or https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options.

If you use parity, start parity with an option like --jsonrpc-apis eth,net,web3,personal. See parity --help for details.

More at http://ethereum.stackexchange.com/questions/3996/error-personal-unlockaccount-method-not-implemented.

I have used below code snippet to unlock account
web3.personal.unlockAccount('sendingAccountAddress', "accountPassword")

web3.eth.sendTransaction({
from: 'sendingAccountAddress',
to: 'receivingAccountAddress',
value: web3.toWei(0.1, "ether")
});

How to enable enable --rpcapi eth,net,web3,personal for ethereum block chain provisioned via Azure Portal

I was trying to deploy a smart contract by connecting Truffle to Geth. Below are the steps I followed to encounter the error Error: The method personal_unlockAccount does not exist/is not available. I was using Geth/v1.8.2-stable/darwin-amd64/go1.10, Truffle v4.0.6 (core: 4.0.6), Solidity v0.4.19 (solc-js)

  • Add to truffle.js file:
ropsten: {
  network_id: 3,
  host: "localhost",
  port: 8545,
  gas: 2900000
}
touch "/Users/Ls/Downloads/MetaMask RopTest1 Password";
chmod 700 "/Users/Ls/Downloads/MetaMask RopTest1 Password";
cat > "/Users/Ls/Downloads/MetaMask RopTest1 Password";
> (((ENTER PASSWORD: testtest, then PRESS CTRL+D to exit)))

geth --testnet --networkid=3 account import \
  --password="/Users/Ls/Downloads/MetaMask RopTest1 Password" \
  "/Users/Ls/Downloads/MetaMask RopTest1 Private Key.csv"
  • show Ropsten testnet account list
geth --testnet --networkid=3 account list

geth --testnet --networkid=3 \
  --rpc \ --rpcaddr="localhost" \ --rpcport=8545 \ --rpcapi="db,eth,net,web3,admin,personal"
  • Open Terminal Window 2
geth attach http://127.0.0.1:8545

> personal.unlockAccount(eth.accounts[1])
Unlock account 0xcdea3bfc82cbe46b8a7a8a648eda0969f145468b
Passphrase: 
Error: The method personal_unlockAccount does not exist/is not available
  • Open Terminal Window 3
$ truffle migrate  --network ropsten
Using network 'development'.

Running migration: 1_initial_migration.js
  Replacing Migrations...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock

I've closed this issue because it works if the personal api is activated in geth or parity.

Was this page helpful?
0 / 5 - 0 ratings