Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

P2p handshakes happening despite --maxpeers 0 cli flag #864

Closed
cobordism opened this issue Aug 8, 2018 · 5 comments
Closed

P2p handshakes happening despite --maxpeers 0 cli flag #864

cobordism opened this issue Aug 8, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@cobordism
Copy link

Expected behaviour:

When we set --maxpeers 0 we expect the Swarm node to be "in singleton mode". Specifically we expect there to be no handshakes with other peers.
See also:
https://swarm-guide.readthedocs.io/en/latest/gettingstarted.html#swarm-in-singleton-mode-no-peers

Actual behaviour:
Even with --maxpeers 0 the node still engages in handshakes.

@petyaracz
Copy link

It looks like now I can't drop peers with admin.removePeer either.

@nonsense
Copy link
Contributor

@homotopycolimit @zelig this is expected behaviour. maxpeers is not intuitive and does NOT mean that you will have 0 peers. It is just used for limiting inbound connections.

If you want to have a node running in singleton mode, probably best to use netrestrict option.

I am closing this, please open if you disagree or if you think this is a bug we should address.

@cobordism
Copy link
Author

I'm ok with using netrestrict. do the docs reflect this? and do the docs explain maxpeers correctly?

@nonsense
Copy link
Contributor

@homotopycolimit I haven't seen a good explanation of maxpeers, so I think the docs are wrong. It also depends on the DialRatio which can only be set in a toml config, and we have no config for in command line arguments.

@petyaracz
Copy link

I removed maxpeers from the latest version of docs. This version tells you how to run a singleton node. (The version hasn't moved to readthedocs yet)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants