Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions compconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"context"
"time"

"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-routing-helpers/tracing"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
"github.com/multiformats/go-multihash"
)
Expand Down Expand Up @@ -37,3 +39,11 @@ type ReadyAbleRouter interface {
type ComposableRouter interface {
Routers() []routing.Routing
}

// A DHTRouter provides DHT-specific operations.
type DHTRouter interface {
// GetClosestPeers returns the DHT closest peers to the given peer ID.
// If empty, it will use the content router's peer ID
// (self).
GetClosestPeers(ctx context.Context, key cid.Cid) (<-chan peer.AddrInfo, error)
}