Skip to content

Commit

Permalink
Merge pull request #42 from renaynay/idstore
Browse files Browse the repository at this point in the history
feat(p2p/idstore): Add PeerIDStore interface
  • Loading branch information
renaynay committed Jun 16, 2023
2 parents 8ce4a1c + b49173d commit 7da1572
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions p2p/pidstore.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package p2p

import (
"context"

"github.com/libp2p/go-libp2p/core/peer"
)

// PeerIDStore is a utility for persisting peer IDs of good peers to a datastore.
type PeerIDStore interface {
// Put stores the given peer IDs.
Put(ctx context.Context, peers []peer.ID) error
// Load loads the peer IDs from the store.
Load(ctx context.Context) ([]peer.ID, error)
}

0 comments on commit 7da1572

Please sign in to comment.