How to import an account in private ethereum network

–1 vote

I have created a new ethereum account using the following command: 

geth --datadir ./datadir account new

This was successful. Next, I created the genesis file with the account ID and allocated ethers to it. I initiated the genesis block and started the peer node.

All these steps were successful, I found no problem. 

But when I check the accounts, it shows not account.

> eth.accounts
[]

Why is this happening?

Jan 9, 2019 in Blockchain by digger
• 26,740 points
1,380 views

1 answer to this question.

0 votes

 When you create a new account, the data related to that account is stored in the UTC file. 

When you check the accounts from the geth console, it lists the details of accounts present in the ./data/keystore directory.

In your case, you have first created the account and then initialized the peer node which means the details of the newly created account is in the ./datadir(path mentioned in your command in the question) and not in the  ./data/keystore directory.

Copy the file from  ./datadir to ./data/keystore directory and then you will be able to see the account. 

answered Jan 9, 2019 by Omkar
• 69,210 points

Related Questions In Blockchain

0 votes
1 answer

Unable to perform an operation in Ethereum private network

It seems that the Unix socket can't ...READ MORE

answered Jul 31, 2018 in Blockchain by Shashank
• 10,400 points
900 views
+1 vote
2 answers

Not able to create new account in geth for private ethereum network

Looks like the account you are trying ...READ MORE

answered Dec 6, 2018 in Blockchain by Omkar
• 69,210 points
3,542 views
–1 vote
1 answer

How to connect two different nodes in private ethereum network?

To connect two nodes, you can use ...READ MORE

answered Jan 10, 2019 in Blockchain by Omkar
• 69,210 points
2,652 views
0 votes
1 answer

How to check peer connectivity in ethereum private network?

You can use the net module to check the ...READ MORE

answered Jan 10, 2019 in Blockchain by Omkar
• 69,210 points
1,332 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,709 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,241 views
0 votes
0 answers

Error: Unexpected token o in JSON at position 1

I have been working with Interacting a ...READ MORE

Mar 6, 2019 in Blockchain by saeedi
• 120 points

edited Mar 6, 2019 by Omkar 2,215 views
0 votes
1 answer

How to get account with ethers by default in ethereum private network?

Have you created an account before allocating ...READ MORE

answered Jan 9, 2019 in Blockchain by Omkar
• 69,210 points
1,509 views
–1 vote
1 answer

How to change default account in private ethereum network?

First list the accounts: > eth.accounts NOTE: Even ...READ MORE

answered Jan 10, 2019 in Blockchain by Omkar
• 69,210 points
1,647 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