This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: make peer store methods atomic (#368)
The existing peer store interface has separate sub-stores for addresses, protocols, metadata, etc. Each method is async due to the underlying datastore being async. This means it's impossible to do atomic writes to the peer store if you have multiple sets of data to write. Internally, however, the default peer store implementation stores the peer data as a single datastore entry keyed on the peer id. This PR: 1. Removes the sub-stores in favour of atomic `set`/`update` methods for peer data 2. Removes `@libp2p/peer-store` specific init types 3. Removes tagging methods in favour of `set`/`update` for peer data 4. Removes references to consuming peer records since this is part of the identify protocol so should be handled there
- Loading branch information