I would like to use it to enhance swarm connectivity quality.
I cannot succeed using ipfs config --json to change it with a jq prepared file?
Does the effect is needing daemon restart or it is reloaded automatically?
I use it to keep my laptop and my desktop connected whenever they are both up, it works great. The first thing you need to know is that you need to control both sides and that both need to have peering entries pointing at each other. Never have one sided peering, it only leads to grief. Second, yes, you need to restart after changing the config file for the changes to take effect. Third, here is what it looks like on one of my nodes (I redacted the ID):
You don’t need to enter addresses if your node is able to connect to the network, it will use the network to look up the addresses for that node (which is key for my laptop, as its address depends on where I am connecting from, which changes). Of course, at least one of the two nodes needs to be able to dial the other, or it will never work. Again, make sure that both ends of a peering agreement are configured.
Peering is a relationship. A one-sided relationship is called stalking. All jokes aside, here is an excerpt from the docs:
Peering can be asymmetric or symmetric:
When symmetric, the connection will be protected by both nodes and will likely
be vary stable.
When asymmetric, only one node (the node that configured peering) will protect
the connection and attempt to re-connect to the peered node on disconnect. If
the peered node is under heavy load and/or has a low connection limit, the
connection may flap repeatedly. Be careful when asymmetrically peering to not
That false btw.
You can peer with someone that doesn’t peer with you.
It is still better for both sides to peer together because then the connection will be stable.
The difference is that if the peering is non-reciprocal the other peer (the one who havn’t added to it’s peering table) will close the connection from time to time because it thinks it is useless.
Then the peered node will reopen the connection right after.
I’m not saying you can never use asymmetric peering, I’m saying that, if your goal is to do it with a well known public server, don’t! Please see my other post on the matter, which goes into more details as to why it should not be encouraged:
Yeah, I agree. I worded it that way on purpose though, hoping that it would discourage some from peering with public servers. Anyway, I later pasted from the docs, which clearly state what the exact situation is, and what the potential downside is.