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?
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.
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)
ropsten: {
network_id: 3,
host: "localhost",
port: 8545,
gas: 2900000
}
Open Terminal Window 1
reference: https://github.com/ethereum/go-ethereum/wiki/Managing-your-accounts
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"
geth --testnet --networkid=3 account list
geth --testnet --networkid=3 \
--rpc \ --rpcaddr="localhost" \ --rpcport=8545 \ --rpcapi="db,eth,net,web3,admin,personal"
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
$ 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.
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. Seegeth --helpor 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. Seeparity --helpfor details.More at http://ethereum.stackexchange.com/questions/3996/error-personal-unlockaccount-method-not-implemented.