1

I am using GETH console to unlock the account but i have been consistently getting error "Error: no key for given address or file". I looked into "C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore" and see two files present. could you please guide me if i am doing anything wrong. below is result

of command I executed.


-------------------------------------------------------------------
**List of account on testnet using Geth**

C:\Data\geth-alltools>geth --testnet account list
INFO [07-27|14:05:40.873] Maximum peer count                       ETH=25 LES=0 total=25
Account #0: {407c9c2b699f2380561c2bb13a400e1ea9149930} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T16-37-59.248164300Z--407c9c2b699f2380561c2bb13a400e1ea9149930
Account #1: {2b45bdd81e75be0502469ac81b1089d39cf5c051} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T17-09-09.768503000Z--2b45bdd81e75be0502469ac81b1089d39cf5c051

-------------------------------------------------------------------
**Trying to Unlock the account**



C:\Data\geth-alltools>geth --testnet attach http://localhost:8545
Welcome to the Geth JavaScript console!

instance: Geth/node1/v1.8.12-stable-37685930/windows-amd64/go1.10.3 modules: admin:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

personal.unlockAccount("2b45bdd81e75be0502469ac81b1089d39cf5c051") Unlock account 2b45bdd81e75be0502469ac81b1089d39cf5c051 Passphrase: Error: no key for given address or file

Update:

Created a new account by using GETH in testnet and searched for the key but still getting the same issue

C:\Data\geth-alltools>geth --testnet account new INFO [07-27|15:31:13.992] Maximum peer count ETH=25 LES=0 total=25 Your new account is locked with a password. Please give a password. Do not forget this password. Passphrase: Repeat passphrase: Address: {04db25008887fb28e0b8562b9c27f7d6ba0c751f}

file got created in C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore

C:\Data\geth-alltools>Geth --testnet account list INFO [07-27|15:33:20.217] Maximum peer count ETH=25 LES=0 total=25 Account #0: {407c9c2b699f2380561c2bb13a400e1ea9149930} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T16-37-59.248164300Z--407c9c2b699f2380561c2bb13a400e1ea9149930 Account #1: {2b45bdd81e75be0502469ac81b1089d39cf5c051} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T17-09-09.768503000Z--2b45bdd81e75be0502469ac81b1089d39cf5c051 Account #2: {04db25008887fb28e0b8562b9c27f7d6ba0c751f} keystore://C:\Users\AppAdmin\AppData\Roaming\Ethereum\testnet\keystore\UTC--2018-07-27T19-31-23.029658500Z--04db25008887fb28e0b8562b9c27f7d6ba0c751f

Following Command was run on geth console

personal.unlockAccount("04db25008887fb28e0b8562b9c27f7d6ba0c751f", "Password",300) Error: no key for given address or file

9
  • copy the address from eth.accounts as it appears in the list
    – Nulik
    Commented Jul 27, 2018 at 18:36
  • I just ran the command in console. here is what i get eth.accounts []
    – userid2018
    Commented Jul 27, 2018 at 19:01
  • check ethereum.stackexchange.com/questions/8684/…
    – Badr Bellaj
    Commented Jul 27, 2018 at 19:20
  • @userid2018 then geth uses another data directory and keystore directory in that data directory doesn't have any accounts
    – Nulik
    Commented Jul 27, 2018 at 19:26
  • to discover which is the data directory used by your geth create a new account and then search for the address (without 0x) on your disk. The address string is part of the file name.
    – Nulik
    Commented Jul 27, 2018 at 19:28

2 Answers 2

0

you don't define the account's password : it should be somthing like this :

personal.unlockAccount("2b45bdd81e75be0502469ac81b1089d39cf5c051", "mypassword")

check unlockAccount definition :

personal.unlockAccount(address, passphrase, duration)
1
  • just tried personal.unlockAccount("2b45bdd81e75be0502469ac81b1089d39cf5c051", "mypassword",300). still get the same error.
    – userid2018
    Commented Jul 27, 2018 at 19:05
0

there are 2 ways

  1. unlockAccount by this command

personal.unlockAccount(address, passphrase, duration)

  1. unlockAccount when starting up your node

geth --unlock "YOUR_ACCOUNT_ADDRESS" --password "YOUR_PASSWORD"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.