-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(network): database-backed peer store #877
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #877 +/- ##
=======================================
Coverage 83.30% 83.30%
=======================================
Files 173 173
Lines 8815 8845 +30
=======================================
+ Hits 7343 7368 +25
- Misses 1117 1118 +1
- Partials 355 359 +4 |
Two general comments:
|
@@ -157,3 +181,39 @@ func (mgr *peerMgr) CheckConnectivity() { | |||
} | |||
} | |||
} | |||
|
|||
type PeerStore struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we can't use peerMgr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lp2ppeer.ID
type makes a problem for us. Peer IDs going to be saved as the unicodes and then we can't retrive them at all. we can use map[string]PeerInfo
without defineing it as a type ot struct. but the main problem is json tags.
…into feature/peerManager
We need more R&D. The libp2p I think has persistent store for peers. |
…into feature/peerManager
The persistent store for peers is now deprecated. So, we can implement it ourselves. just we have 2 issues, the peers with private reachability and having a new struct for peer store (as I said we can't use current map on peer manager). About private peers, I thought if we can have reachability field on peerInfo struct too. |
Why did you close it? |
Description
Adding a new
peers.json
file in the working directory which when the node goes off will keep track of all connected peers. when we start the node again, we have all of the previous nodes to connect in the peer store.The
peer.json
looks like this:The node owner can change the peer store path in config.
Related issue(s)