1

I would like to run two nodes in the same machine which has to share the same genesis file. I tried the following.

Terminal 1 (Node 1)

$ ./geth --datadir "node1/" init genesis.json

It shows successful

$ ./geth --datadir "node1/" --port 21212 console

eth.accounts

[]

It shows empty, eventhough there are three accounts are there in genesis file. Why it shows like that?

If I put like below then it works fine

Terminal 1 (Node 1)

$ ./geth init genesis.json

It shows successful

$ ./geth console

eth.accounts

[0Xadbee , 0xabde, 0xabcde]

2

perhaps you 've created your account previously in the default blockchain located in the default folder ~/.ethereum/ so when you change the folder its normal that your account are inaccessible by geth. try to copy the keystore folder from the ~/.ethereum/ to your new folder node1/ and remove other folders then relaunch your init command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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