What is the correct process to unlock an account? I was able to do this successfully in the geth console(see this post for more details on what I've tried Why does account show 0 balance, after seemingly successful transaction in geth console?)
2 Answers
Well, there are a few ways to unlock an account
- While starting geth, you can use
--unlock
Unlock an account (may be creation index) until this program exits (prompts for password).
--unlock
takes multiple params, it could be an index of your account like0, 2, 3
or it can be an address0x12a..
or this can beprimary
to unlock primary account.
- from the geth console
personal.unlockAccount(address, "password")
Unlock multiple accounts from the command line
--unlock Unlock an account (may be creation index) until this program exits (prompts for password)
--password Password file to use with options/subcommands needing a pass phrase
Command example
geth --unlock primary --password "/path/to/file"
this will unlock your primary
account if the password specified in "/path/to/file"
is correct.
From How to unlock accounts programmatically after the node has started? :
> geth --exec "personal.unlockAccount(eth.accounts[0], 'password', 1000)" attach
true
You are probably using the RPC API interface, so will need to enable the personal
API using
geth [your options] --rpcapi "eth,net,web3,admin" [more options]
But be careful with the RPC API and the unlocking of your wallet if you hold real ethers in your wallet. See How to reduce the chances of your Ethereum wallet getting hacked?.