From 7274c6be35561d3c20bf186efadfdff797e50ad6 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 1 Jun 2016 15:51:39 -0700 Subject: [PATCH] update libp2p to v3.3.1 License: MIT Signed-off-by: Jeromy --- cmd/ipfs/daemon.go | 8 ++--- cmd/seccat/seccat.go | 9 ++--- core/bootstrap.go | 33 ++++++++++--------- core/bootstrap_test.go | 6 ++-- core/builder.go | 5 +-- core/commands/bitswap.go | 2 +- core/commands/dht.go | 7 ++-- core/commands/id.go | 8 +++-- core/commands/ping.go | 7 ++-- core/commands/stat.go | 14 ++++---- core/commands/swarm.go | 8 ++--- core/core.go | 31 ++++++++--------- core/corehttp/gateway.go | 2 +- core/corehttp/gateway_test.go | 2 +- core/corehttp/metrics_test.go | 6 ++-- core/corenet/net.go | 9 ++--- core/corerouting/core.go | 6 ++-- core/mock/mock.go | 11 ++++--- diagnostics/diag.go | 8 ++--- diagnostics/vis.go | 2 +- exchange/bitswap/bitswap.go | 2 +- exchange/bitswap/bitswap_test.go | 2 +- exchange/bitswap/decision/bench_test.go | 2 +- exchange/bitswap/decision/engine.go | 2 +- exchange/bitswap/decision/engine_test.go | 2 +- exchange/bitswap/decision/ledger.go | 2 +- .../bitswap/decision/peer_request_queue.go | 2 +- exchange/bitswap/message/message.go | 2 +- exchange/bitswap/network/interface.go | 4 +-- exchange/bitswap/network/ipfs_impl.go | 14 ++++---- exchange/bitswap/testnet/interface.go | 2 +- exchange/bitswap/testnet/network_test.go | 2 +- exchange/bitswap/testnet/peernet.go | 4 +-- exchange/bitswap/testnet/virtual.go | 2 +- exchange/bitswap/testutils.go | 4 +-- exchange/bitswap/wantmanager.go | 2 +- exchange/bitswap/workers.go | 2 +- namesys/publisher.go | 2 +- namesys/republisher/repub.go | 7 ++-- namesys/republisher/repub_test.go | 6 ++-- namesys/resolve_test.go | 2 +- notifications/query.go | 7 ++-- package.json | 14 ++++---- pin/pin.go | 18 +++++----- repo/config/init.go | 2 +- routing/dht/dht.go | 27 +++++++-------- routing/dht/dht_bootstrap.go | 2 +- routing/dht/dht_net.go | 4 +-- routing/dht/dht_test.go | 28 ++++++++-------- routing/dht/diag.go | 2 +- routing/dht/ext_test.go | 16 ++++----- routing/dht/handlers.go | 16 +++++---- routing/dht/lookup.go | 12 ++++--- routing/dht/notif.go | 2 +- routing/dht/pb/message.go | 25 +++++++------- routing/dht/providers.go | 2 +- routing/dht/providers_test.go | 2 +- routing/dht/query.go | 21 ++++++------ routing/dht/records.go | 2 +- routing/dht/routing.go | 32 +++++++++--------- routing/kbucket/bucket.go | 2 +- routing/kbucket/sorting.go | 2 +- routing/kbucket/table.go | 7 ++-- routing/kbucket/table_test.go | 15 +++++---- routing/kbucket/util.go | 2 +- routing/mock/centralized_client.go | 16 +++++---- routing/mock/centralized_server.go | 16 +++++---- routing/mock/centralized_test.go | 5 +-- routing/mock/dht.go | 2 +- routing/mock/interface.go | 5 +-- routing/none/none_client.go | 13 ++++---- routing/offline/offline.go | 14 ++++---- routing/routing.go | 9 ++--- routing/supernode/client.go | 32 +++++++++--------- routing/supernode/proxy/loopback.go | 4 +-- routing/supernode/proxy/standard.go | 19 ++++++----- routing/supernode/server.go | 19 ++++++----- test/integration/addcat_test.go | 8 ++--- test/integration/bench_cat_test.go | 8 ++--- test/integration/bitswap_wo_routing_test.go | 2 +- test/integration/grandcentral_test.go | 6 ++-- test/integration/three_legged_cat_test.go | 6 ++-- test/supernode_client/main.go | 24 +++++++------- thirdparty/ipfsaddr/ipfsaddr.go | 2 +- thirdparty/ipfsaddr/ipfsaddr_test.go | 2 +- thirdparty/loggables/loggables.go | 2 +- thirdparty/peerset/peerset.go | 2 +- thirdparty/testutil/gen.go | 2 +- thirdparty/testutil/identity.go | 2 +- 89 files changed, 386 insertions(+), 349 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index c6928422f85..7a60b842b40 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -24,9 +24,9 @@ import ( "github.com/ipfs/go-ipfs/core/corerouting" nodeMount "github.com/ipfs/go-ipfs/fuse/node" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - conn "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/conn" + conn "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/conn" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" util "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" prometheus "gx/ipfs/QmdhsRK1EK2fvAz2i2SH5DEfkL6seDuyMYEsxKa9Braim3/client_golang/prometheus" ) @@ -247,9 +247,9 @@ func daemonFunc(req cmds.Request, res cmds.Response) { repo.Close() // because ownership hasn't been transferred to the node return } - var infos []peer.PeerInfo + var infos []pstore.PeerInfo for _, addr := range servers { - infos = append(infos, peer.PeerInfo{ + infos = append(infos, pstore.PeerInfo{ ID: addr.ID(), Addrs: []ma.Multiaddr{addr.Transport()}, }) diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go index 9f60961cf16..5dc79cbc70c 100644 --- a/cmd/seccat/seccat.go +++ b/cmd/seccat/seccat.go @@ -18,11 +18,12 @@ import ( "os/signal" "syscall" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" + secio "gx/ipfs/QmUmvxT1NTXjk4v9ucPHgC5NHd7s2nHXrVvFbs68NrGuZC/go-libp2p-secio" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - secio "gx/ipfs/QmbuSYB51KtX8izgab1fSyBgsyMH2hTuCfBtXm77PeXWca/go-libp2p-secio" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var verbose = false @@ -110,7 +111,7 @@ func main() { } } -func setupPeer(a args) (peer.ID, peer.Peerstore, error) { +func setupPeer(a args) (peer.ID, pstore.Peerstore, error) { if a.keybits < 1024 { return "", nil, errors.New("Bitsize less than 1024 is considered unsafe.") } @@ -126,7 +127,7 @@ func setupPeer(a args) (peer.ID, peer.Peerstore, error) { return "", nil, err } - ps := peer.NewPeerstore() + ps := pstore.NewPeerstore() ps.AddPrivKey(p, sk) ps.AddPubKey(p, pk) diff --git a/core/bootstrap.go b/core/bootstrap.go index ed3c9d889cb..8a289bb3e8a 100644 --- a/core/bootstrap.go +++ b/core/bootstrap.go @@ -11,13 +11,14 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" lgbl "github.com/ipfs/go-ipfs/thirdparty/loggables" math2 "github.com/ipfs/go-ipfs/thirdparty/math2" - host "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + host "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" goprocess "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" procctx "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" periodicproc "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/periodic" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) @@ -49,7 +50,7 @@ type BootstrapConfig struct { // BootstrapPeers is a function that returns a set of bootstrap peers // for the bootstrap process to use. This makes it possible for clients // to control the peers the process uses at any moment. - BootstrapPeers func() []peer.PeerInfo + BootstrapPeers func() []pstore.PeerInfo } // DefaultBootstrapConfig specifies default sane parameters for bootstrapping. @@ -59,9 +60,9 @@ var DefaultBootstrapConfig = BootstrapConfig{ ConnectionTimeout: (30 * time.Second) / 3, // Perod / 3 } -func BootstrapConfigWithPeers(pis []peer.PeerInfo) BootstrapConfig { +func BootstrapConfigWithPeers(pis []pstore.PeerInfo) BootstrapConfig { cfg := DefaultBootstrapConfig - cfg.BootstrapPeers = func() []peer.PeerInfo { + cfg.BootstrapPeers = func() []pstore.PeerInfo { return pis } return cfg @@ -128,7 +129,7 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er numToDial := cfg.MinPeerThreshold - len(connected) // filter out bootstrap nodes we are already connected to - var notConnected []peer.PeerInfo + var notConnected []pstore.PeerInfo for _, p := range peers { if host.Network().Connectedness(p.ID) != inet.Connected { notConnected = append(notConnected, p) @@ -152,7 +153,7 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er return nil } -func bootstrapConnect(ctx context.Context, ph host.Host, peers []peer.PeerInfo) error { +func bootstrapConnect(ctx context.Context, ph host.Host, peers []pstore.PeerInfo) error { if len(peers) < 1 { return ErrNotEnoughBootstrapPeers } @@ -167,12 +168,12 @@ func bootstrapConnect(ctx context.Context, ph host.Host, peers []peer.PeerInfo) // Also, performed asynchronously for dial speed. wg.Add(1) - go func(p peer.PeerInfo) { + go func(p pstore.PeerInfo) { defer wg.Done() defer log.EventBegin(ctx, "bootstrapDial", ph.ID(), p.ID).Done() log.Debugf("%s bootstrapping to %s", ph.ID(), p.ID) - ph.Peerstore().AddAddrs(p.ID, p.Addrs, peer.PermanentAddrTTL) + ph.Peerstore().AddAddrs(p.ID, p.Addrs, pstore.PermanentAddrTTL) if err := ph.Connect(ctx, p); err != nil { log.Event(ctx, "bootstrapDialFailed", p.ID) log.Debugf("failed to bootstrap with %v: %s", p.ID, err) @@ -201,12 +202,12 @@ func bootstrapConnect(ctx context.Context, ph host.Host, peers []peer.PeerInfo) return nil } -func toPeerInfos(bpeers []config.BootstrapPeer) []peer.PeerInfo { - pinfos := make(map[peer.ID]*peer.PeerInfo) +func toPeerInfos(bpeers []config.BootstrapPeer) []pstore.PeerInfo { + pinfos := make(map[peer.ID]*pstore.PeerInfo) for _, bootstrap := range bpeers { pinfo, ok := pinfos[bootstrap.ID()] if !ok { - pinfo = new(peer.PeerInfo) + pinfo = new(pstore.PeerInfo) pinfos[bootstrap.ID()] = pinfo pinfo.ID = bootstrap.ID() } @@ -214,7 +215,7 @@ func toPeerInfos(bpeers []config.BootstrapPeer) []peer.PeerInfo { pinfo.Addrs = append(pinfo.Addrs, bootstrap.Transport()) } - var peers []peer.PeerInfo + var peers []pstore.PeerInfo for _, pinfo := range pinfos { peers = append(peers, *pinfo) } @@ -222,9 +223,9 @@ func toPeerInfos(bpeers []config.BootstrapPeer) []peer.PeerInfo { return peers } -func randomSubsetOfPeers(in []peer.PeerInfo, max int) []peer.PeerInfo { +func randomSubsetOfPeers(in []pstore.PeerInfo, max int) []pstore.PeerInfo { n := math2.IntMin(max, len(in)) - var out []peer.PeerInfo + var out []pstore.PeerInfo for _, val := range rand.Perm(len(in)) { out = append(out, in[val]) if len(out) >= n { diff --git a/core/bootstrap_test.go b/core/bootstrap_test.go index 9a84ec9702e..045edb978bd 100644 --- a/core/bootstrap_test.go +++ b/core/bootstrap_test.go @@ -6,11 +6,11 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" ) func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) { - var ps []peer.PeerInfo + var ps []pstore.PeerInfo sizeofSlice := 100 for i := 0; i < sizeofSlice; i++ { pid, err := testutil.RandPeerID() @@ -18,7 +18,7 @@ func TestSubsetWhenMaxIsGreaterThanLengthOfSlice(t *testing.T) { t.Fatal(err) } - ps = append(ps, peer.PeerInfo{ID: pid}) + ps = append(ps, pstore.PeerInfo{ID: pid}) } out := randomSubsetOfPeers(ps, 2*sizeofSlice) if len(out) != len(ps) { diff --git a/core/builder.go b/core/builder.go index e3fa5eb4842..dda606dbace 100644 --- a/core/builder.go +++ b/core/builder.go @@ -16,10 +16,11 @@ import ( pin "github.com/ipfs/go-ipfs/pin" repo "github.com/ipfs/go-ipfs/repo" cfg "github.com/ipfs/go-ipfs/repo/config" + goprocessctx "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) type BuildCfg struct { @@ -105,7 +106,7 @@ func NewNode(ctx context.Context, cfg *BuildCfg) (*IpfsNode, error) { mode: offlineMode, Repo: cfg.Repo, ctx: ctx, - Peerstore: peer.NewPeerstore(), + Peerstore: pstore.NewPeerstore(), } if cfg.Online { n.mode = onlineMode diff --git a/core/commands/bitswap.go b/core/commands/bitswap.go index bf8ba4295a6..b3e75e68d30 100644 --- a/core/commands/bitswap.go +++ b/core/commands/bitswap.go @@ -10,8 +10,8 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" cmds "github.com/ipfs/go-ipfs/commands" bitswap "github.com/ipfs/go-ipfs/exchange/bitswap" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var BitswapCmd = &cmds.Command{ diff --git a/core/commands/dht.go b/core/commands/dht.go index cdbbb4e4713..2353a2f767d 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -12,8 +12,9 @@ import ( notif "github.com/ipfs/go-ipfs/notifications" path "github.com/ipfs/go-ipfs/path" ipdht "github.com/ipfs/go-ipfs/routing/dht" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var ErrNotDHT = errors.New("routing service is not a DHT") @@ -172,7 +173,7 @@ var findProvidersDhtCmd = &cmds.Command{ np := p notif.PublishQueryEvent(ctx, ¬if.QueryEvent{ Type: notif.Provider, - Responses: []*peer.PeerInfo{&np}, + Responses: []*pstore.PeerInfo{&np}, }) } }() @@ -283,7 +284,7 @@ var findPeerDhtCmd = &cmds.Command{ notif.PublishQueryEvent(ctx, ¬if.QueryEvent{ Type: notif.FinalPeer, - Responses: []*peer.PeerInfo{&pi}, + Responses: []*pstore.PeerInfo{&pi}, }) }() }, diff --git a/core/commands/id.go b/core/commands/id.go index 465a35b1222..2fc77fe7ec8 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -13,10 +13,12 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" kb "github.com/ipfs/go-ipfs/routing/kbucket" - identify "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol/identify" + + "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + identify "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol/identify" ic "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) const offlineIdErrorMessage = `'ipfs id' currently cannot query information on remote @@ -147,7 +149,7 @@ EXAMPLE: Type: IdOutput{}, } -func printPeer(ps peer.Peerstore, p peer.ID) (interface{}, error) { +func printPeer(ps pstore.Peerstore, p peer.ID) (interface{}, error) { if p == "" { return nil, errors.New("Attempted to print nil peer!") } diff --git a/core/commands/ping.go b/core/commands/ping.go index 0b6c6c79dc4..156ec9968d5 100644 --- a/core/commands/ping.go +++ b/core/commands/ping.go @@ -10,8 +10,9 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" @@ -94,7 +95,7 @@ trip latency information. } if addr != nil { - n.Peerstore.AddAddr(peerID, addr, peer.TempAddrTTL) // temporary + n.Peerstore.AddAddr(peerID, addr, pstore.TempAddrTTL) // temporary } numPings, _, err := req.Option("count").Int() @@ -127,7 +128,7 @@ func pingPeer(ctx context.Context, n *core.IpfsNode, pid peer.ID, numPings int) outChan <- &PingResult{Text: fmt.Sprintf("Peer lookup error: %s", err)} return } - n.Peerstore.AddAddrs(p.ID, p.Addrs, peer.TempAddrTTL) + n.Peerstore.AddAddrs(p.ID, p.Addrs, pstore.TempAddrTTL) } outChan <- &PingResult{Text: fmt.Sprintf("PING %s.", pid.Pretty())} diff --git a/core/commands/stat.go b/core/commands/stat.go index 621a1ea0b15..0216c5be72a 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -10,20 +10,20 @@ import ( humanize "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize" cmds "github.com/ipfs/go-ipfs/commands" - metrics "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/metrics" - protocol "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + metrics "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/metrics" + protocol "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var StatsCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Query ipfs statistics.", - Synopsis: "ipfs stats ", + Tagline: "Query ipfs statistics.", + Synopsis: "ipfs stats ", ShortDescription: `'ipfs stats' is a set of commands to help look at statistics for your ipfs node. `, - LongDescription: `'ipfs stats' is a set of commands to help look at statistics + LongDescription: `'ipfs stats' is a set of commands to help look at statistics for your ipfs node.`, }, @@ -34,7 +34,7 @@ for your ipfs node.`, var statBwCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Print ipfs bandwidth information.", + Tagline: "Print ipfs bandwidth information.", Synopsis: `ipfs stats bw [--peer | -p] [--proto | -t] [--poll] [--interval | -i] `, diff --git a/core/commands/swarm.go b/core/commands/swarm.go index a48a54c3d99..0f93be67d88 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -10,8 +10,8 @@ import ( cmds "github.com/ipfs/go-ipfs/commands" iaddr "github.com/ipfs/go-ipfs/thirdparty/ipfsaddr" - swarm "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/swarm" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + swarm "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/swarm" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" mafilter "gx/ipfs/QmUaRHbB7pUwj5mS9BS4CMvBiW48MpaH2wbGxeWfFhhHxK/multiaddr-filter" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" @@ -355,14 +355,14 @@ func parseAddresses(addrs []string) (iaddrs []iaddr.IPFSAddr, err error) { // peersWithAddresses is a function that takes in a slice of string peer addresses // (multiaddr + peerid) and returns a slice of properly constructed peers -func peersWithAddresses(addrs []string) (pis []peer.PeerInfo, err error) { +func peersWithAddresses(addrs []string) (pis []pstore.PeerInfo, err error) { iaddrs, err := parseAddresses(addrs) if err != nil { return nil, err } for _, iaddr := range iaddrs { - pis = append(pis, peer.PeerInfo{ + pis = append(pis, pstore.PeerInfo{ ID: iaddr.ID(), Addrs: []ma.Multiaddr{iaddr.Transport()}, }) diff --git a/core/core.go b/core/core.go index 8656b86dd85..fc1f0296c6a 100644 --- a/core/core.go +++ b/core/core.go @@ -18,22 +18,23 @@ import ( ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore" diag "github.com/ipfs/go-ipfs/diagnostics" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + discovery "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/discovery" + p2phost "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + p2pbhost "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host/basic" + rhost "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host/routed" + metrics "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/metrics" + swarm "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/swarm" + addrutil "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/swarm/addr" + ping "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol/ping" goprocess "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" - discovery "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/discovery" - p2phost "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - p2pbhost "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host/basic" - rhost "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host/routed" - metrics "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/metrics" - swarm "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/swarm" - addrutil "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/swarm/addr" - ping "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol/ping" b58 "gx/ipfs/QmT8rehPR3F6bmwL6zjUN8XpiDBFFpMP2myPdC6ApsWfJf/go-base58" ic "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" mamask "gx/ipfs/QmUaRHbB7pUwj5mS9BS4CMvBiW48MpaH2wbGxeWfFhhHxK/multiaddr-filter" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" routing "github.com/ipfs/go-ipfs/routing" dht "github.com/ipfs/go-ipfs/routing/dht" @@ -91,7 +92,7 @@ type IpfsNode struct { PrivateKey ic.PrivKey // the local node's private Key // Services - Peerstore peer.Peerstore // storage for other Peer instances + Peerstore pstore.Peerstore // storage for other Peer instances Blockstore bstore.GCBlockstore // the block store (lower level) Blocks *bserv.BlockService // the block service, get/add blocks. DAG merkledag.DAGService // the merkle dag service, get/add objects. @@ -196,7 +197,7 @@ func setupDiscoveryOption(d config.Discovery) DiscoveryOption { return nil } -func (n *IpfsNode) HandlePeerFound(p peer.PeerInfo) { +func (n *IpfsNode) HandlePeerFound(p pstore.PeerInfo) { log.Warning("trying peer info: ", p) ctx, cancel := context.WithTimeout(n.Context(), discoveryConnTimeout) defer cancel() @@ -396,7 +397,7 @@ func (n *IpfsNode) Bootstrap(cfg BootstrapConfig) error { // if the caller did not specify a bootstrap peer function, get the // freshest bootstrap peers from config. this responds to live changes. if cfg.BootstrapPeers == nil { - cfg.BootstrapPeers = func() []peer.PeerInfo { + cfg.BootstrapPeers = func() []pstore.PeerInfo { ps, err := n.loadBootstrapPeers() if err != nil { log.Warning("failed to parse bootstrap peers from config") @@ -458,7 +459,7 @@ func (n *IpfsNode) LoadPrivateKey() error { return nil } -func (n *IpfsNode) loadBootstrapPeers() ([]peer.PeerInfo, error) { +func (n *IpfsNode) loadBootstrapPeers() ([]pstore.PeerInfo, error) { cfg, err := n.Repo.Config() if err != nil { return nil, err @@ -562,12 +563,12 @@ func listenAddresses(cfg *config.Config) ([]ma.Multiaddr, error) { return listen, nil } -type HostOption func(ctx context.Context, id peer.ID, ps peer.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (p2phost.Host, error) +type HostOption func(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (p2phost.Host, error) var DefaultHostOption HostOption = constructPeerHost // isolates the complex initialization steps -func constructPeerHost(ctx context.Context, id peer.ID, ps peer.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (p2phost.Host, error) { +func constructPeerHost(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (p2phost.Host, error) { // no addresses to begin with. we'll start later. network, err := swarm.NewNetwork(ctx, nil, id, ps, bwr) diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index 361306e2144..cff9a719c9d 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -8,7 +8,7 @@ import ( core "github.com/ipfs/go-ipfs/core" config "github.com/ipfs/go-ipfs/repo/config" - id "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol/identify" ) // Gateway should be instantiated using NewGateway diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index b9fedb3c18e..4b1ba032f1e 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -16,7 +16,7 @@ import ( repo "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - id "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol/identify" + id "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol/identify" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) diff --git a/core/corehttp/metrics_test.go b/core/corehttp/metrics_test.go index 5f3003f73cf..88271fb0011 100644 --- a/core/corehttp/metrics_test.go +++ b/core/corehttp/metrics_test.go @@ -5,9 +5,9 @@ import ( "time" core "github.com/ipfs/go-ipfs/core" - bhost "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host/basic" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" - testutil "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/test/util" + bhost "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host/basic" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + testutil "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/test/util" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) diff --git a/core/corenet/net.go b/core/corenet/net.go index 4504c8b5184..5550a75f2b3 100644 --- a/core/corenet/net.go +++ b/core/corenet/net.go @@ -4,10 +4,11 @@ import ( "time" core "github.com/ipfs/go-ipfs/core" - net "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" - pro "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + net "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + pro "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) type ipfsListener struct { @@ -56,7 +57,7 @@ func Listen(nd *core.IpfsNode, protocol string) (*ipfsListener, error) { func Dial(nd *core.IpfsNode, p peer.ID, protocol string) (net.Stream, error) { ctx, cancel := context.WithTimeout(nd.Context(), time.Second*30) defer cancel() - err := nd.PeerHost.Connect(ctx, peer.PeerInfo{ID: p}) + err := nd.PeerHost.Connect(ctx, pstore.PeerInfo{ID: p}) if err != nil { return nil, err } diff --git a/core/corerouting/core.go b/core/corerouting/core.go index e4c990cbe7b..98bd5bfc378 100644 --- a/core/corerouting/core.go +++ b/core/corerouting/core.go @@ -9,9 +9,9 @@ import ( routing "github.com/ipfs/go-ipfs/routing" supernode "github.com/ipfs/go-ipfs/routing/supernode" gcproxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" - "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" + "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // NB: DHT option is included in the core to avoid 1) because it's a sane @@ -44,7 +44,7 @@ func SupernodeServer(recordSource ds.Datastore) core.RoutingOption { } // TODO doc -func SupernodeClient(remotes ...peer.PeerInfo) core.RoutingOption { +func SupernodeClient(remotes ...pstore.PeerInfo) core.RoutingOption { return func(ctx context.Context, ph host.Host, dstore repo.Datastore) (routing.IpfsRouting, error) { if len(remotes) < 1 { return nil, errServersMissing diff --git a/core/mock/mock.go b/core/mock/mock.go index e89ac29164c..bd57fe04a44 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -13,10 +13,11 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - host "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - metrics "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/metrics" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + host "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + metrics "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/metrics" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" ) // NewMockNode constructs an IpfsNode for use in tests. @@ -31,7 +32,7 @@ func NewMockNode() (*core.IpfsNode, error) { } func MockHostOption(mn mocknet.Mocknet) core.HostOption { - return func(ctx context.Context, id peer.ID, ps peer.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (host.Host, error) { + return func(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet) (host.Host, error) { return mn.AddPeerWithPeerstore(id, ps) } } diff --git a/diagnostics/diag.go b/diagnostics/diag.go index 8b4a099946e..5153f58e915 100644 --- a/diagnostics/diag.go +++ b/diagnostics/diag.go @@ -12,15 +12,15 @@ import ( "time" pb "github.com/ipfs/go-ipfs/diagnostics/pb" - host "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" - protocol "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + host "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + protocol "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol" ctxio "gx/ipfs/QmX6DhWrpBB5NtadXmPSXYNdVvuLfJXoFNMvUMoVvP5UJa/go-context/io" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("diagnostics") diff --git a/diagnostics/vis.go b/diagnostics/vis.go index e1a67df2a74..a599b3c7799 100644 --- a/diagnostics/vis.go +++ b/diagnostics/vis.go @@ -6,7 +6,7 @@ import ( "io" rtable "github.com/ipfs/go-ipfs/routing/kbucket" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) type node struct { diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index 3e060a76c96..469b8af965f 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -8,11 +8,11 @@ import ( "sync" "time" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" process "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" procctx "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" blocks "github.com/ipfs/go-ipfs/blocks" blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" diff --git a/exchange/bitswap/bitswap_test.go b/exchange/bitswap/bitswap_test.go index e60e0e92899..a3f336dbcf9 100644 --- a/exchange/bitswap/bitswap_test.go +++ b/exchange/bitswap/bitswap_test.go @@ -17,7 +17,7 @@ import ( tn "github.com/ipfs/go-ipfs/exchange/bitswap/testnet" mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - p2ptestutil "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/test/util" + p2ptestutil "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/test/util" ) // FIXME the tests are really sensitive to the network delay. fix them to work diff --git a/exchange/bitswap/decision/bench_test.go b/exchange/bitswap/decision/bench_test.go index 465cda48657..283791ef0a3 100644 --- a/exchange/bitswap/decision/bench_test.go +++ b/exchange/bitswap/decision/bench_test.go @@ -7,7 +7,7 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" "github.com/ipfs/go-ipfs/thirdparty/testutil" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) // FWIW: At the time of this commit, including a timestamp in task increases diff --git a/exchange/bitswap/decision/engine.go b/exchange/bitswap/decision/engine.go index ff4fa1fa7f5..99b8088cfcd 100644 --- a/exchange/bitswap/decision/engine.go +++ b/exchange/bitswap/decision/engine.go @@ -8,9 +8,9 @@ import ( bstore "github.com/ipfs/go-ipfs/blocks/blockstore" bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // TODO consider taking responsibility for other types of requests. For diff --git a/exchange/bitswap/decision/engine_test.go b/exchange/bitswap/decision/engine_test.go index 2b1dea07204..87882c2fa37 100644 --- a/exchange/bitswap/decision/engine_test.go +++ b/exchange/bitswap/decision/engine_test.go @@ -14,8 +14,8 @@ import ( blockstore "github.com/ipfs/go-ipfs/blocks/blockstore" message "github.com/ipfs/go-ipfs/exchange/bitswap/message" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) type peerAndEngine struct { diff --git a/exchange/bitswap/decision/ledger.go b/exchange/bitswap/decision/ledger.go index 6200f5338dd..4790276787e 100644 --- a/exchange/bitswap/decision/ledger.go +++ b/exchange/bitswap/decision/ledger.go @@ -5,7 +5,7 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" wl "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) // keySet is just a convenient alias for maps of keys, where we only care diff --git a/exchange/bitswap/decision/peer_request_queue.go b/exchange/bitswap/decision/peer_request_queue.go index d68579df663..54cd1935792 100644 --- a/exchange/bitswap/decision/peer_request_queue.go +++ b/exchange/bitswap/decision/peer_request_queue.go @@ -7,7 +7,7 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" pq "github.com/ipfs/go-ipfs/thirdparty/pq" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) type peerRequestQueue interface { diff --git a/exchange/bitswap/message/message.go b/exchange/bitswap/message/message.go index 43a7d2753f4..e2f136f31e5 100644 --- a/exchange/bitswap/message/message.go +++ b/exchange/bitswap/message/message.go @@ -7,7 +7,7 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" pb "github.com/ipfs/go-ipfs/exchange/bitswap/message/pb" wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" diff --git a/exchange/bitswap/network/interface.go b/exchange/bitswap/network/interface.go index d0fe8d83a2f..7abeca1a33b 100644 --- a/exchange/bitswap/network/interface.go +++ b/exchange/bitswap/network/interface.go @@ -3,9 +3,9 @@ package network import ( key "github.com/ipfs/go-ipfs/blocks/key" bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" - protocol "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + protocol "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var ProtocolBitswap protocol.ID = "/ipfs/bitswap" diff --git a/exchange/bitswap/network/ipfs_impl.go b/exchange/bitswap/network/ipfs_impl.go index e70eeaf0cdb..7dbd3ebdd31 100644 --- a/exchange/bitswap/network/ipfs_impl.go +++ b/exchange/bitswap/network/ipfs_impl.go @@ -6,13 +6,15 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" routing "github.com/ipfs/go-ipfs/routing" - host "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + host "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("bitswap_network") @@ -45,7 +47,7 @@ func (bsnet *impl) newStreamToPeer(ctx context.Context, p peer.ID) (inet.Stream, // first, make sure we're connected. // if this fails, we cannot connect to given peer. //TODO(jbenet) move this into host.NewStream? - if err := bsnet.host.Connect(ctx, peer.PeerInfo{ID: p}); err != nil { + if err := bsnet.host.Connect(ctx, pstore.PeerInfo{ID: p}); err != nil { return nil, err } @@ -101,7 +103,7 @@ func (bsnet *impl) SetDelegate(r Receiver) { } func (bsnet *impl) ConnectTo(ctx context.Context, p peer.ID) error { - return bsnet.host.Connect(ctx, peer.PeerInfo{ID: p}) + return bsnet.host.Connect(ctx, pstore.PeerInfo{ID: p}) } // FindProvidersAsync returns a channel of providers for the given key @@ -129,7 +131,7 @@ func (bsnet *impl) FindProvidersAsync(ctx context.Context, k key.Key, max int) < if info.ID == bsnet.host.ID() { continue // ignore self as provider } - bsnet.host.Peerstore().AddAddrs(info.ID, info.Addrs, peer.TempAddrTTL) + bsnet.host.Peerstore().AddAddrs(info.ID, info.Addrs, pstore.TempAddrTTL) select { case <-ctx.Done(): return diff --git a/exchange/bitswap/testnet/interface.go b/exchange/bitswap/testnet/interface.go index c894160e4e8..f9fe5e62f96 100644 --- a/exchange/bitswap/testnet/interface.go +++ b/exchange/bitswap/testnet/interface.go @@ -3,7 +3,7 @@ package bitswap import ( bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" "github.com/ipfs/go-ipfs/thirdparty/testutil" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) type Network interface { diff --git a/exchange/bitswap/testnet/network_test.go b/exchange/bitswap/testnet/network_test.go index e45f9169240..af6edcad7f5 100644 --- a/exchange/bitswap/testnet/network_test.go +++ b/exchange/bitswap/testnet/network_test.go @@ -10,8 +10,8 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) func TestSendMessageAsyncButWaitForResponse(t *testing.T) { diff --git a/exchange/bitswap/testnet/peernet.go b/exchange/bitswap/testnet/peernet.go index 9a18a5d8abc..437af2dca6d 100644 --- a/exchange/bitswap/testnet/peernet.go +++ b/exchange/bitswap/testnet/peernet.go @@ -5,9 +5,9 @@ import ( bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" mockrouting "github.com/ipfs/go-ipfs/routing/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - mockpeernet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + mockpeernet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) type peernet struct { diff --git a/exchange/bitswap/testnet/virtual.go b/exchange/bitswap/testnet/virtual.go index 64013603e9f..89833b682ba 100644 --- a/exchange/bitswap/testnet/virtual.go +++ b/exchange/bitswap/testnet/virtual.go @@ -10,8 +10,8 @@ import ( mockrouting "github.com/ipfs/go-ipfs/routing/mock" delay "github.com/ipfs/go-ipfs/thirdparty/delay" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) func VirtualNetwork(rs mockrouting.Server, d delay.D) Network { diff --git a/exchange/bitswap/testutils.go b/exchange/bitswap/testutils.go index ddfa1a45633..b6ccabf9762 100644 --- a/exchange/bitswap/testutils.go +++ b/exchange/bitswap/testutils.go @@ -10,9 +10,9 @@ import ( datastore2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" delay "github.com/ipfs/go-ipfs/thirdparty/delay" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" - p2ptestutil "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/test/util" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + p2ptestutil "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/test/util" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // WARNING: this uses RandTestBogusIdentity DO NOT USE for NON TESTS! diff --git a/exchange/bitswap/wantmanager.go b/exchange/bitswap/wantmanager.go index 52dc514d356..50fdb37da60 100644 --- a/exchange/bitswap/wantmanager.go +++ b/exchange/bitswap/wantmanager.go @@ -9,8 +9,8 @@ import ( bsmsg "github.com/ipfs/go-ipfs/exchange/bitswap/message" bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network" wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) type WantManager struct { diff --git a/exchange/bitswap/workers.go b/exchange/bitswap/workers.go index 7717a717032..8a68698c0b1 100644 --- a/exchange/bitswap/workers.go +++ b/exchange/bitswap/workers.go @@ -10,8 +10,8 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var TaskWorkerCount = 8 diff --git a/namesys/publisher.go b/namesys/publisher.go index 5fdbb725aed..7c3b4b95ca0 100644 --- a/namesys/publisher.go +++ b/namesys/publisher.go @@ -19,9 +19,9 @@ import ( dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" record "github.com/ipfs/go-ipfs/routing/record" ft "github.com/ipfs/go-ipfs/unixfs" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // ErrExpiredRecord should be returned when an ipns record is diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go index 3071b9bb804..ef5baef045e 100644 --- a/namesys/republisher/repub.go +++ b/namesys/republisher/repub.go @@ -11,12 +11,13 @@ import ( path "github.com/ipfs/go-ipfs/path" "github.com/ipfs/go-ipfs/routing" dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" goprocess "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" gpctx "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" ) @@ -32,7 +33,7 @@ const DefaultRecordLifetime = time.Hour * 24 type Republisher struct { r routing.IpfsRouting ds ds.Datastore - ps peer.Peerstore + ps pstore.Peerstore Interval time.Duration @@ -43,7 +44,7 @@ type Republisher struct { entries map[peer.ID]struct{} } -func NewRepublisher(r routing.IpfsRouting, ds ds.Datastore, ps peer.Peerstore) *Republisher { +func NewRepublisher(r routing.IpfsRouting, ds ds.Datastore, ps pstore.Peerstore) *Republisher { return &Republisher{ r: r, ps: ps, diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go index 44c36225699..d9bf1967488 100644 --- a/namesys/republisher/repub_test.go +++ b/namesys/republisher/repub_test.go @@ -13,8 +13,8 @@ import ( namesys "github.com/ipfs/go-ipfs/namesys" . "github.com/ipfs/go-ipfs/namesys/republisher" path "github.com/ipfs/go-ipfs/path" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" ) func TestRepublish(t *testing.T) { @@ -44,7 +44,7 @@ func TestRepublish(t *testing.T) { mn.LinkAll() bsinf := core.BootstrapConfigWithPeers( - []peer.PeerInfo{ + []pstore.PeerInfo{ nodes[0].Peerstore.PeerInfo(nodes[0].Identity), }, ) diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go index 95060e90356..1025b5f8041 100644 --- a/namesys/resolve_test.go +++ b/namesys/resolve_test.go @@ -11,9 +11,9 @@ import ( path "github.com/ipfs/go-ipfs/path" mockrouting "github.com/ipfs/go-ipfs/routing/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) func TestRoutingResolve(t *testing.T) { diff --git a/notifications/query.go b/notifications/query.go index 3375756efbb..86a881c8190 100644 --- a/notifications/query.go +++ b/notifications/query.go @@ -3,8 +3,9 @@ package notifications import ( "encoding/json" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) const RoutingQueryKey = "RoutingQueryEvent" @@ -25,7 +26,7 @@ const ( type QueryEvent struct { ID peer.ID Type QueryEventType - Responses []*peer.PeerInfo + Responses []*pstore.PeerInfo Extra string } @@ -63,7 +64,7 @@ func (qe *QueryEvent) UnmarshalJSON(b []byte) error { temp := struct { ID string Type int - Responses []*peer.PeerInfo + Responses []*pstore.PeerInfo Extra string }{} err := json.Unmarshal(b, &temp) diff --git a/package.json b/package.json index df8206657ad..2ad1190b18b 100644 --- a/package.json +++ b/package.json @@ -13,15 +13,15 @@ "version": "1.1.0" }, { - "hash": "QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq", + "hash": "QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki", "name": "go-libp2p", - "version": "3.2.3" + "version": "3.3.1" }, { "author": "whyrusleeping", - "hash": "QmbuSYB51KtX8izgab1fSyBgsyMH2hTuCfBtXm77PeXWca", + "hash": "QmUmvxT1NTXjk4v9ucPHgC5NHd7s2nHXrVvFbs68NrGuZC", "name": "go-libp2p-secio", - "version": "1.0.4" + "version": "1.0.6" }, { "author": "whyrusleeping", @@ -31,9 +31,9 @@ }, { "author": "whyrusleeping", - "hash": "QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4", + "hash": "QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC", "name": "go-libp2p-peer", - "version": "1.0.6" + "version": "2.0.0" }, { "hash": "QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt", @@ -118,4 +118,4 @@ "license": "MIT", "name": "go-ipfs", "version": "0.4.0" -} \ No newline at end of file +} diff --git a/pin/pin.go b/pin/pin.go index 0696e798482..d68f6b16a08 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -45,11 +45,11 @@ const ( func PinModeToString(mode PinMode) (string, bool) { m := map[PinMode]string{ Recursive: linkRecursive, - Direct: linkDirect, - Indirect: linkIndirect, - Internal: linkInternal, + Direct: linkDirect, + Indirect: linkIndirect, + Internal: linkInternal, NotPinned: linkNotPinned, - Any: linkAny, + Any: linkAny, } s, ok := m[mode] return s, ok @@ -58,12 +58,12 @@ func PinModeToString(mode PinMode) (string, bool) { func StringToPinMode(s string) (PinMode, bool) { m := map[string]PinMode{ linkRecursive: Recursive, - linkDirect: Direct, - linkIndirect: Indirect, - linkInternal: Internal, + linkDirect: Direct, + linkIndirect: Indirect, + linkInternal: Internal, linkNotPinned: NotPinned, - linkAny: Any, - linkAll: Any, // "all" and "any" means the same thing + linkAny: Any, + linkAll: Any, // "all" and "any" means the same thing } mode, ok := m[s] return mode, ok diff --git a/repo/config/init.go b/repo/config/init.go index f8f4a4890ea..de467fe084c 100644 --- a/repo/config/init.go +++ b/repo/config/init.go @@ -6,8 +6,8 @@ import ( "fmt" "io" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { diff --git a/routing/dht/dht.go b/routing/dht/dht.go index 70d597d4b1e..6ddd4325e75 100644 --- a/routing/dht/dht.go +++ b/routing/dht/dht.go @@ -14,17 +14,18 @@ import ( pb "github.com/ipfs/go-ipfs/routing/dht/pb" kb "github.com/ipfs/go-ipfs/routing/kbucket" record "github.com/ipfs/go-ipfs/routing/record" - host "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - protocol "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/protocol" - ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" - logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + host "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + protocol "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/protocol" goprocess "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" goprocessctx "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" + ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" + logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" ) var log = logging.Logger("dht") @@ -40,9 +41,9 @@ const NumBootstrapQueries = 5 // IpfsDHT is an implementation of Kademlia with Coral and S/Kademlia modifications. // It is used to implement the base IpfsRouting module. type IpfsDHT struct { - host host.Host // the network services we need - self peer.ID // Local peer (yourself) - peerstore peer.Peerstore // Peer Registry + host host.Host // the network services we need + self peer.ID // Local peer (yourself) + peerstore pstore.Peerstore // Peer Registry datastore ds.Datastore // Local data @@ -127,7 +128,7 @@ func (dht *IpfsDHT) putValueToPeer(ctx context.Context, p peer.ID, func (dht *IpfsDHT) putProvider(ctx context.Context, p peer.ID, skey string) error { // add self as the provider - pi := peer.PeerInfo{ + pi := pstore.PeerInfo{ ID: dht.self, Addrs: dht.host.Addrs(), } @@ -140,7 +141,7 @@ func (dht *IpfsDHT) putProvider(ctx context.Context, p peer.ID, skey string) err } pmes := pb.NewMessage(pb.Message_ADD_PROVIDER, skey, 0) - pmes.ProviderPeers = pb.RawPeerInfosToPBPeers([]peer.PeerInfo{pi}) + pmes.ProviderPeers = pb.RawPeerInfosToPBPeers([]pstore.PeerInfo{pi}) err := dht.sendMessage(ctx, p, pmes) if err != nil { return err @@ -157,7 +158,7 @@ var errInvalidRecord = errors.New("received invalid record") // NOTE: It will update the dht's peerstore with any new addresses // it finds for the given peer. func (dht *IpfsDHT) getValueOrPeers(ctx context.Context, p peer.ID, - key key.Key) (*pb.Record, []peer.PeerInfo, error) { + key key.Key) (*pb.Record, []pstore.PeerInfo, error) { pmes, err := dht.getValueSingle(ctx, p, key) if err != nil { @@ -258,12 +259,12 @@ func (dht *IpfsDHT) Update(ctx context.Context, p peer.ID) { } // FindLocal looks for a peer with a given ID connected to this dht and returns the peer and the table it was found in. -func (dht *IpfsDHT) FindLocal(id peer.ID) peer.PeerInfo { +func (dht *IpfsDHT) FindLocal(id peer.ID) pstore.PeerInfo { p := dht.routingTable.Find(id) if p != "" { return dht.peerstore.PeerInfo(p) } - return peer.PeerInfo{} + return pstore.PeerInfo{} } // findPeerSingle asks peer 'p' if they know where the peer with id 'id' is diff --git a/routing/dht/dht_bootstrap.go b/routing/dht/dht_bootstrap.go index 01d23a7f05c..774e632de3d 100644 --- a/routing/dht/dht_bootstrap.go +++ b/routing/dht/dht_bootstrap.go @@ -9,8 +9,8 @@ import ( "time" routing "github.com/ipfs/go-ipfs/routing" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" goprocess "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" periodicproc "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/periodic" diff --git a/routing/dht/dht_net.go b/routing/dht/dht_net.go index 221c60dc1d3..4ebd6e3f679 100644 --- a/routing/dht/dht_net.go +++ b/routing/dht/dht_net.go @@ -5,11 +5,11 @@ import ( "time" pb "github.com/ipfs/go-ipfs/routing/dht/pb" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" ctxio "gx/ipfs/QmX6DhWrpBB5NtadXmPSXYNdVvuLfJXoFNMvUMoVvP5UJa/go-context/io" ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // handleNewStream implements the inet.StreamHandler diff --git a/routing/dht/dht_test.go b/routing/dht/dht_test.go index e281563b20a..f4bc863a69c 100644 --- a/routing/dht/dht_test.go +++ b/routing/dht/dht_test.go @@ -11,18 +11,18 @@ import ( 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" - ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" - context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - key "github.com/ipfs/go-ipfs/blocks/key" routing "github.com/ipfs/go-ipfs/routing" record "github.com/ipfs/go-ipfs/routing/record" - netutil "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/test/util" - u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" - ci "github.com/ipfs/go-ipfs/thirdparty/testutil/ci" travisci "github.com/ipfs/go-ipfs/thirdparty/testutil/ci/travis" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + netutil "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/test/util" + ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" + u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" + context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) var testCaseValues = map[key.Key][]byte{} @@ -73,8 +73,8 @@ func connect(t *testing.T, ctx context.Context, a, b *IpfsDHT) { t.Fatal("peers setup incorrectly: no local address") } - a.peerstore.AddAddrs(idB, addrB, peer.TempAddrTTL) - pi := peer.PeerInfo{ID: idB} + a.peerstore.AddAddrs(idB, addrB, pstore.TempAddrTTL) + pi := pstore.PeerInfo{ID: idB} if err := a.host.Connect(ctx, pi); err != nil { t.Fatal(err) } @@ -705,7 +705,7 @@ func TestFindPeersConnectedToPeer(t *testing.T) { } // shouldFind := []peer.ID{peers[1], peers[3]} - found := []peer.PeerInfo{} + var found []pstore.PeerInfo for nextp := range pchan { found = append(found, nextp) } @@ -776,14 +776,14 @@ func TestConnectCollision(t *testing.T) { errs := make(chan error) go func() { - dhtA.peerstore.AddAddr(peerB, addrB, peer.TempAddrTTL) - pi := peer.PeerInfo{ID: peerB} + dhtA.peerstore.AddAddr(peerB, addrB, pstore.TempAddrTTL) + pi := pstore.PeerInfo{ID: peerB} err := dhtA.host.Connect(ctx, pi) errs <- err }() go func() { - dhtB.peerstore.AddAddr(peerA, addrA, peer.TempAddrTTL) - pi := peer.PeerInfo{ID: peerA} + dhtB.peerstore.AddAddr(peerA, addrA, pstore.TempAddrTTL) + pi := pstore.PeerInfo{ID: peerA} err := dhtB.host.Connect(ctx, pi) errs <- err }() diff --git a/routing/dht/diag.go b/routing/dht/diag.go index 59ceae87e4f..7958a27837c 100644 --- a/routing/dht/diag.go +++ b/routing/dht/diag.go @@ -4,7 +4,7 @@ import ( "encoding/json" "time" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) type connDiagInfo struct { diff --git a/routing/dht/ext_test.go b/routing/dht/ext_test.go index f64a7253959..28868a99220 100644 --- a/routing/dht/ext_test.go +++ b/routing/dht/ext_test.go @@ -9,17 +9,17 @@ import ( 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" - ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" - context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - key "github.com/ipfs/go-ipfs/blocks/key" routing "github.com/ipfs/go-ipfs/routing" pb "github.com/ipfs/go-ipfs/routing/dht/pb" record "github.com/ipfs/go-ipfs/routing/record" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" + + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) func TestGetFailures(t *testing.T) { @@ -183,7 +183,7 @@ func TestNotFound(t *testing.T) { case pb.Message_GET_VALUE: resp := &pb.Message{Type: pmes.Type} - ps := []peer.PeerInfo{} + ps := []pstore.PeerInfo{} for i := 0; i < 7; i++ { p := hosts[rand.Intn(len(hosts))].ID() pi := host.Peerstore().PeerInfo(p) @@ -262,7 +262,7 @@ func TestLessThanKResponses(t *testing.T) { pi := host.Peerstore().PeerInfo(hosts[1].ID()) resp := &pb.Message{ Type: pmes.Type, - CloserPeers: pb.PeerInfosToPBPeers(d.host.Network(), []peer.PeerInfo{pi}), + CloserPeers: pb.PeerInfosToPBPeers(d.host.Network(), []pstore.PeerInfo{pi}), } if err := pbw.WriteMsg(resp); err != nil { diff --git a/routing/dht/handlers.go b/routing/dht/handlers.go index 47c03f01e81..59aae44233a 100644 --- a/routing/dht/handlers.go +++ b/routing/dht/handlers.go @@ -9,10 +9,12 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" pb "github.com/ipfs/go-ipfs/routing/dht/pb" lgbl "github.com/ipfs/go-ipfs/thirdparty/loggables" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // The number of closer peers to send on requests. @@ -63,7 +65,7 @@ func (dht *IpfsDHT) handleGetValue(ctx context.Context, p peer.ID, pmes *pb.Mess // Find closest peer on given cluster to desired key and reply with that info closer := dht.betterPeersToQuery(pmes, p, CloserPeerCount) if len(closer) > 0 { - closerinfos := peer.PeerInfos(dht.peerstore, closer) + closerinfos := pstore.PeerInfos(dht.peerstore, closer) for _, pi := range closerinfos { log.Debugf("handleGetValue returning closer peer: '%s'", pi.ID) if len(pi.Addrs) < 1 { @@ -190,8 +192,8 @@ func (dht *IpfsDHT) handleFindPeer(ctx context.Context, p peer.ID, pmes *pb.Mess return resp, nil } - var withAddresses []peer.PeerInfo - closestinfos := peer.PeerInfos(dht.peerstore, closest) + var withAddresses []pstore.PeerInfo + closestinfos := pstore.PeerInfos(dht.peerstore, closest) for _, pi := range closestinfos { if len(pi.Addrs) > 0 { withAddresses = append(withAddresses, pi) @@ -232,7 +234,7 @@ func (dht *IpfsDHT) handleGetProviders(ctx context.Context, p peer.ID, pmes *pb. } if providers != nil && len(providers) > 0 { - infos := peer.PeerInfos(dht.peerstore, providers) + infos := pstore.PeerInfos(dht.peerstore, providers) resp.ProviderPeers = pb.PeerInfosToPBPeers(dht.host.Network(), infos) log.Debugf("%s have %d providers: %s", reqDesc, len(providers), infos) } @@ -240,7 +242,7 @@ func (dht *IpfsDHT) handleGetProviders(ctx context.Context, p peer.ID, pmes *pb. // Also send closer peers. closer := dht.betterPeersToQuery(pmes, p, CloserPeerCount) if closer != nil { - infos := peer.PeerInfos(dht.peerstore, closer) + infos := pstore.PeerInfos(dht.peerstore, closer) resp.CloserPeers = pb.PeerInfosToPBPeers(dht.host.Network(), infos) log.Debugf("%s have %d closer peers: %s", reqDesc, len(closer), infos) } @@ -276,7 +278,7 @@ func (dht *IpfsDHT) handleAddProvider(ctx context.Context, p peer.ID, pmes *pb.M log.Infof("received provider %s for %s (addrs: %s)", p, key, pi.Addrs) if pi.ID != dht.self { // dont add own addrs. // add the received addresses to our peerstore. - dht.peerstore.AddAddrs(pi.ID, pi.Addrs, peer.ProviderAddrTTL) + dht.peerstore.AddAddrs(pi.ID, pi.Addrs, pstore.ProviderAddrTTL) } dht.providers.AddProvider(ctx, key, p) } diff --git a/routing/dht/lookup.go b/routing/dht/lookup.go index 9c1ebc22fd5..2744fb5a740 100644 --- a/routing/dht/lookup.go +++ b/routing/dht/lookup.go @@ -5,13 +5,15 @@ import ( notif "github.com/ipfs/go-ipfs/notifications" kb "github.com/ipfs/go-ipfs/routing/kbucket" pset "github.com/ipfs/go-ipfs/thirdparty/peerset" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // Required in order for proper JSON marshaling -func pointerizePeerInfos(pis []peer.PeerInfo) []*peer.PeerInfo { - out := make([]*peer.PeerInfo, len(pis)) +func pointerizePeerInfos(pis []pstore.PeerInfo) []*pstore.PeerInfo { + out := make([]*pstore.PeerInfo, len(pis)) for i, p := range pis { np := p out[i] = &np @@ -56,7 +58,7 @@ func (dht *IpfsDHT) GetClosestPeers(ctx context.Context, key key.Key) (<-chan pe return nil, err } - var filtered []peer.PeerInfo + var filtered []pstore.PeerInfo for _, clp := range closer { if kb.Closer(clp, dht.self, key) && peerset.TryAdd(clp) { select { @@ -101,7 +103,7 @@ func (dht *IpfsDHT) closerPeersSingle(ctx context.Context, key key.Key, p peer.I for _, pbp := range pmes.GetCloserPeers() { pid := peer.ID(pbp.GetId()) if pid != dht.self { // dont add self - dht.peerstore.AddAddrs(pid, pbp.Addresses(), peer.TempAddrTTL) + dht.peerstore.AddAddrs(pid, pbp.Addresses(), pstore.TempAddrTTL) out = append(out, pid) } } diff --git a/routing/dht/notif.go b/routing/dht/notif.go index c7c6399b92d..b9d16819f28 100644 --- a/routing/dht/notif.go +++ b/routing/dht/notif.go @@ -3,7 +3,7 @@ package dht import ( ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" ) // netNotifiee defines methods to be used with the IpfsDHT diff --git a/routing/dht/pb/message.go b/routing/dht/pb/message.go index 9733c38b720..b1ab8097b2f 100644 --- a/routing/dht/pb/message.go +++ b/routing/dht/pb/message.go @@ -4,15 +4,16 @@ import ( ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" key "github.com/ipfs/go-ipfs/blocks/key" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("dht.pb") type PeerRoutingInfo struct { - peer.PeerInfo + pstore.PeerInfo inet.Connectedness } @@ -40,7 +41,7 @@ func peerRoutingInfoToPBPeer(p PeerRoutingInfo) *Message_Peer { return pbp } -func peerInfoToPBPeer(p peer.PeerInfo) *Message_Peer { +func peerInfoToPBPeer(p pstore.PeerInfo) *Message_Peer { pbp := new(Message_Peer) pbp.Addrs = make([][]byte, len(p.Addrs)) @@ -52,9 +53,9 @@ func peerInfoToPBPeer(p peer.PeerInfo) *Message_Peer { return pbp } -// PBPeerToPeer turns a *Message_Peer into its peer.PeerInfo counterpart -func PBPeerToPeerInfo(pbp *Message_Peer) peer.PeerInfo { - return peer.PeerInfo{ +// PBPeerToPeer turns a *Message_Peer into its pstore.PeerInfo counterpart +func PBPeerToPeerInfo(pbp *Message_Peer) pstore.PeerInfo { + return pstore.PeerInfo{ ID: peer.ID(pbp.GetId()), Addrs: pbp.Addresses(), } @@ -62,7 +63,7 @@ func PBPeerToPeerInfo(pbp *Message_Peer) peer.PeerInfo { // RawPeerInfosToPBPeers converts a slice of Peers into a slice of *Message_Peers, // ready to go out on the wire. -func RawPeerInfosToPBPeers(peers []peer.PeerInfo) []*Message_Peer { +func RawPeerInfosToPBPeers(peers []pstore.PeerInfo) []*Message_Peer { pbpeers := make([]*Message_Peer, len(peers)) for i, p := range peers { pbpeers[i] = peerInfoToPBPeer(p) @@ -74,7 +75,7 @@ func RawPeerInfosToPBPeers(peers []peer.PeerInfo) []*Message_Peer { // which can be written to a message and sent out. the key thing this function // does (in addition to PeersToPBPeers) is set the ConnectionType with // information from the given inet.Network. -func PeerInfosToPBPeers(n inet.Network, peers []peer.PeerInfo) []*Message_Peer { +func PeerInfosToPBPeers(n inet.Network, peers []pstore.PeerInfo) []*Message_Peer { pbps := RawPeerInfosToPBPeers(peers) for i, pbp := range pbps { c := ConnectionType(n.Connectedness(peers[i].ID)) @@ -91,10 +92,10 @@ func PeerRoutingInfosToPBPeers(peers []PeerRoutingInfo) []*Message_Peer { return pbpeers } -// PBPeersToPeerInfos converts given []*Message_Peer into []peer.PeerInfo +// PBPeersToPeerInfos converts given []*Message_Peer into []pstore.PeerInfo // Invalid addresses will be silently omitted. -func PBPeersToPeerInfos(pbps []*Message_Peer) []peer.PeerInfo { - peers := make([]peer.PeerInfo, 0, len(pbps)) +func PBPeersToPeerInfos(pbps []*Message_Peer) []pstore.PeerInfo { + peers := make([]pstore.PeerInfo, 0, len(pbps)) for _, pbp := range pbps { peers = append(peers, PBPeerToPeerInfo(pbp)) } diff --git a/routing/dht/providers.go b/routing/dht/providers.go index ecfd691ae1f..a394123c836 100644 --- a/routing/dht/providers.go +++ b/routing/dht/providers.go @@ -4,9 +4,9 @@ import ( "time" key "github.com/ipfs/go-ipfs/blocks/key" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" goprocess "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" goprocessctx "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) diff --git a/routing/dht/providers_test.go b/routing/dht/providers_test.go index 0e9cfd835de..8d25cfeba6d 100644 --- a/routing/dht/providers_test.go +++ b/routing/dht/providers_test.go @@ -4,7 +4,7 @@ import ( "testing" key "github.com/ipfs/go-ipfs/blocks/key" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) diff --git a/routing/dht/query.go b/routing/dht/query.go index b2d853b8548..6b7cc0c0482 100644 --- a/routing/dht/query.go +++ b/routing/dht/query.go @@ -8,14 +8,15 @@ import ( "github.com/ipfs/go-ipfs/routing" pset "github.com/ipfs/go-ipfs/thirdparty/peerset" todoctr "github.com/ipfs/go-ipfs/thirdparty/todocounter" - u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" - queue "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer/queue" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" process "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess" ctxproc "gx/ipfs/QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn/goprocess/context" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" + queue "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore/queue" + u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" + logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" ) var maxQueryConcurrency = AlphaValue @@ -28,10 +29,10 @@ type dhtQuery struct { } type dhtQueryResult struct { - value []byte // GetValue - peer peer.PeerInfo // FindPeer - providerPeers []peer.PeerInfo // GetProviders - closerPeers []peer.PeerInfo // * + value []byte // GetValue + peer pstore.PeerInfo // FindPeer + providerPeers []pstore.PeerInfo // GetProviders + closerPeers []pstore.PeerInfo // * success bool } @@ -239,7 +240,7 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) { // forward progress during potentially very high latency dials. r.rateLimit <- struct{}{} - pi := peer.PeerInfo{ID: p} + pi := pstore.PeerInfo{ID: p} if err := r.query.dht.host.Connect(ctx, pi); err != nil { log.Debugf("Error connecting: %s", err) @@ -286,7 +287,7 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) { } // add their addresses to the dialer's peerstore - r.query.dht.peerstore.AddAddrs(next.ID, next.Addrs, peer.TempAddrTTL) + r.query.dht.peerstore.AddAddrs(next.ID, next.Addrs, pstore.TempAddrTTL) r.addPeerToQuery(next.ID) log.Debugf("PEERS CLOSER -- worker for: %v added %v (%v)", p, next.ID, next.Addrs) } diff --git a/routing/dht/records.go b/routing/dht/records.go index 9d2eab248c9..477f8c6c075 100644 --- a/routing/dht/records.go +++ b/routing/dht/records.go @@ -7,10 +7,10 @@ import ( routing "github.com/ipfs/go-ipfs/routing" pb "github.com/ipfs/go-ipfs/routing/dht/pb" record "github.com/ipfs/go-ipfs/routing/record" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" ctxfrac "gx/ipfs/QmX6DhWrpBB5NtadXmPSXYNdVvuLfJXoFNMvUMoVvP5UJa/go-context/frac" "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // MaxRecordAge specifies the maximum time that any node will hold onto a record diff --git a/routing/dht/routing.go b/routing/dht/routing.go index 413847e00e7..ca1018d9737 100644 --- a/routing/dht/routing.go +++ b/routing/dht/routing.go @@ -12,9 +12,11 @@ import ( kb "github.com/ipfs/go-ipfs/routing/kbucket" record "github.com/ipfs/go-ipfs/routing/record" pset "github.com/ipfs/go-ipfs/thirdparty/peerset" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // asyncQueryBuffer is the size of buffered channels in async queries. This @@ -258,8 +260,8 @@ func (dht *IpfsDHT) Provide(ctx context.Context, key key.Key) error { } // FindProviders searches until the context expires. -func (dht *IpfsDHT) FindProviders(ctx context.Context, key key.Key) ([]peer.PeerInfo, error) { - var providers []peer.PeerInfo +func (dht *IpfsDHT) FindProviders(ctx context.Context, key key.Key) ([]pstore.PeerInfo, error) { + var providers []pstore.PeerInfo for p := range dht.FindProvidersAsync(ctx, key, KValue) { providers = append(providers, p) } @@ -269,14 +271,14 @@ func (dht *IpfsDHT) FindProviders(ctx context.Context, key key.Key) ([]peer.Peer // FindProvidersAsync is the same thing as FindProviders, but returns a channel. // Peers will be returned on the channel as soon as they are found, even before // the search query completes. -func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key key.Key, count int) <-chan peer.PeerInfo { +func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key key.Key, count int) <-chan pstore.PeerInfo { log.Event(ctx, "findProviders", &key) - peerOut := make(chan peer.PeerInfo, count) + peerOut := make(chan pstore.PeerInfo, count) go dht.findProvidersAsyncRoutine(ctx, key, count, peerOut) return peerOut } -func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key, count int, peerOut chan peer.PeerInfo) { +func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key, count int, peerOut chan pstore.PeerInfo) { defer log.EventBegin(ctx, "findProvidersAsync", &key).Done() defer close(peerOut) @@ -357,7 +359,7 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key, } // FindPeer searches for a peer with given ID. -func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, error) { +func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (pstore.PeerInfo, error) { defer log.EventBegin(ctx, "FindPeer", id).Done() // Check if were already connected to them @@ -367,7 +369,7 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, er peers := dht.routingTable.NearestPeers(kb.ConvertPeerID(id), KValue) if len(peers) == 0 { - return peer.PeerInfo{}, kb.ErrLookupFailure + return pstore.PeerInfo{}, kb.ErrLookupFailure } // Sanity... @@ -415,22 +417,22 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, er // run it! result, err := query.Run(ctx, peers) if err != nil { - return peer.PeerInfo{}, err + return pstore.PeerInfo{}, err } log.Debugf("FindPeer %v %v", id, result.success) if result.peer.ID == "" { - return peer.PeerInfo{}, routing.ErrNotFound + return pstore.PeerInfo{}, routing.ErrNotFound } return result.peer, nil } // FindPeersConnectedToPeer searches for peers directly connected to a given peer. -func (dht *IpfsDHT) FindPeersConnectedToPeer(ctx context.Context, id peer.ID) (<-chan peer.PeerInfo, error) { +func (dht *IpfsDHT) FindPeersConnectedToPeer(ctx context.Context, id peer.ID) (<-chan pstore.PeerInfo, error) { - peerchan := make(chan peer.PeerInfo, asyncQueryBuffer) - peersSeen := peer.Set{} + peerchan := make(chan pstore.PeerInfo, asyncQueryBuffer) + peersSeen := make(map[peer.ID]struct{}) peers := dht.routingTable.NearestPeers(kb.ConvertPeerID(id), KValue) if len(peers) == 0 { @@ -445,7 +447,7 @@ func (dht *IpfsDHT) FindPeersConnectedToPeer(ctx context.Context, id peer.ID) (< return nil, err } - var clpeers []peer.PeerInfo + var clpeers []pstore.PeerInfo closer := pmes.GetCloserPeers() for _, pbp := range closer { pi := pb.PBPeerToPeerInfo(pbp) diff --git a/routing/kbucket/bucket.go b/routing/kbucket/bucket.go index 96c0a68080b..1f887bd72b4 100644 --- a/routing/kbucket/bucket.go +++ b/routing/kbucket/bucket.go @@ -4,7 +4,7 @@ import ( "container/list" "sync" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) // Bucket holds a list of peers. diff --git a/routing/kbucket/sorting.go b/routing/kbucket/sorting.go index 5d0c834e03a..8b4fce86365 100644 --- a/routing/kbucket/sorting.go +++ b/routing/kbucket/sorting.go @@ -2,7 +2,7 @@ package kbucket import ( "container/list" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" "sort" ) diff --git a/routing/kbucket/table.go b/routing/kbucket/table.go index 3787415869b..fc9c0967276 100644 --- a/routing/kbucket/table.go +++ b/routing/kbucket/table.go @@ -7,8 +7,9 @@ import ( "sync" "time" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("table") @@ -23,7 +24,7 @@ type RoutingTable struct { tabLock sync.RWMutex // latency metrics - metrics peer.Metrics + metrics pstore.Metrics // Maximum acceptable latency for peers in this cluster maxLatency time.Duration @@ -34,7 +35,7 @@ type RoutingTable struct { } // NewRoutingTable creates a new routing table with a given bucketsize, local ID, and latency tolerance. -func NewRoutingTable(bucketsize int, localID ID, latency time.Duration, m peer.Metrics) *RoutingTable { +func NewRoutingTable(bucketsize int, localID ID, latency time.Duration, m pstore.Metrics) *RoutingTable { rt := new(RoutingTable) rt.Buckets = []*Bucket{newBucket()} rt.bucketsize = bucketsize diff --git a/routing/kbucket/table_test.go b/routing/kbucket/table_test.go index 85c579c805c..271b798c8ba 100644 --- a/routing/kbucket/table_test.go +++ b/routing/kbucket/table_test.go @@ -7,7 +7,8 @@ import ( tu "github.com/ipfs/go-ipfs/thirdparty/testutil" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" ) // Test basic features of the bucket struct @@ -51,7 +52,7 @@ func TestBucket(t *testing.T) { // Right now, this just makes sure that it doesnt hang or crash func TestTableUpdate(t *testing.T) { local := tu.RandPeerIDFatal(t) - m := peer.NewMetrics() + m := pstore.NewMetrics() rt := NewRoutingTable(10, ConvertPeerID(local), time.Hour, m) peers := make([]peer.ID, 100) @@ -75,7 +76,7 @@ func TestTableUpdate(t *testing.T) { func TestTableFind(t *testing.T) { local := tu.RandPeerIDFatal(t) - m := peer.NewMetrics() + m := pstore.NewMetrics() rt := NewRoutingTable(10, ConvertPeerID(local), time.Hour, m) peers := make([]peer.ID, 100) @@ -93,7 +94,7 @@ func TestTableFind(t *testing.T) { func TestTableFindMultiple(t *testing.T) { local := tu.RandPeerIDFatal(t) - m := peer.NewMetrics() + m := pstore.NewMetrics() rt := NewRoutingTable(20, ConvertPeerID(local), time.Hour, m) peers := make([]peer.ID, 100) @@ -114,7 +115,7 @@ func TestTableFindMultiple(t *testing.T) { // and set GOMAXPROCS above 1 func TestTableMultithreaded(t *testing.T) { local := peer.ID("localPeer") - m := peer.NewMetrics() + m := pstore.NewMetrics() tab := NewRoutingTable(20, ConvertPeerID(local), time.Hour, m) var peers []peer.ID for i := 0; i < 500; i++ { @@ -153,7 +154,7 @@ func TestTableMultithreaded(t *testing.T) { func BenchmarkUpdates(b *testing.B) { b.StopTimer() local := ConvertKey("localKey") - m := peer.NewMetrics() + m := pstore.NewMetrics() tab := NewRoutingTable(20, local, time.Hour, m) var peers []peer.ID @@ -170,7 +171,7 @@ func BenchmarkUpdates(b *testing.B) { func BenchmarkFinds(b *testing.B) { b.StopTimer() local := ConvertKey("localKey") - m := peer.NewMetrics() + m := pstore.NewMetrics() tab := NewRoutingTable(20, local, time.Hour, m) var peers []peer.ID diff --git a/routing/kbucket/util.go b/routing/kbucket/util.go index 107dbf473a3..ad3fe498358 100644 --- a/routing/kbucket/util.go +++ b/routing/kbucket/util.go @@ -7,8 +7,8 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" ks "github.com/ipfs/go-ipfs/routing/keyspace" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // Returned if a routing table query returns no results. This is NOT expected diff --git a/routing/mock/centralized_client.go b/routing/mock/centralized_client.go index e48cb679b92..cc4bc2d0ff5 100644 --- a/routing/mock/centralized_client.go +++ b/routing/mock/centralized_client.go @@ -9,12 +9,14 @@ import ( routing "github.com/ipfs/go-ipfs/routing" dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" "github.com/ipfs/go-ipfs/thirdparty/testutil" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("mockrouter") @@ -72,17 +74,17 @@ func (c *client) GetValues(ctx context.Context, key key.Key, count int) ([]routi return []routing.RecvdVal{{Val: data, From: c.peer.ID()}}, nil } -func (c *client) FindProviders(ctx context.Context, key key.Key) ([]peer.PeerInfo, error) { +func (c *client) FindProviders(ctx context.Context, key key.Key) ([]pstore.PeerInfo, error) { return c.server.Providers(key), nil } -func (c *client) FindPeer(ctx context.Context, pid peer.ID) (peer.PeerInfo, error) { +func (c *client) FindPeer(ctx context.Context, pid peer.ID) (pstore.PeerInfo, error) { log.Debugf("FindPeer: %s", pid) - return peer.PeerInfo{}, nil + return pstore.PeerInfo{}, nil } -func (c *client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan peer.PeerInfo { - out := make(chan peer.PeerInfo) +func (c *client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan pstore.PeerInfo { + out := make(chan pstore.PeerInfo) go func() { defer close(out) for i, p := range c.server.Providers(k) { @@ -102,7 +104,7 @@ func (c *client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-c // Provide returns once the message is on the network. Value is not necessarily // visible yet. func (c *client) Provide(_ context.Context, key key.Key) error { - info := peer.PeerInfo{ + info := pstore.PeerInfo{ ID: c.peer.ID(), Addrs: []ma.Multiaddr{c.peer.Address()}, } diff --git a/routing/mock/centralized_server.go b/routing/mock/centralized_server.go index 5af2b92ff4e..e36c3d1d9db 100644 --- a/routing/mock/centralized_server.go +++ b/routing/mock/centralized_server.go @@ -9,14 +9,16 @@ import ( dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync" key "github.com/ipfs/go-ipfs/blocks/key" "github.com/ipfs/go-ipfs/thirdparty/testutil" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // server is the mockrouting.Client's private interface to the routing server type server interface { - Announce(peer.PeerInfo, key.Key) error - Providers(key.Key) []peer.PeerInfo + Announce(pstore.PeerInfo, key.Key) error + Providers(key.Key) []pstore.PeerInfo Server } @@ -30,11 +32,11 @@ type s struct { } type providerRecord struct { - Peer peer.PeerInfo + Peer pstore.PeerInfo Created time.Time } -func (rs *s) Announce(p peer.PeerInfo, k key.Key) error { +func (rs *s) Announce(p pstore.PeerInfo, k key.Key) error { rs.lock.Lock() defer rs.lock.Unlock() @@ -49,13 +51,13 @@ func (rs *s) Announce(p peer.PeerInfo, k key.Key) error { return nil } -func (rs *s) Providers(k key.Key) []peer.PeerInfo { +func (rs *s) Providers(k key.Key) []pstore.PeerInfo { rs.delayConf.Query.Wait() // before locking rs.lock.RLock() defer rs.lock.RUnlock() - var ret []peer.PeerInfo + var ret []pstore.PeerInfo records, ok := rs.providers[k] if !ok { return ret diff --git a/routing/mock/centralized_test.go b/routing/mock/centralized_test.go index 6bbbc1fbf54..647a100423c 100644 --- a/routing/mock/centralized_test.go +++ b/routing/mock/centralized_test.go @@ -7,8 +7,9 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" delay "github.com/ipfs/go-ipfs/thirdparty/delay" "github.com/ipfs/go-ipfs/thirdparty/testutil" + + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) func TestKeyNotFound(t *testing.T) { @@ -150,7 +151,7 @@ func TestValidAfter(t *testing.T) { rs.Client(pi).Provide(ctx, key) - var providers []peer.PeerInfo + var providers []pstore.PeerInfo providers, err := rs.Client(pi).FindProviders(ctx, key) if err != nil { t.Fatal(err) diff --git a/routing/mock/dht.go b/routing/mock/dht.go index d5d2d40d859..536f908e585 100644 --- a/routing/mock/dht.go +++ b/routing/mock/dht.go @@ -5,7 +5,7 @@ import ( sync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync" dht "github.com/ipfs/go-ipfs/routing/dht" "github.com/ipfs/go-ipfs/thirdparty/testutil" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) diff --git a/routing/mock/interface.go b/routing/mock/interface.go index 66d43d0bc92..1d833858a23 100644 --- a/routing/mock/interface.go +++ b/routing/mock/interface.go @@ -10,8 +10,9 @@ import ( routing "github.com/ipfs/go-ipfs/routing" delay "github.com/ipfs/go-ipfs/thirdparty/delay" "github.com/ipfs/go-ipfs/thirdparty/testutil" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // Server provides mockrouting Clients @@ -22,7 +23,7 @@ type Server interface { // Client implements IpfsRouting type Client interface { - FindProviders(context.Context, key.Key) ([]peer.PeerInfo, error) + FindProviders(context.Context, key.Key) ([]pstore.PeerInfo, error) routing.IpfsRouting } diff --git a/routing/none/none_client.go b/routing/none/none_client.go index fa80f1e637e..1752f33c7d0 100644 --- a/routing/none/none_client.go +++ b/routing/none/none_client.go @@ -6,10 +6,11 @@ import ( key "github.com/ipfs/go-ipfs/blocks/key" repo "github.com/ipfs/go-ipfs/repo" routing "github.com/ipfs/go-ipfs/routing" - p2phost "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + p2phost "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("mockrouter") @@ -29,12 +30,12 @@ func (c *nilclient) GetValues(_ context.Context, _ key.Key, _ int) ([]routing.Re return nil, errors.New("Tried GetValues from nil routing.") } -func (c *nilclient) FindPeer(_ context.Context, _ peer.ID) (peer.PeerInfo, error) { - return peer.PeerInfo{}, nil +func (c *nilclient) FindPeer(_ context.Context, _ peer.ID) (pstore.PeerInfo, error) { + return pstore.PeerInfo{}, nil } -func (c *nilclient) FindProvidersAsync(_ context.Context, _ key.Key, _ int) <-chan peer.PeerInfo { - out := make(chan peer.PeerInfo) +func (c *nilclient) FindProvidersAsync(_ context.Context, _ key.Key, _ int) <-chan pstore.PeerInfo { + out := make(chan pstore.PeerInfo) defer close(out) return out } diff --git a/routing/offline/offline.go b/routing/offline/offline.go index 398e5b07ba2..6175f9111ad 100644 --- a/routing/offline/offline.go +++ b/routing/offline/offline.go @@ -9,11 +9,13 @@ import ( routing "github.com/ipfs/go-ipfs/routing" pb "github.com/ipfs/go-ipfs/routing/dht/pb" record "github.com/ipfs/go-ipfs/routing/record" + + "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("offlinerouting") @@ -88,16 +90,16 @@ func (c *offlineRouting) GetValues(ctx context.Context, key key.Key, _ int) ([]r }, nil } -func (c *offlineRouting) FindProviders(ctx context.Context, key key.Key) ([]peer.PeerInfo, error) { +func (c *offlineRouting) FindProviders(ctx context.Context, key key.Key) ([]pstore.PeerInfo, error) { return nil, ErrOffline } -func (c *offlineRouting) FindPeer(ctx context.Context, pid peer.ID) (peer.PeerInfo, error) { - return peer.PeerInfo{}, ErrOffline +func (c *offlineRouting) FindPeer(ctx context.Context, pid peer.ID) (pstore.PeerInfo, error) { + return pstore.PeerInfo{}, ErrOffline } -func (c *offlineRouting) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan peer.PeerInfo { - out := make(chan peer.PeerInfo) +func (c *offlineRouting) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan pstore.PeerInfo { + out := make(chan pstore.PeerInfo) close(out) return out } diff --git a/routing/routing.go b/routing/routing.go index bedcabd5390..b2f2a1f7160 100644 --- a/routing/routing.go +++ b/routing/routing.go @@ -5,9 +5,10 @@ import ( "errors" key "github.com/ipfs/go-ipfs/blocks/key" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) // ErrNotFound is returned when a search fails to find anything @@ -16,7 +17,7 @@ var ErrNotFound = errors.New("routing: not found") // IpfsRouting is the routing module interface // It is implemented by things like DHTs, etc. type IpfsRouting interface { - FindProvidersAsync(context.Context, key.Key, int) <-chan peer.PeerInfo + FindProvidersAsync(context.Context, key.Key, int) <-chan pstore.PeerInfo // Basic Put/Get @@ -45,9 +46,9 @@ type IpfsRouting interface { Provide(context.Context, key.Key) error // Find specific Peer - // FindPeer searches for a peer with given ID, returns a peer.PeerInfo + // FindPeer searches for a peer with given ID, returns a pstore.PeerInfo // with relevant addresses. - FindPeer(context.Context, peer.ID) (peer.PeerInfo, error) + FindPeer(context.Context, peer.ID) (pstore.PeerInfo, error) // Bootstrap allows callers to hint to the routing system to get into a // Boostrapped state diff --git a/routing/supernode/client.go b/routing/supernode/client.go index 2a713196182..060d77733c3 100644 --- a/routing/supernode/client.go +++ b/routing/supernode/client.go @@ -5,31 +5,31 @@ import ( "errors" "time" - proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - - "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" - key "github.com/ipfs/go-ipfs/blocks/key" routing "github.com/ipfs/go-ipfs/routing" pb "github.com/ipfs/go-ipfs/routing/dht/pb" proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" loggables "github.com/ipfs/go-ipfs/thirdparty/loggables" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" + context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" + logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" ) var log = logging.Logger("supernode") type Client struct { peerhost host.Host - peerstore peer.Peerstore + peerstore pstore.Peerstore proxy proxy.Proxy local peer.ID } // TODO take in datastore/cache -func NewClient(px proxy.Proxy, h host.Host, ps peer.Peerstore, local peer.ID) (*Client, error) { +func NewClient(px proxy.Proxy, h host.Host, ps pstore.Peerstore, local peer.ID) (*Client, error) { return &Client{ proxy: px, local: local, @@ -38,10 +38,10 @@ func NewClient(px proxy.Proxy, h host.Host, ps peer.Peerstore, local peer.ID) (* }, nil } -func (c *Client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan peer.PeerInfo { +func (c *Client) FindProvidersAsync(ctx context.Context, k key.Key, max int) <-chan pstore.PeerInfo { logging.ContextWithLoggable(ctx, loggables.Uuid("findProviders")) defer log.EventBegin(ctx, "findProviders", &k).Done() - ch := make(chan peer.PeerInfo) + ch := make(chan pstore.PeerInfo) go func() { defer close(ch) request := pb.NewMessage(pb.Message_GET_PROVIDERS, string(k), 0) @@ -105,7 +105,7 @@ func (c *Client) Provide(ctx context.Context, k key.Key) error { // FIXME how is connectedness defined for the local node pri := []pb.PeerRoutingInfo{ { - PeerInfo: peer.PeerInfo{ + PeerInfo: pstore.PeerInfo{ ID: c.local, Addrs: c.peerhost.Addrs(), }, @@ -115,23 +115,23 @@ func (c *Client) Provide(ctx context.Context, k key.Key) error { return c.proxy.SendMessage(ctx, msg) // TODO wrap to hide remote } -func (c *Client) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, error) { +func (c *Client) FindPeer(ctx context.Context, id peer.ID) (pstore.PeerInfo, error) { defer log.EventBegin(ctx, "findPeer", id).Done() request := pb.NewMessage(pb.Message_FIND_NODE, string(id), 0) response, err := c.proxy.SendRequest(ctx, request) // hide remote if err != nil { - return peer.PeerInfo{}, err + return pstore.PeerInfo{}, err } for _, p := range pb.PBPeersToPeerInfos(response.GetCloserPeers()) { if p.ID == id { return p, nil } } - return peer.PeerInfo{}, errors.New("could not find peer") + return pstore.PeerInfo{}, errors.New("could not find peer") } // creates and signs a record for the given key/value pair -func makeRecord(ps peer.Peerstore, p peer.ID, k key.Key, v []byte) (*pb.Record, error) { +func makeRecord(ps pstore.Peerstore, p peer.ID, k key.Key, v []byte) (*pb.Record, error) { blob := bytes.Join([][]byte{[]byte(k), v, []byte(p)}, []byte{}) sig, err := ps.PrivKey(p).Sign(blob) if err != nil { diff --git a/routing/supernode/proxy/loopback.go b/routing/supernode/proxy/loopback.go index 88041a1afc7..91efb600170 100644 --- a/routing/supernode/proxy/loopback.go +++ b/routing/supernode/proxy/loopback.go @@ -5,8 +5,8 @@ import ( context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" ) // RequestHandler handles routing requests locally diff --git a/routing/supernode/proxy/standard.go b/routing/supernode/proxy/standard.go index 7e3ea1ee862..4fbf4d1be81 100644 --- a/routing/supernode/proxy/standard.go +++ b/routing/supernode/proxy/standard.go @@ -6,10 +6,11 @@ import ( ggio "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/io" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - host "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/host" - inet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + host "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/host" + inet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" key "github.com/ipfs/go-ipfs/blocks/key" dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" @@ -31,11 +32,11 @@ type Proxy interface { type standard struct { Host host.Host - remoteInfos []peer.PeerInfo // addr required for bootstrapping - remoteIDs []peer.ID // []ID is required for each req. here, cached for performance. + remoteInfos []pstore.PeerInfo // addr required for bootstrapping + remoteIDs []peer.ID // []ID is required for each req. here, cached for performance. } -func Standard(h host.Host, remotes []peer.PeerInfo) Proxy { +func Standard(h host.Host, remotes []pstore.PeerInfo) Proxy { var ids []peer.ID for _, remote := range remotes { ids = append(ids, remote.ID) @@ -44,7 +45,7 @@ func Standard(h host.Host, remotes []peer.PeerInfo) Proxy { } func (px *standard) Bootstrap(ctx context.Context) error { - var cxns []peer.PeerInfo + var cxns []pstore.PeerInfo for _, info := range px.remoteInfos { if err := px.Host.Connect(ctx, info); err != nil { continue @@ -97,7 +98,7 @@ func (px *standard) sendMessage(ctx context.Context, m *dhtpb.Message, remote pe } e.Done() }() - if err = px.Host.Connect(ctx, peer.PeerInfo{ID: remote}); err != nil { + if err = px.Host.Connect(ctx, pstore.PeerInfo{ID: remote}); err != nil { return err } s, err := px.Host.NewStream(ctx, ProtocolSNR, remote) @@ -131,7 +132,7 @@ func (px *standard) SendRequest(ctx context.Context, m *dhtpb.Message) (*dhtpb.M func (px *standard) sendRequest(ctx context.Context, m *dhtpb.Message, remote peer.ID) (*dhtpb.Message, error) { e := log.EventBegin(ctx, "sendRoutingRequest", px.Host.ID(), remote, logging.Pair("request", m)) defer e.Done() - if err := px.Host.Connect(ctx, peer.PeerInfo{ID: remote}); err != nil { + if err := px.Host.Connect(ctx, pstore.PeerInfo{ID: remote}); err != nil { e.SetError(err) return nil, err } diff --git a/routing/supernode/server.go b/routing/supernode/server.go index 64b0ef87b0a..850e96d649d 100644 --- a/routing/supernode/server.go +++ b/routing/supernode/server.go @@ -5,26 +5,27 @@ import ( "fmt" datastore "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore" - proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" - context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - key "github.com/ipfs/go-ipfs/blocks/key" dhtpb "github.com/ipfs/go-ipfs/routing/dht/pb" record "github.com/ipfs/go-ipfs/routing/record" proxy "github.com/ipfs/go-ipfs/routing/supernode/proxy" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" + proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" + context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) // Server handles routing queries using a database backend type Server struct { local peer.ID routingBackend datastore.Datastore - peerstore peer.Peerstore + peerstore pstore.Peerstore *proxy.Loopback // so server can be injected into client } // NewServer creates a new Supernode routing Server -func NewServer(ds datastore.Datastore, ps peer.Peerstore, local peer.ID) (*Server, error) { +func NewServer(ds datastore.Datastore, ps pstore.Peerstore, local peer.ID) (*Server, error) { s := &Server{local, ds, ps, nil} s.Loopback = &proxy.Loopback{ Handler: s, @@ -169,7 +170,7 @@ func putRoutingProviders(ds datastore.Datastore, k key.Key, newRecords []*dhtpb. return ds.Put(providerKey(k), data) } -func storeProvidersToPeerstore(ps peer.Peerstore, p peer.ID, providers []*dhtpb.Message_Peer) { +func storeProvidersToPeerstore(ps pstore.Peerstore, p peer.ID, providers []*dhtpb.Message_Peer) { for _, provider := range providers { providerID := peer.ID(provider.GetId()) if providerID != p { @@ -178,7 +179,7 @@ func storeProvidersToPeerstore(ps peer.Peerstore, p peer.ID, providers []*dhtpb. } for _, maddr := range provider.Addresses() { // as a router, we want to store addresses for peers who have provided - ps.AddAddr(p, maddr, peer.AddressTTL) + ps.AddAddr(p, maddr, pstore.AddressTTL) } } } @@ -203,7 +204,7 @@ func providerKey(k key.Key) datastore.Key { return datastore.KeyWithNamespaces([]string{"routing", "providers", k.String()}) } -func verify(ps peer.Peerstore, r *dhtpb.Record) error { +func verify(ps pstore.Peerstore, r *dhtpb.Record) error { v := make(record.Validator) v["pk"] = record.PublicKeyValidator p := peer.ID(r.GetAuthor()) diff --git a/test/integration/addcat_test.go b/test/integration/addcat_test.go index 91d776aed3d..ab7b1a8eaf3 100644 --- a/test/integration/addcat_test.go +++ b/test/integration/addcat_test.go @@ -18,9 +18,9 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("epictest") @@ -123,8 +123,8 @@ func DirectAddCat(data []byte, conf testutil.LatencyConfig) error { return err } - bs1 := []peer.PeerInfo{adder.Peerstore.PeerInfo(adder.Identity)} - bs2 := []peer.PeerInfo{catter.Peerstore.PeerInfo(catter.Identity)} + bs1 := []pstore.PeerInfo{adder.Peerstore.PeerInfo(adder.Identity)} + bs2 := []pstore.PeerInfo{catter.Peerstore.PeerInfo(catter.Identity)} if err := catter.Bootstrap(core.BootstrapConfigWithPeers(bs1)); err != nil { return err diff --git a/test/integration/bench_cat_test.go b/test/integration/bench_cat_test.go index 5846b1661e1..a018dd2d0e9 100644 --- a/test/integration/bench_cat_test.go +++ b/test/integration/bench_cat_test.go @@ -12,9 +12,9 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) func BenchmarkCat1MB(b *testing.B) { benchmarkVarCat(b, unit.MB*1) } @@ -68,8 +68,8 @@ func benchCat(b *testing.B, data []byte, conf testutil.LatencyConfig) error { return err } - bs1 := []peer.PeerInfo{adder.Peerstore.PeerInfo(adder.Identity)} - bs2 := []peer.PeerInfo{catter.Peerstore.PeerInfo(catter.Identity)} + bs1 := []pstore.PeerInfo{adder.Peerstore.PeerInfo(adder.Identity)} + bs2 := []pstore.PeerInfo{catter.Peerstore.PeerInfo(catter.Identity)} if err := catter.Bootstrap(core.BootstrapConfigWithPeers(bs1)); err != nil { return err diff --git a/test/integration/bitswap_wo_routing_test.go b/test/integration/bitswap_wo_routing_test.go index 9714d19f9b9..e89fa99c555 100644 --- a/test/integration/bitswap_wo_routing_test.go +++ b/test/integration/bitswap_wo_routing_test.go @@ -7,7 +7,7 @@ import ( "github.com/ipfs/go-ipfs/blocks" "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/mock" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" ) diff --git a/test/integration/grandcentral_test.go b/test/integration/grandcentral_test.go index 7db1ef261e9..e47ad80a529 100644 --- a/test/integration/grandcentral_test.go +++ b/test/integration/grandcentral_test.go @@ -20,8 +20,8 @@ import ( ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" ) func TestSupernodeBootstrappedAddCat(t *testing.T) { @@ -103,7 +103,7 @@ func InitializeSupernodeNetwork( servers = append(servers, bootstrap) } - var bootstrapInfos []peer.PeerInfo + var bootstrapInfos []pstore.PeerInfo for _, n := range servers { info := n.Peerstore.PeerInfo(n.PeerHost.ID()) bootstrapInfos = append(bootstrapInfos, info) diff --git a/test/integration/three_legged_cat_test.go b/test/integration/three_legged_cat_test.go index 19c6a8ae4f5..f97af53ac75 100644 --- a/test/integration/three_legged_cat_test.go +++ b/test/integration/three_legged_cat_test.go @@ -15,8 +15,8 @@ import ( mock "github.com/ipfs/go-ipfs/core/mock" testutil "github.com/ipfs/go-ipfs/thirdparty/testutil" "github.com/ipfs/go-ipfs/thirdparty/unit" - mocknet "gx/ipfs/QmRW2xiYTpDLWTHb822ZYbPBoh3dGLJwaXLGS9tnPyWZpq/go-libp2p/p2p/net/mock" - "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + mocknet "gx/ipfs/QmQgQeBQxQmJdeUSaDagc8cr2ompDwGn13Cybjdtzfuaki/go-libp2p/p2p/net/mock" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" ) func TestThreeLeggedCatTransfer(t *testing.T) { @@ -104,7 +104,7 @@ func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error { mn.LinkAll() bis := bootstrap.Peerstore.PeerInfo(bootstrap.PeerHost.ID()) - bcfg := core.BootstrapConfigWithPeers([]peer.PeerInfo{bis}) + bcfg := core.BootstrapConfigWithPeers([]pstore.PeerInfo{bis}) if err := adder.Bootstrap(bcfg); err != nil { return err } diff --git a/test/supernode_client/main.go b/test/supernode_client/main.go index 331f6500a50..446d053cfd9 100644 --- a/test/supernode_client/main.go +++ b/test/supernode_client/main.go @@ -12,13 +12,9 @@ import ( gopath "path" "time" - random "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random" - "github.com/ipfs/go-ipfs/thirdparty/ipfsaddr" - ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" - context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" - "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore" syncds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync" + random "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random" commands "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" corehttp "github.com/ipfs/go-ipfs/core/corehttp" @@ -28,9 +24,13 @@ import ( config "github.com/ipfs/go-ipfs/repo/config" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" ds2 "github.com/ipfs/go-ipfs/thirdparty/datastore2" + "github.com/ipfs/go-ipfs/thirdparty/ipfsaddr" unit "github.com/ipfs/go-ipfs/thirdparty/unit" + + ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" + pstore "gx/ipfs/QmZ62t46e9p7vMYqCmptwQC1RhRv5cpQ5cwoqYspedaXyq/go-libp2p-peerstore" + context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var elog = logging.Logger("gc-client") @@ -89,9 +89,9 @@ func run() error { addrs = append(addrs, addr) } - var infos []peer.PeerInfo + var infos []pstore.PeerInfo for _, addr := range addrs { - infos = append(infos, peer.PeerInfo{ + infos = append(infos, pstore.PeerInfo{ ID: addr.ID(), Addrs: []ma.Multiaddr{addr.Transport()}, }) @@ -233,8 +233,8 @@ func runFileCattingWorker(ctx context.Context, n *core.IpfsNode) error { return nil } -func toPeerInfos(bpeers []config.BootstrapPeer) ([]peer.PeerInfo, error) { - var peers []peer.PeerInfo +func toPeerInfos(bpeers []config.BootstrapPeer) ([]pstore.PeerInfo, error) { + var peers []pstore.PeerInfo for _, bootstrap := range bpeers { p, err := toPeerInfo(bootstrap) if err != nil { @@ -245,8 +245,8 @@ func toPeerInfos(bpeers []config.BootstrapPeer) ([]peer.PeerInfo, error) { return peers, nil } -func toPeerInfo(bootstrap config.BootstrapPeer) (p peer.PeerInfo, err error) { - p = peer.PeerInfo{ +func toPeerInfo(bootstrap config.BootstrapPeer) (p pstore.PeerInfo, err error) { + p = pstore.PeerInfo{ ID: bootstrap.ID(), Addrs: []ma.Multiaddr{bootstrap.Multiaddr()}, } diff --git a/thirdparty/ipfsaddr/ipfsaddr.go b/thirdparty/ipfsaddr/ipfsaddr.go index b4ee30c8a66..d6d829b6601 100644 --- a/thirdparty/ipfsaddr/ipfsaddr.go +++ b/thirdparty/ipfsaddr/ipfsaddr.go @@ -6,8 +6,8 @@ import ( ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" path "github.com/ipfs/go-ipfs/path" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var log = logging.Logger("ipfsaddr") diff --git a/thirdparty/ipfsaddr/ipfsaddr_test.go b/thirdparty/ipfsaddr/ipfsaddr_test.go index cd8b92b94de..7a3aa8a161d 100644 --- a/thirdparty/ipfsaddr/ipfsaddr_test.go +++ b/thirdparty/ipfsaddr/ipfsaddr_test.go @@ -4,8 +4,8 @@ import ( "testing" path "github.com/ipfs/go-ipfs/path" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) var good = []string{ diff --git a/thirdparty/loggables/loggables.go b/thirdparty/loggables/loggables.go index 253ffb9d50c..f4bd7cf99e2 100644 --- a/thirdparty/loggables/loggables.go +++ b/thirdparty/loggables/loggables.go @@ -15,7 +15,7 @@ import ( logging "gx/ipfs/QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8/go-log" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ) // NetConn returns an eventlog.Metadata with the conn addresses diff --git a/thirdparty/peerset/peerset.go b/thirdparty/peerset/peerset.go index a89b7fc6f95..ef43ade79f8 100644 --- a/thirdparty/peerset/peerset.go +++ b/thirdparty/peerset/peerset.go @@ -1,7 +1,7 @@ package peerset import ( - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" "sync" ) diff --git a/thirdparty/testutil/gen.go b/thirdparty/testutil/gen.go index 3d65fc8d2d1..782648bb9de 100644 --- a/thirdparty/testutil/gen.go +++ b/thirdparty/testutil/gen.go @@ -8,9 +8,9 @@ import ( "sync" "testing" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" ) diff --git a/thirdparty/testutil/identity.go b/thirdparty/testutil/identity.go index d4949325925..2327fe74c80 100644 --- a/thirdparty/testutil/identity.go +++ b/thirdparty/testutil/identity.go @@ -3,9 +3,9 @@ package testutil import ( "testing" + peer "gx/ipfs/QmQGwpJy9P4yXZySmqkZEXCmbBpJUb8xntCv8Ca4taZwDC/go-libp2p-peer" ci "gx/ipfs/QmUEUu1CM8bxBJxc3ZLojAi8evhTr4byQogWstABet79oY/go-libp2p-crypto" ma "gx/ipfs/QmYzDkkgAEmrcNzFCiYo6L1dTX4EAG1gZkbtdbd9trL4vd/go-multiaddr" - peer "gx/ipfs/QmbyvM8zRFDkbFdYyt1MnevUMJ62SiSGbfDFZ3Z8nkrzr4/go-libp2p-peer" ) type Identity interface {