6

I see on ethstats that some node are connected to 100, or even 500+ peers. I figured I'd try to increase my peer counts, e.g., in the hope of getting blocks and transactions broadcasted more widely faster.

I use geth --maxpeers=70 , but then, when I go to the geth console (e.g., geth attach), it seems I'm only connected to 35 peers. Where does the limitation come from? How does the node stop accepting peers?

Should I manually call admin.addPeer to add another bunch of peers?

2 Answers 2

2

Being connected to 35 peers is usually more than enough. What are you trying to achieve that makes you want to be connected to more nodes?

I assume you are using a computer at home which usually is connected via a router to the internet, maybe even behind a firewall that limits possible connections further. This might limit the number of nodes that you are connected to. As outlined in the wiki, geth connects to some bootnodes which then tell your geth some other nodes that they know on startup. In order to allow incoming connections to your geth node pro-actively, geth supports UPnP but most routers have it disabled. Alternatively you could activate port forwarding to your geth machine on the router for TCP port 30303 and UDP port 30301 as described in this answer. If you are behind a very strict firewall that limits both TCP and UDP, you might have to setup a VPN or port forwarding tunnel to allow for more connections.

3
  • I'm hosting my node on an EC2 machine, I did open 30303 TCP, maybe it's limited to so little because I didn't open 30301?
    – Mario M
    Commented May 21, 2017 at 19:49
  • Try UDP port 30301
    – SCBuergel
    Commented May 22, 2017 at 7:34
  • I have deployed my nodes on digital ocean droplets. They all have the same configuration, but different nodes find different peer counts. What could it be? Commented Feb 19, 2019 at 19:29
-1

I added a rile for port forwarding from external IP port 30303 to internal IP port 30303 on a DLink and my peers jumped from 2 to 15 in a matter of 3 seconds.

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.