mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-25 06:42:13 +00:00
initial vendoring of libp2p outside of the repo with gx
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
parent
b356401194
commit
a5e5c57f3a
12
dht.go
12
dht.go
@ -10,21 +10,21 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
ci "github.com/ipfs/go-ipfs/p2p/crypto"
|
|
||||||
host "github.com/ipfs/go-ipfs/p2p/host"
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
protocol "github.com/ipfs/go-ipfs/p2p/protocol"
|
|
||||||
routing "github.com/ipfs/go-ipfs/routing"
|
routing "github.com/ipfs/go-ipfs/routing"
|
||||||
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
||||||
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
||||||
record "github.com/ipfs/go-ipfs/routing/record"
|
record "github.com/ipfs/go-ipfs/routing/record"
|
||||||
logging "github.com/ipfs/go-ipfs/vendor/QmQg1J6vikuXF9oDvm4wpdeAUvvkVEKW1EYDw9HhTMnP2b/go-log"
|
logging "gx/ipfs/QmaPaGNE2GqnfJjRRpQuQuFHuJn4FZvsrGxdik4kgxCkBi/go-log"
|
||||||
|
ci "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/crypto"
|
||||||
|
host "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/host"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
|
protocol "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/protocol"
|
||||||
|
|
||||||
proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
|
proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
|
||||||
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
||||||
goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
||||||
goprocessctx "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
|
goprocessctx "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("dht")
|
var log = logging.Logger("dht")
|
||||||
|
@ -8,13 +8,13 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
routing "github.com/ipfs/go-ipfs/routing"
|
routing "github.com/ipfs/go-ipfs/routing"
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
u "github.com/ipfs/go-ipfs/util"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
|
|
||||||
goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
goprocess "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
||||||
periodicproc "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/periodic"
|
periodicproc "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/periodic"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BootstrapConfig specifies parameters used bootstrapping the DHT.
|
// BootstrapConfig specifies parameters used bootstrapping the DHT.
|
||||||
|
10
dht_net.go
10
dht_net.go
@ -6,10 +6,10 @@ import (
|
|||||||
|
|
||||||
ggio "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/io"
|
ggio "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/io"
|
||||||
ctxio "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-context/io"
|
ctxio "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-context/io"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
inet "github.com/ipfs/go-ipfs/p2p/net"
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
||||||
|
inet "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/net"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// handleNewStream implements the inet.StreamHandler
|
// handleNewStream implements the inet.StreamHandler
|
||||||
@ -71,7 +71,7 @@ func (dht *IpfsDHT) handleNewMessage(s inet.Stream) {
|
|||||||
func (dht *IpfsDHT) sendRequest(ctx context.Context, p peer.ID, pmes *pb.Message) (*pb.Message, error) {
|
func (dht *IpfsDHT) sendRequest(ctx context.Context, p peer.ID, pmes *pb.Message) (*pb.Message, error) {
|
||||||
|
|
||||||
log.Debugf("%s dht starting stream", dht.self)
|
log.Debugf("%s dht starting stream", dht.self)
|
||||||
s, err := dht.host.NewStream(ProtocolDHT, p)
|
s, err := dht.host.NewStream(ctx, ProtocolDHT, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ func (dht *IpfsDHT) sendRequest(ctx context.Context, p peer.ID, pmes *pb.Message
|
|||||||
func (dht *IpfsDHT) sendMessage(ctx context.Context, p peer.ID, pmes *pb.Message) error {
|
func (dht *IpfsDHT) sendMessage(ctx context.Context, p peer.ID, pmes *pb.Message) error {
|
||||||
|
|
||||||
log.Debugf("%s dht starting stream", dht.self)
|
log.Debugf("%s dht starting stream", dht.self)
|
||||||
s, err := dht.host.NewStream(ProtocolDHT, p)
|
s, err := dht.host.NewStream(ctx, ProtocolDHT, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -11,15 +11,15 @@ import (
|
|||||||
|
|
||||||
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
||||||
dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync"
|
dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync"
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
ma "gx/ipfs/QmR3JkmZBKYXgNMNsNZawm914455Qof3PEopwuVSeXG7aV/go-multiaddr"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
netutil "github.com/ipfs/go-ipfs/p2p/test/util"
|
|
||||||
routing "github.com/ipfs/go-ipfs/routing"
|
routing "github.com/ipfs/go-ipfs/routing"
|
||||||
record "github.com/ipfs/go-ipfs/routing/record"
|
record "github.com/ipfs/go-ipfs/routing/record"
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
u "github.com/ipfs/go-ipfs/util"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
|
netutil "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/test/util"
|
||||||
|
|
||||||
ci "github.com/ipfs/go-ipfs/util/testutil/ci"
|
ci "github.com/ipfs/go-ipfs/util/testutil/ci"
|
||||||
travisci "github.com/ipfs/go-ipfs/util/testutil/ci/travis"
|
travisci "github.com/ipfs/go-ipfs/util/testutil/ci/travis"
|
||||||
|
2
diag.go
2
diag.go
@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
type connDiagInfo struct {
|
type connDiagInfo struct {
|
||||||
|
10
ext_test.go
10
ext_test.go
@ -10,16 +10,16 @@ import (
|
|||||||
ggio "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/io"
|
ggio "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/io"
|
||||||
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
||||||
dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync"
|
dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
inet "github.com/ipfs/go-ipfs/p2p/net"
|
|
||||||
mocknet "github.com/ipfs/go-ipfs/p2p/net/mock"
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
routing "github.com/ipfs/go-ipfs/routing"
|
routing "github.com/ipfs/go-ipfs/routing"
|
||||||
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
||||||
record "github.com/ipfs/go-ipfs/routing/record"
|
record "github.com/ipfs/go-ipfs/routing/record"
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
u "github.com/ipfs/go-ipfs/util"
|
||||||
|
inet "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/net"
|
||||||
|
mocknet "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/net/mock"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetFailures(t *testing.T) {
|
func TestGetFailures(t *testing.T) {
|
||||||
@ -120,7 +120,7 @@ func TestGetFailures(t *testing.T) {
|
|||||||
Record: rec,
|
Record: rec,
|
||||||
}
|
}
|
||||||
|
|
||||||
s, err := hosts[1].NewStream(ProtocolDHT, hosts[0].ID())
|
s, err := hosts[1].NewStream(context.Background(), ProtocolDHT, hosts[0].ID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,12 @@ import (
|
|||||||
|
|
||||||
proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
|
proto "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
|
||||||
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
u "github.com/ipfs/go-ipfs/util"
|
||||||
lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
|
lgbl "github.com/ipfs/go-ipfs/util/eventlog/loggables"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The number of closer peers to send on requests.
|
// The number of closer peers to send on requests.
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package dht
|
package dht
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
notif "github.com/ipfs/go-ipfs/notifications"
|
notif "github.com/ipfs/go-ipfs/notifications"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
||||||
pset "github.com/ipfs/go-ipfs/util/peerset"
|
pset "github.com/ipfs/go-ipfs/util/peerset"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Required in order for proper JSON marshaling
|
// Required in order for proper JSON marshaling
|
||||||
|
4
notif.go
4
notif.go
@ -1,9 +1,9 @@
|
|||||||
package dht
|
package dht
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "gx/ipfs/QmR3JkmZBKYXgNMNsNZawm914455Qof3PEopwuVSeXG7aV/go-multiaddr"
|
||||||
|
|
||||||
inet "github.com/ipfs/go-ipfs/p2p/net"
|
inet "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
// netNotifiee defines methods to be used with the IpfsDHT
|
// netNotifiee defines methods to be used with the IpfsDHT
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package dht_pb
|
package dht_pb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
ma "gx/ipfs/QmR3JkmZBKYXgNMNsNZawm914455Qof3PEopwuVSeXG7aV/go-multiaddr"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
inet "github.com/ipfs/go-ipfs/p2p/net"
|
logging "gx/ipfs/QmaPaGNE2GqnfJjRRpQuQuFHuJn4FZvsrGxdik4kgxCkBi/go-log"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
inet "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/net"
|
||||||
logging "github.com/ipfs/go-ipfs/vendor/QmQg1J6vikuXF9oDvm4wpdeAUvvkVEKW1EYDw9HhTMnP2b/go-log"
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("dht.pb")
|
var log = logging.Logger("dht.pb")
|
||||||
|
@ -6,9 +6,9 @@ import (
|
|||||||
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
||||||
goprocessctx "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
|
goprocessctx "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
|
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProviderManager struct {
|
type ProviderManager struct {
|
||||||
|
@ -4,9 +4,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
|
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestProviderManager(t *testing.T) {
|
func TestProviderManager(t *testing.T) {
|
||||||
|
10
query.go
10
query.go
@ -5,17 +5,17 @@ import (
|
|||||||
|
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
notif "github.com/ipfs/go-ipfs/notifications"
|
notif "github.com/ipfs/go-ipfs/notifications"
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
queue "github.com/ipfs/go-ipfs/p2p/peer/queue"
|
|
||||||
"github.com/ipfs/go-ipfs/routing"
|
"github.com/ipfs/go-ipfs/routing"
|
||||||
u "github.com/ipfs/go-ipfs/util"
|
u "github.com/ipfs/go-ipfs/util"
|
||||||
pset "github.com/ipfs/go-ipfs/util/peerset"
|
pset "github.com/ipfs/go-ipfs/util/peerset"
|
||||||
todoctr "github.com/ipfs/go-ipfs/util/todocounter"
|
todoctr "github.com/ipfs/go-ipfs/util/todocounter"
|
||||||
logging "github.com/ipfs/go-ipfs/vendor/QmQg1J6vikuXF9oDvm4wpdeAUvvkVEKW1EYDw9HhTMnP2b/go-log"
|
logging "gx/ipfs/QmaPaGNE2GqnfJjRRpQuQuFHuJn4FZvsrGxdik4kgxCkBi/go-log"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
|
queue "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer/queue"
|
||||||
|
|
||||||
process "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
process "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess"
|
||||||
ctxproc "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
|
ctxproc "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/goprocess/context"
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
var maxQueryConcurrency = AlphaValue
|
var maxQueryConcurrency = AlphaValue
|
||||||
@ -90,7 +90,7 @@ func newQueryRunner(q *dhtQuery) *dhtQueryRunner {
|
|||||||
ctx := ctxproc.OnClosingContext(proc)
|
ctx := ctxproc.OnClosingContext(proc)
|
||||||
return &dhtQueryRunner{
|
return &dhtQueryRunner{
|
||||||
query: q,
|
query: q,
|
||||||
peersToQuery: queue.NewChanQueue(ctx, queue.NewXORDistancePQ(q.key)),
|
peersToQuery: queue.NewChanQueue(ctx, queue.NewXORDistancePQ(string(q.key))),
|
||||||
peersRemaining: todoctr.NewSyncCounter(),
|
peersRemaining: todoctr.NewSyncCounter(),
|
||||||
peersSeen: pset.New(),
|
peersSeen: pset.New(),
|
||||||
rateLimit: make(chan struct{}, q.concurrency),
|
rateLimit: make(chan struct{}, q.concurrency),
|
||||||
|
@ -5,12 +5,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
ctxfrac "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-context/frac"
|
ctxfrac "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-context/frac"
|
||||||
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
ci "github.com/ipfs/go-ipfs/p2p/crypto"
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
routing "github.com/ipfs/go-ipfs/routing"
|
routing "github.com/ipfs/go-ipfs/routing"
|
||||||
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
||||||
record "github.com/ipfs/go-ipfs/routing/record"
|
record "github.com/ipfs/go-ipfs/routing/record"
|
||||||
|
ci "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/crypto"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MaxRecordAge specifies the maximum time that any node will hold onto a record
|
// MaxRecordAge specifies the maximum time that any node will hold onto a record
|
||||||
|
@ -5,16 +5,16 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
|
||||||
key "github.com/ipfs/go-ipfs/blocks/key"
|
key "github.com/ipfs/go-ipfs/blocks/key"
|
||||||
notif "github.com/ipfs/go-ipfs/notifications"
|
notif "github.com/ipfs/go-ipfs/notifications"
|
||||||
inet "github.com/ipfs/go-ipfs/p2p/net"
|
|
||||||
peer "github.com/ipfs/go-ipfs/p2p/peer"
|
|
||||||
"github.com/ipfs/go-ipfs/routing"
|
"github.com/ipfs/go-ipfs/routing"
|
||||||
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
pb "github.com/ipfs/go-ipfs/routing/dht/pb"
|
||||||
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
kb "github.com/ipfs/go-ipfs/routing/kbucket"
|
||||||
record "github.com/ipfs/go-ipfs/routing/record"
|
record "github.com/ipfs/go-ipfs/routing/record"
|
||||||
pset "github.com/ipfs/go-ipfs/util/peerset"
|
pset "github.com/ipfs/go-ipfs/util/peerset"
|
||||||
|
inet "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/net"
|
||||||
|
peer "gx/ipfs/QmY3NAw959vbE1oJooP9HchcRdBsbxhgQsEZTRhKgvoSuC/go-libp2p/p2p/peer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// asyncQueryBuffer is the size of buffered channels in async queries. This
|
// asyncQueryBuffer is the size of buffered channels in async queries. This
|
||||||
|
Loading…
x
Reference in New Issue
Block a user