1

I am installing a private network under PoA. I saw the maximum peer count is 25. That seems low to me. Can this figure be increased. Does this refer to just miners or any node?

Here is my output -

geth --datadir node1/ init genesis.json

INFO [04-16|13:20:01] Maximum peer count                       ETH=25 LES=0 total=25
INFO [04-16|13:20:01] Allocated cache and file handles         database=/home/satoshimaca/blockchain3/node1/geth/chaindata cache=16 handles=16
INFO [04-16|13:20:01] Writing custom genesis block 
INFO [04-16|13:20:01] Persisted trie from memory database      nodes=361 size=66.44kB time=1.903989ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [04-16|13:20:01] Successfully wrote genesis state         database=chaindata                                          hash=0ee2d8…baceba
INFO [04-16|13:20:01] Allocated cache and file handles         database=/home/satoshimaca/blockchain3/node1/geth/lightchaindata cache=16 handles=16
INFO [04-16|13:20:01] Writing custom genesis block 
INFO [04-16|13:20:01] Persisted trie from memory database      nodes=361 size=66.44kB time=2.372136ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [04-16|13:20:01] Successfully wrote genesis state         database=lightchaindata                                          hash=0ee2d8…baceba
2

In Geth, you can use the following flag to set the value to something else:

--maxpeers value Maximum number of network peers (network disabled if set to 0) (default: 25)

Does this refer to just miners or any node?

This refers to any node that is able to serve you the chain data you need. If you need all of it, these peers will be full nodes.

If you're running a light client, you can use corresponding flag to increase the number of light client (LES) peers:

--lightpeers value Maximum number of LES client peers (default: 20)

  • 2
    Is this independent of the genesis file? Does peer count refer to the entire network or just a node's nearest neighbours? – Trevor Oakley Apr 16 '18 at 15:10
  • 1
    Yes, it's independent of the genesis file. It's the node's nearest neighbours which it maintains connections to. (Your node is part of the entire network, which is thousands of nodes in size for the public chain - it doesn't connect to all of them.) I imagine there's a resource cost in maintaining more connections than the default 25, though I wouldn't know how to quantify it. – Richard Horrocks Apr 16 '18 at 15:14

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.