juno
juno copied to clipboard
Nodes should reconnect to peers once they are online
Given the following scenario:
Node Ais a feeder node.Node Bis a regular P2P node.Node Ais online first.Node Bsyncs successfully fromNode A.Node Agoes offline.Node Bno longer syncs fromNode A.Node Agoes online again.Node Bshould automatically detects thatNode Ais online again, and attempts to resync from it.
However, that's not the case currently as Node B wasn't able to detect that Node A is online.
Not sure where the root cause is, but have some ideas for solution:
- Persists the peer information somewhere and loads it whenever the node is started. In this way,
Node Acould notifyNode Bthat it is online. - Regularly ping peers if they are online.
LIbp2p automatically detects when an old nodes come back online but it does take some time. This is probably due to how often the DHT table is refreshed. I would recommend to wait a little while longer.
I want to try this one out, with the first way.
@IronGauntlets as you said, the Node gets connected after waiting for a little longer time, so is it okay this way or should there be another way for connecting to the past peer automatically, (Eg. a flag)