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

Preserve PeerInfos discovered #68

Closed
daviddias opened this issue Mar 27, 2017 · 11 comments
Closed

Preserve PeerInfos discovered #68

daviddias opened this issue Mar 27, 2017 · 11 comments
Labels
exp/expert Having worked on the specific codebase is important

Comments

@daviddias
Copy link
Member

As brought up here: https://github.com/libp2p/js-libp2p/pull/64/files#r108192190

With the DHT, we will want to preserve PeerInfos discovered. This is also the start of having a way to add info about each Peer we know for statistics.

@daviddias daviddias added the exp/expert Having worked on the specific codebase is important label Mar 27, 2017
@dignifiedquire
Copy link
Member

dignifiedquire commented Mar 27, 2017

I would suggest using the peerBook to keep a record of all peers and details we have seen. In addition keeping a simple map peers or connectedPeers which are only {[PeerIdString]: Multiaddr} and record the information about current connections

@daviddias
Copy link
Member Author

Another feature to add is the ability to dump to disk the PeerBook, so that we can shutdown and boot the node and get back almost every connection

@dignifiedquire
Copy link
Member

yes, that should be easy to do now that we have the datastore

@dignifiedquire
Copy link
Member

we could actually move the peerbook to be a direct wrapper round reading and writing to the datastore instead of in memory that way we consume less memory and it's directly backed up

@daviddias
Copy link
Member Author

@dignifiedquire that would be quite nice! As long as there is some queueing for the writes, so that we don't stress with a 'good to have but not strictly necessary' operation that does lot of IO

@dignifiedquire
Copy link
Member

I can easily write datastore wrapper that batches ops if many come in at once :) but those read and writes to leveldb/indexedb are pretty cheap as well.

@dignifiedquire
Copy link
Member

Though warning, it will make the whole peerbook api async

@daviddias
Copy link
Member Author

@dignifiedquire we can keep it sync, with an interval that flushes it.

@dignifiedquire
Copy link
Member

that doesn't change reads

@daviddias
Copy link
Member Author

@dignifiedquire on repo open, it should just load all the peerBook into memory.

@daviddias
Copy link
Member Author

This has been done \o/

jacobheun pushed a commit to jacobheun/js-libp2p that referenced this issue Jul 29, 2019
Make identify not freak out on missing pubkey, it is ok.. this enables webrtc-star discovery to work fine
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Update project config to publish api docs
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Removes the dependency on uuid. Use a simpler random string generator instead.
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Allows setting the same tag twice, last update wins. Otherwise trying
to ensure atomic writes becomes very hard.
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
## [6.0.2](libp2p/js-libp2p-peer-store@v6.0.1...v6.0.2) (2023-03-02)

### Bug Fixes

* allow overwriting tags ([libp2p#68](libp2p/js-libp2p-peer-store#68)) ([4182211](libp2p/js-libp2p-peer-store@4182211))

### Trivial Changes

* Update .github/workflows/semantic-pull-request.yml [skip ci] ([e1271cf](libp2p/js-libp2p-peer-store@e1271cf))

### Dependencies

* **dev:** bump protons from 6.1.3 to 7.0.2 ([libp2p#60](libp2p/js-libp2p-peer-store#60)) ([0b5e25f](libp2p/js-libp2p-peer-store@0b5e25f))
achingbrain pushed a commit that referenced this issue Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important
Projects
None yet
Development

No branches or pull requests

2 participants