3

I am running a private blockchain and have a couple of geth nodes which are connected. I have multiple accounts on both the nodes. From node 1, through the admin.peers command, I can get the enode URL of node 2. With this enode URL(including IP address and port #), is it possible to retrieve the list of accounts on node 2 from the geth instance on node 1?

3

No, by default you cannot see what accounts are controlled by other nodes on the network. However, you can get the IP address of your peers with

admin.peers[index].network.remoteAddress

If the other node has remote RPC enabled (start geth with the --rpc --rpcaddr * flags), however, it is possible to get their list of accounts.

You can either use nodeJS and use the remote host as a web3 provider, or you can fetch the list manually using

curl -X POST -d '{"method":"eth_accounts"}' remoteIP:8545

4

You need to know the address of the account you want to transfer to on node 2. Given the blockchain is private and you own both nodes, you should therefore know the addresses of the accounts on both.

On node 2, assuming that you're running Geth, you can run:

  • geth accounts list from the CLI, or
  • eth.accounts from within Geth's console
  • Sorry for the confusion. I wanted to know whether I could get the list of accounts on node 2 from the geth instance on node 1. – galahad Jun 13 '16 at 18:11
3

Accounts are not bounded to a node in any way. Like Richard said, you have useful functions like

  • geth accounts list from the CLI, or
  • eth.accounts from within Geth's console

to check what accounts a node can see. A node can actually see accounts if they are stored inside keystore folder (i.e. in windows %APPDATA%\Ethereum\keystore)

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.