Skip to content
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

Implement peerstore #5544

Closed
algoanne opened this issue Jul 11, 2023 · 1 comment · Fixed by #5576
Closed

Implement peerstore #5544

algoanne opened this issue Jul 11, 2023 · 1 comment · Fixed by #5576
Assignees
Labels
p2p Work related to the p2p project Team Lamprey

Comments

@algoanne
Copy link
Contributor

Problem

Algod needs to be able to keep track of data about hosts in the network. Peerstore is an interface in libp2p which provides methods for doing that, and will be required for using the swarm/dialer/host/network implementations in libp2p.

Solution

Add the ability for algod to construct a peerstore (populated with some mocked out peer info).

Lets look at both of the implementation currently in libp2p in memory and kv backed and see if one is better that the other in terms of how it integrates with persistence in #3004

Include documentation of our implementation (and especially how it differs from the standard).

@algoanne algoanne added new-feature-request Feature request that needs triage Team Lamprey and removed new-feature-request Feature request that needs triage labels Jul 11, 2023
@algoanne
Copy link
Contributor Author

Some discussion:

libp2p has an implementation of the host interface, https://github.com/libp2p/go-libp2p/blob/master/p2p/host/basic/basic_host.go#L64 which gives us the node's peer ID and an in-mem peerstore. can we use this one?

For NewHost https://github.com/libp2p/go-libp2p/blob/master/p2p/host/basic/basic_host.go#L166C24-L166C31 you have to pass in a Network which is where it takes its Peerstore from.

a persistent peerstore constructor takes an ipfs datastore type https://github.com/libp2p/go-libp2p/blob/master/p2p/host/peerstore/pstoreds/peerstore.go#L13. And I think this is what we want to use instead of the in-memory peerstore. There are several implementations of the go-datastore that we can use, https://github.com/ipfs. For the POC, I'll use leveldb.

@algoanne algoanne closed this as completed Aug 1, 2023
@jsgranados jsgranados added the p2p Work related to the p2p project label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2p Work related to the p2p project Team Lamprey
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants