How to get IP address of peer connected in private ethereum network?

0 votes
I created a Private Ethereum network and then made connections between my peer and other peers and it is successful. Now I want to check the IP address of the peer connected to my peer. How to do this?
Jan 10, 2019 in Blockchain by slayer
• 29,270 points
190 views

1 answer to this question.

0 votes

To get these details, you can use the admin.peers method. 

> admin.peer()

This method will return all the details of the connected peers. Along with the IP address, you will also see peer ID, name and  port.

The output will look something like this:

[{
      ID: 'a4de274d3a159e10c2c9a68c326511236381b84c9ec52e72ad732eb0b2b1a2277938f78593cdbe734e6002bf23114d434a085d260514ab336d4acdc312db671b',
      Name: 'Geth/v0.9.14/linux/go1.4.2',
      Caps: 'eth/60',
      RemoteAddress: '5.9.150.40:30301',
      LocalAddress: '192.168.0.28:39219'
}, {
      ID: 'a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c',
      Name: 'Geth/v0.9.15/linux/go1.4.2',
      Caps: 'eth/60',
      RemoteAddress: '52.16.188.185:30303',
      LocalAddress: '192.168.0.28:50995'

} ]
answered Jan 10, 2019 by Omkar
• 68,940 points

So only the admin of the network will be able to run the admin.peers method right? what if if i'm not the admin?

Related Questions In Blockchain

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
• 68,940 points
47 views
0 votes
1 answer

How to get Node URL in private ethereum network?

You have already noticed that  admin.peers does ...READ MORE

answered Jan 10, 2019 in Blockchain by Omkar
• 68,940 points
47 views
0 votes
1 answer

How to get the number of tokens in the Bitcoin network?

This information can easily be calculated by ...READ MORE

answered Aug 31, 2018 in Blockchain by Christine
• 15,810 points
62 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,810 points
227 views
0 votes
1 answer
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 699 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
• 68,940 points
114 views
–1 vote
1 answer

How to get balance of all accounts in ethereum network using javascript?

You can write a function that will ...READ MORE

answered Jan 9, 2019 in Blockchain by Omkar
• 68,940 points
100 views