From 462369000981fd1b7a3d54ce3ec4f0e79f78a05d Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 17 Aug 2022 10:38:18 +0300 Subject: [PATCH] switch from github.com/libp2p/go-libp2p-core to core --- config/config.go | 23 ++++---- config/constructor_types.go | 18 +++--- config/muxer.go | 6 +- config/muxer_test.go | 7 +-- config/reflection_magic.go | 12 ++-- config/security.go | 11 ++-- config/transport.go | 10 ++-- config/transport_test.go | 5 +- core/alias.go | 9 +-- core/canonicallog/canonicallog.go | 3 +- core/canonicallog/canonicallog_test.go | 3 +- core/connmgr/decay.go | 10 ++-- core/connmgr/gater.go | 36 +++++------ core/connmgr/manager.go | 4 +- core/connmgr/null.go | 4 +- core/crypto/ecdsa.go | 4 +- core/crypto/ed25519.go | 4 +- core/crypto/ed25519_test.go | 2 +- core/crypto/fixture_test.go | 4 +- core/crypto/key.go | 2 +- core/crypto/key_not_openssl.go | 8 +-- core/crypto/key_openssl.go | 12 ++-- core/crypto/key_test.go | 9 +-- core/crypto/openssl_common.go | 2 +- core/crypto/pb/crypto.proto | 2 +- core/crypto/rsa_go.go | 4 +- core/crypto/secp256k1.go | 4 +- core/discovery/discovery.go | 2 +- core/event/addrs.go | 3 +- core/event/doc.go | 12 ++-- core/event/identify.go | 2 +- core/event/nattype.go | 2 +- core/event/network.go | 28 ++++----- core/event/protocol.go | 4 +- core/event/reachability.go | 2 +- core/host/helpers.go | 2 +- core/host/host.go | 14 ++--- core/introspection/introspector.go | 2 +- core/introspection/pb/introspection.pb.go | 11 ++-- core/metrics/bandwidth.go | 4 +- core/metrics/bandwidth_test.go | 4 +- core/metrics/reporter.go | 4 +- core/network/conn.go | 7 ++- core/network/network.go | 4 +- core/network/rcmgr.go | 59 ++++++++++--------- core/network/stream.go | 2 +- core/peer/addrinfo_serde.go | 3 +- core/peer/addrinfo_test.go | 2 +- core/peer/pb/peer_record.pb.go | 5 +- core/peer/pb/peer_record.proto | 2 +- core/peer/peer.go | 2 +- core/peer/peer_serde_test.go | 4 +- core/peer/peer_test.go | 6 +- core/peer/record.go | 35 ++++++----- core/peer/record_test.go | 8 +-- core/peerstore/helpers.go | 2 +- core/peerstore/peerstore.go | 13 ++-- core/record/envelope.go | 36 +++++------ core/record/envelope_test.go | 8 +-- core/record/pb/envelope.pb.go | 5 +- core/record/record.go | 15 +++-- core/routing/query.go | 2 +- core/routing/query_serde.go | 2 +- core/routing/routing.go | 4 +- core/sec/insecure/insecure.go | 10 ++-- core/sec/insecure/insecure_test.go | 8 +-- core/sec/insecure/pb/plaintext.pb.go | 5 +- core/sec/insecure/pb/plaintext.proto | 2 +- core/sec/security.go | 4 +- core/test/crypto.go | 2 +- core/test/peer.go | 2 +- core/transport/transport.go | 4 +- defaults.go | 3 +- go.mod | 12 ++-- go.sum | 4 +- libp2p.go | 3 +- libp2p_test.go | 11 ++-- limits.go | 3 +- options.go | 17 +++--- options_filter.go | 8 +-- p2p/discovery/backoff/backoffcache.go | 4 +- p2p/discovery/backoff/backoffcache_test.go | 4 +- p2p/discovery/backoff/backoffconnector.go | 6 +- .../backoff/backoffconnector_test.go | 5 +- p2p/discovery/mdns/mdns.go | 7 ++- p2p/discovery/mdns/mdns_test.go | 2 +- p2p/discovery/mocks/mocks.go | 6 +- p2p/discovery/routing/routing.go | 6 +- p2p/discovery/routing/routing_test.go | 6 +- p2p/discovery/util/util.go | 4 +- p2p/host/autonat/autonat.go | 9 ++- p2p/host/autonat/autonat_test.go | 9 ++- p2p/host/autonat/client.go | 7 +-- p2p/host/autonat/dialpolicy.go | 3 +- p2p/host/autonat/dialpolicy_test.go | 5 +- p2p/host/autonat/interface.go | 4 +- p2p/host/autonat/notify.go | 2 +- p2p/host/autonat/options.go | 4 +- p2p/host/autonat/proto.go | 3 +- p2p/host/autonat/svc.go | 7 +-- p2p/host/autonat/svc_test.go | 7 +-- p2p/host/autonat/test/autonat_test.go | 5 +- p2p/host/autorelay/autorelay.go | 7 +-- p2p/host/autorelay/autorelay_test.go | 7 +-- p2p/host/autorelay/host.go | 2 +- p2p/host/autorelay/options.go | 2 +- p2p/host/autorelay/relay_finder.go | 7 +-- p2p/host/basic/basic_host.go | 19 +++--- p2p/host/basic/basic_host_test.go | 17 +++--- p2p/host/basic/natmgr.go | 3 +- p2p/host/basic/peer_connectedness.go | 6 +- p2p/host/basic/peer_connectedness_test.go | 7 +-- p2p/host/blank/blank.go | 17 +++--- p2p/host/blank/peer_connectedness.go | 6 +- p2p/host/blank/peer_connectedness_test.go | 7 +-- p2p/host/eventbus/basic.go | 6 +- p2p/host/eventbus/basic_test.go | 3 +- p2p/host/peerstore/metrics.go | 2 +- p2p/host/peerstore/metrics_test.go | 2 +- p2p/host/peerstore/pb/custom.go | 7 ++- p2p/host/peerstore/peerstore.go | 4 +- p2p/host/peerstore/pstoreds/addr_book.go | 9 ++- p2p/host/peerstore/pstoreds/addr_book_gc.go | 3 +- .../peerstore/pstoreds/addr_book_gc_test.go | 3 +- p2p/host/peerstore/pstoreds/ds_test.go | 3 +- p2p/host/peerstore/pstoreds/keybook.go | 9 ++- p2p/host/peerstore/pstoreds/metadata.go | 4 +- p2p/host/peerstore/pstoreds/peerstore.go | 5 +- p2p/host/peerstore/pstoreds/protobook.go | 5 +- p2p/host/peerstore/pstoremem/addr_book.go | 8 +-- p2p/host/peerstore/pstoremem/inmem_test.go | 3 +- p2p/host/peerstore/pstoremem/keybook.go | 7 +-- p2p/host/peerstore/pstoremem/metadata.go | 4 +- p2p/host/peerstore/pstoremem/peerstore.go | 5 +- p2p/host/peerstore/pstoremem/protobook.go | 5 +- p2p/host/peerstore/test/addr_book_suite.go | 14 ++--- p2p/host/peerstore/test/benchmarks_suite.go | 2 +- p2p/host/peerstore/test/keybook_suite.go | 11 ++-- p2p/host/peerstore/test/peerstore_suite.go | 8 +-- p2p/host/peerstore/test/utils.go | 5 +- p2p/host/pstoremanager/mock_peerstore_test.go | 6 +- p2p/host/pstoremanager/pstoremanager.go | 8 +-- p2p/host/pstoremanager/pstoremanager_test.go | 9 ++- p2p/host/relaysvc/relay.go | 6 +- p2p/host/resource-manager/allowlist.go | 3 +- p2p/host/resource-manager/allowlist_test.go | 25 ++++---- p2p/host/resource-manager/error.go | 2 +- p2p/host/resource-manager/extapi.go | 6 +- p2p/host/resource-manager/limit.go | 6 +- .../resource-manager/limit_config_test.go | 2 +- p2p/host/resource-manager/limit_defaults.go | 6 +- p2p/host/resource-manager/metrics.go | 6 +- p2p/host/resource-manager/rcmgr.go | 8 +-- p2p/host/resource-manager/rcmgr_test.go | 9 +-- p2p/host/resource-manager/scope.go | 2 +- p2p/host/resource-manager/scope_test.go | 2 +- p2p/host/resource-manager/trace.go | 2 +- p2p/host/routed/routed.go | 14 ++--- p2p/muxer/mplex/conn.go | 2 +- p2p/muxer/mplex/stream.go | 2 +- p2p/muxer/mplex/transport.go | 2 +- p2p/muxer/mplex/transport_test.go | 2 +- p2p/muxer/muxer-multistream/multistream.go | 2 +- p2p/muxer/testsuite/mux.go | 4 +- p2p/muxer/yamux/conn.go | 2 +- p2p/muxer/yamux/stream.go | 2 +- p2p/muxer/yamux/transport.go | 2 +- p2p/net/conn-security-multistream/ssms.go | 5 +- .../conn-security-multistream/ssms_test.go | 6 +- p2p/net/conngater/conngater.go | 8 +-- p2p/net/conngater/conngater_test.go | 5 +- p2p/net/connmgr/bench_test.go | 2 +- p2p/net/connmgr/connmgr.go | 6 +- p2p/net/connmgr/connmgr_test.go | 10 ++-- p2p/net/connmgr/decay.go | 4 +- p2p/net/connmgr/decay_test.go | 6 +- p2p/net/mock/complement.go | 2 +- p2p/net/mock/interface.go | 10 ++-- p2p/net/mock/mock_conn.go | 6 +- p2p/net/mock/mock_link.go | 4 +- p2p/net/mock/mock_net.go | 11 ++-- p2p/net/mock/mock_notif_test.go | 6 +- p2p/net/mock/mock_peernet.go | 6 +- p2p/net/mock/mock_printer.go | 4 +- p2p/net/mock/mock_stream.go | 4 +- p2p/net/mock/mock_test.go | 6 +- p2p/net/pnet/protector.go | 2 +- p2p/net/pnet/psk_conn.go | 2 +- p2p/net/swarm/dial_error.go | 2 +- p2p/net/swarm/dial_sync.go | 4 +- p2p/net/swarm/dial_sync_test.go | 2 +- p2p/net/swarm/dial_test.go | 11 ++-- p2p/net/swarm/dial_worker.go | 4 +- p2p/net/swarm/dial_worker_test.go | 9 ++- p2p/net/swarm/limiter.go | 4 +- p2p/net/swarm/limiter_test.go | 6 +- p2p/net/swarm/peers_test.go | 6 +- p2p/net/swarm/simul_test.go | 5 +- p2p/net/swarm/swarm.go | 12 ++-- p2p/net/swarm/swarm_addr_test.go | 5 +- p2p/net/swarm/swarm_conn.go | 8 +-- p2p/net/swarm/swarm_dial.go | 10 ++-- p2p/net/swarm/swarm_listen.go | 6 +- p2p/net/swarm/swarm_net_test.go | 3 +- p2p/net/swarm/swarm_notif_test.go | 5 +- p2p/net/swarm/swarm_stream.go | 4 +- p2p/net/swarm/swarm_test.go | 17 +++--- p2p/net/swarm/swarm_transport.go | 2 +- p2p/net/swarm/testing/testing.go | 19 +++--- p2p/net/swarm/transport_test.go | 6 +- p2p/net/swarm/util_test.go | 4 +- p2p/net/upgrader/conn.go | 4 +- p2p/net/upgrader/gater_test.go | 8 +-- p2p/net/upgrader/listener.go | 4 +- p2p/net/upgrader/listener_test.go | 14 ++--- p2p/net/upgrader/upgrader.go | 13 ++-- p2p/net/upgrader/upgrader_test.go | 17 +++--- p2p/protocol/circuitv1/relay/options.go | 2 +- p2p/protocol/circuitv1/relay/relay.go | 7 +-- p2p/protocol/circuitv2/client/client.go | 7 +-- p2p/protocol/circuitv2/client/conn.go | 4 +- p2p/protocol/circuitv2/client/dial.go | 7 +-- p2p/protocol/circuitv2/client/handlers.go | 3 +- p2p/protocol/circuitv2/client/reservation.go | 9 ++- .../circuitv2/client/reservation_test.go | 5 +- p2p/protocol/circuitv2/client/transport.go | 9 ++- p2p/protocol/circuitv2/proto/voucher.go | 5 +- p2p/protocol/circuitv2/proto/voucher_test.go | 6 +- p2p/protocol/circuitv2/relay/acl.go | 2 +- p2p/protocol/circuitv2/relay/compat_test.go | 9 ++- p2p/protocol/circuitv2/relay/constraints.go | 3 +- .../circuitv2/relay/constraints_test.go | 3 +- p2p/protocol/circuitv2/relay/relay.go | 9 ++- p2p/protocol/circuitv2/relay/relay_test.go | 13 ++-- p2p/protocol/circuitv2/util/pbconv.go | 3 +- p2p/protocol/holepunch/holepunch_test.go | 16 ++--- p2p/protocol/holepunch/holepuncher.go | 7 +-- p2p/protocol/holepunch/svc.go | 11 ++-- p2p/protocol/holepunch/tracer.go | 2 +- p2p/protocol/holepunch/util.go | 7 ++- p2p/protocol/identify/id.go | 14 ++--- p2p/protocol/identify/id_delta.go | 9 ++- p2p/protocol/identify/id_glass_test.go | 5 +- p2p/protocol/identify/id_push.go | 2 +- p2p/protocol/identify/id_test.go | 19 +++--- p2p/protocol/identify/obsaddr.go | 8 +-- p2p/protocol/identify/obsaddr_test.go | 11 ++-- p2p/protocol/identify/pb/identify.pb.go | 7 ++- p2p/protocol/identify/pb/identify.proto | 4 +- p2p/protocol/identify/peer_loop.go | 9 ++- p2p/protocol/identify/peer_loop_test.go | 5 +- .../internal/circuitv1-deprecated/conn.go | 6 +- .../internal/circuitv1-deprecated/dial.go | 6 +- .../internal/circuitv1-deprecated/relay.go | 10 ++-- .../circuitv1-deprecated/relay_test.go | 2 +- .../circuitv1-deprecated/transport.go | 4 +- .../circuitv1-deprecated/transport_test.go | 6 +- .../internal/circuitv1-deprecated/util.go | 2 +- p2p/protocol/ping/ping.go | 6 +- p2p/protocol/ping/ping_test.go | 3 +- p2p/security/noise/benchmark_test.go | 4 +- p2p/security/noise/crypto_test.go | 2 +- p2p/security/noise/handshake.go | 4 +- p2p/security/noise/session.go | 4 +- p2p/security/noise/session_test.go | 2 +- p2p/security/noise/session_transport.go | 6 +- p2p/security/noise/transport.go | 11 ++-- p2p/security/noise/transport_test.go | 6 +- p2p/security/tls/cmd/tlsdiag/client.go | 2 +- p2p/security/tls/cmd/tlsdiag/key.go | 2 +- p2p/security/tls/cmd/tlsdiag/server.go | 2 +- p2p/security/tls/conn.go | 6 +- p2p/security/tls/crypto.go | 4 +- p2p/security/tls/transport.go | 9 +-- p2p/security/tls/transport_test.go | 6 +- p2p/test/backpressure/backpressure_test.go | 5 +- p2p/test/reconnects/reconnect_test.go | 9 ++- p2p/test/resource-manager/echo.go | 6 +- p2p/test/resource-manager/echo_test.go | 4 +- p2p/test/resource-manager/rcmgr_test.go | 5 +- p2p/transport/quic/cmd/client/main.go | 5 +- p2p/transport/quic/cmd/server/main.go | 7 ++- p2p/transport/quic/conn.go | 8 +-- p2p/transport/quic/conn_test.go | 10 ++-- p2p/transport/quic/listener.go | 9 ++- p2p/transport/quic/listener_test.go | 6 +- .../quic/mock_connection_gater_test.go | 8 +-- p2p/transport/quic/stream.go | 2 +- p2p/transport/quic/transport.go | 13 ++-- p2p/transport/quic/transport_test.go | 9 ++- p2p/transport/tcp/tcp.go | 7 +-- p2p/transport/tcp/tcp_test.go | 16 +++-- p2p/transport/testsuite/stream_suite.go | 6 +- p2p/transport/testsuite/transport_suite.go | 4 +- p2p/transport/testsuite/utils_suite.go | 4 +- p2p/transport/websocket/websocket.go | 6 +- p2p/transport/websocket/websocket_test.go | 17 +++--- 297 files changed, 959 insertions(+), 1032 deletions(-) diff --git a/config/config.go b/config/config.go index 405d6d97..6561d852 100644 --- a/config/config.go +++ b/config/config.go @@ -5,18 +5,17 @@ import ( "fmt" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/metrics" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/pnet" - "github.com/libp2p/go-libp2p-core/routing" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/transport" - + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/metrics" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/pnet" + "github.com/libp2p/go-libp2p/core/routing" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/libp2p/go-libp2p/p2p/host/autorelay" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" diff --git a/config/constructor_types.go b/config/constructor_types.go index 631a44cd..7cb24464 100644 --- a/config/constructor_types.go +++ b/config/constructor_types.go @@ -4,15 +4,15 @@ import ( "fmt" "reflect" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/pnet" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/pnet" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/transport" ) var ( diff --git a/config/muxer.go b/config/muxer.go index 2b3e8570..651dea76 100644 --- a/config/muxer.go +++ b/config/muxer.go @@ -3,11 +3,9 @@ package config import ( "fmt" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" msmux "github.com/libp2p/go-libp2p/p2p/muxer/muxer-multistream" - - "github.com/libp2p/go-libp2p-core/network" - - "github.com/libp2p/go-libp2p-core/host" ) // MuxC is a stream multiplex transport constructor. diff --git a/config/muxer_test.go b/config/muxer_test.go index 4b00d64c..772b4329 100644 --- a/config/muxer_test.go +++ b/config/muxer_test.go @@ -3,13 +3,12 @@ package config import ( "testing" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" "github.com/libp2p/go-libp2p/p2p/muxer/yamux" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" ) func TestMuxerSimple(t *testing.T) { diff --git a/config/reflection_magic.go b/config/reflection_magic.go index b086f85e..407e5850 100644 --- a/config/reflection_magic.go +++ b/config/reflection_magic.go @@ -6,13 +6,11 @@ import ( "reflect" "runtime" - "github.com/libp2p/go-libp2p-core/network" - - "github.com/libp2p/go-libp2p-core/pnet" - - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/pnet" + "github.com/libp2p/go-libp2p/core/transport" ) var errorType = reflect.TypeOf((*error)(nil)).Elem() diff --git a/config/security.go b/config/security.go index bac3eb21..a98d761a 100644 --- a/config/security.go +++ b/config/security.go @@ -3,13 +3,12 @@ package config import ( "fmt" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/sec/insecure" csms "github.com/libp2p/go-libp2p/p2p/net/conn-security-multistream" - - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/sec/insecure" ) // SecC is a security transport constructor. diff --git a/config/transport.go b/config/transport.go index c1a5f4ef..9006683a 100644 --- a/config/transport.go +++ b/config/transport.go @@ -1,11 +1,11 @@ package config import ( - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/pnet" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/pnet" + "github.com/libp2p/go-libp2p/core/transport" ) // TptC is the type for libp2p transport constructors. You probably won't ever diff --git a/config/transport_test.go b/config/transport_test.go index 9cb5c9a3..1af9c169 100644 --- a/config/transport_test.go +++ b/config/transport_test.go @@ -3,11 +3,10 @@ package config import ( "testing" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/transport/tcp" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - "github.com/stretchr/testify/require" ) diff --git a/core/alias.go b/core/alias.go index b19f21a8..515083bb 100644 --- a/core/alias.go +++ b/core/alias.go @@ -2,10 +2,11 @@ package core import ( - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/multiformats/go-multiaddr" ) diff --git a/core/canonicallog/canonicallog.go b/core/canonicallog/canonicallog.go index 2bc07b1e..3e021ef2 100644 --- a/core/canonicallog/canonicallog.go +++ b/core/canonicallog/canonicallog.go @@ -6,8 +6,9 @@ import ( "net" "strings" + "github.com/libp2p/go-libp2p/core/peer" + logging "github.com/ipfs/go-log/v2" - "github.com/libp2p/go-libp2p-core/peer" "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/core/canonicallog/canonicallog_test.go b/core/canonicallog/canonicallog_test.go index 01b7dda9..fc03a6a3 100644 --- a/core/canonicallog/canonicallog_test.go +++ b/core/canonicallog/canonicallog_test.go @@ -5,8 +5,9 @@ import ( "net" "testing" + "github.com/libp2p/go-libp2p/core/test" + logging "github.com/ipfs/go-log/v2" - "github.com/libp2p/go-libp2p-core/test" "github.com/multiformats/go-multiaddr" ) diff --git a/core/connmgr/decay.go b/core/connmgr/decay.go index 2ff135a8..783a06c3 100644 --- a/core/connmgr/decay.go +++ b/core/connmgr/decay.go @@ -4,7 +4,7 @@ import ( "io" "time" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) // Decayer is implemented by connection managers supporting decaying tags. A @@ -22,10 +22,10 @@ import ( // Such a pluggable design affords a great deal of flexibility and versatility. // Behaviours that are straightforward to implement include: // -// * Decay a tag by -1, or by half its current value, on every tick. -// * Every time a value is bumped, sum it to its current value. -// * Exponentially boost a score with every bump. -// * Sum the incoming score, but keep it within min, max bounds. +// - Decay a tag by -1, or by half its current value, on every tick. +// - Every time a value is bumped, sum it to its current value. +// - Exponentially boost a score with every bump. +// - Sum the incoming score, but keep it within min, max bounds. // // Commonly used DecayFns and BumpFns are provided in this package. type Decayer interface { diff --git a/core/connmgr/gater.go b/core/connmgr/gater.go index 5fc03c92..672aef95 100644 --- a/core/connmgr/gater.go +++ b/core/connmgr/gater.go @@ -3,9 +3,9 @@ package connmgr import ( ma "github.com/multiformats/go-multiaddr" - "github.com/libp2p/go-libp2p-core/control" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/control" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // ConnectionGater can be implemented by a type that supports active @@ -17,25 +17,25 @@ import ( // of a connection being established/upgraded. Specific functions will be called // throughout the process, to allow you to intercept the connection at that stage. // -// InterceptPeerDial is called on an imminent outbound peer dial request, prior -// to the addresses of that peer being available/resolved. Blocking connections -// at this stage is typical for blacklisting scenarios. +// InterceptPeerDial is called on an imminent outbound peer dial request, prior +// to the addresses of that peer being available/resolved. Blocking connections +// at this stage is typical for blacklisting scenarios. // -// InterceptAddrDial is called on an imminent outbound dial to a peer on a -// particular address. Blocking connections at this stage is typical for -// address filtering. +// InterceptAddrDial is called on an imminent outbound dial to a peer on a +// particular address. Blocking connections at this stage is typical for +// address filtering. // -// InterceptAccept is called as soon as a transport listener receives an -// inbound connection request, before any upgrade takes place. Transports who -// accept already secure and/or multiplexed connections (e.g. possibly QUIC) -// MUST call this method regardless, for correctness/consistency. +// InterceptAccept is called as soon as a transport listener receives an +// inbound connection request, before any upgrade takes place. Transports who +// accept already secure and/or multiplexed connections (e.g. possibly QUIC) +// MUST call this method regardless, for correctness/consistency. // -// InterceptSecured is called for both inbound and outbound connections, -// after a security handshake has taken place and we've authenticated the peer. +// InterceptSecured is called for both inbound and outbound connections, +// after a security handshake has taken place and we've authenticated the peer. // -// InterceptUpgraded is called for inbound and outbound connections, after -// libp2p has finished upgrading the connection entirely to a secure, -// multiplexed channel. +// InterceptUpgraded is called for inbound and outbound connections, after +// libp2p has finished upgrading the connection entirely to a secure, +// multiplexed channel. // // This interface can be used to implement *strict/active* connection management // policies, such as hard limiting of connections once a maximum count has been diff --git a/core/connmgr/manager.go b/core/connmgr/manager.go index 223dcdf5..e0d6c520 100644 --- a/core/connmgr/manager.go +++ b/core/connmgr/manager.go @@ -10,8 +10,8 @@ import ( "context" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // SupportsDecay evaluates if the provided ConnManager supports decay, and if diff --git a/core/connmgr/null.go b/core/connmgr/null.go index 6e00b087..25743f4e 100644 --- a/core/connmgr/null.go +++ b/core/connmgr/null.go @@ -3,8 +3,8 @@ package connmgr import ( "context" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // NullConnMgr is a ConnMgr that provides no functionality. diff --git a/core/crypto/ecdsa.go b/core/crypto/ecdsa.go index 5b824473..318dcac2 100644 --- a/core/crypto/ecdsa.go +++ b/core/crypto/ecdsa.go @@ -10,8 +10,8 @@ import ( "io" "math/big" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" - "github.com/libp2p/go-libp2p-core/internal/catch" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" + "github.com/libp2p/go-libp2p/core/internal/catch" "github.com/minio/sha256-simd" ) diff --git a/core/crypto/ed25519.go b/core/crypto/ed25519.go index 90713c23..7cd72efb 100644 --- a/core/crypto/ed25519.go +++ b/core/crypto/ed25519.go @@ -8,8 +8,8 @@ import ( "fmt" "io" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" - "github.com/libp2p/go-libp2p-core/internal/catch" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" + "github.com/libp2p/go-libp2p/core/internal/catch" ) // Ed25519PrivateKey is an ed25519 private key. diff --git a/core/crypto/ed25519_test.go b/core/crypto/ed25519_test.go index ec606f76..78a2fa88 100644 --- a/core/crypto/ed25519_test.go +++ b/core/crypto/ed25519_test.go @@ -5,7 +5,7 @@ import ( "crypto/rand" "testing" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" ) func TestBasicSignAndVerify(t *testing.T) { diff --git a/core/crypto/fixture_test.go b/core/crypto/fixture_test.go index c933e86f..aa4f51bc 100644 --- a/core/crypto/fixture_test.go +++ b/core/crypto/fixture_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/libp2p/go-libp2p-core/crypto" - crypto_pb "github.com/libp2p/go-libp2p-core/crypto/pb" + "github.com/libp2p/go-libp2p/core/crypto" + crypto_pb "github.com/libp2p/go-libp2p/core/crypto/pb" ) var message = []byte("Libp2p is the _best_!") diff --git a/core/crypto/key.go b/core/crypto/key.go index 1b7ac8ba..3d7b39a2 100644 --- a/core/crypto/key.go +++ b/core/crypto/key.go @@ -12,7 +12,7 @@ import ( "fmt" "io" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" "github.com/gogo/protobuf/proto" ) diff --git a/core/crypto/key_not_openssl.go b/core/crypto/key_not_openssl.go index 28792f8f..0f446c0f 100644 --- a/core/crypto/key_not_openssl.go +++ b/core/crypto/key_not_openssl.go @@ -9,10 +9,10 @@ import ( "crypto/ed25519" "crypto/rsa" - btcec "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2" ) -// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys +// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p/core/crypto keys func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { if priv == nil { return nil, nil, ErrNilPrivateKey @@ -40,7 +40,7 @@ func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { } } -// PrivKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) private keys +// PrivKeyToStdKey converts libp2p/go-libp2p/core/crypto private keys to standard library (and secp256k1) private keys func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { if priv == nil { return nil, ErrNilPrivateKey @@ -60,7 +60,7 @@ func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { } } -// PubKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) public keys +// PubKeyToStdKey converts libp2p/go-libp2p/core/crypto private keys to standard library (and secp256k1) public keys func PubKeyToStdKey(pub PubKey) (crypto.PublicKey, error) { if pub == nil { return nil, ErrNilPublicKey diff --git a/core/crypto/key_openssl.go b/core/crypto/key_openssl.go index 60f9ced2..b88ea5a7 100644 --- a/core/crypto/key_openssl.go +++ b/core/crypto/key_openssl.go @@ -10,13 +10,13 @@ import ( "crypto/rsa" "crypto/x509" - btcec "github.com/btcsuite/btcd/btcec/v2" - openssl "github.com/libp2p/go-openssl" + "github.com/libp2p/go-libp2p/core/internal/catch" - "github.com/libp2p/go-libp2p-core/internal/catch" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/libp2p/go-openssl" ) -// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys +// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p/core/crypto keys func KeyPairFromStdKey(priv crypto.PrivateKey) (_priv PrivKey, _pub PubKey, err error) { if priv == nil { return nil, nil, ErrNilPrivateKey @@ -50,7 +50,7 @@ func KeyPairFromStdKey(priv crypto.PrivateKey) (_priv PrivKey, _pub PubKey, err } } -// PrivKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) private keys +// PrivKeyToStdKey converts libp2p/go-libp2p/core/crypto private keys to standard library (and secp256k1) private keys func PrivKeyToStdKey(priv PrivKey) (_priv crypto.PrivateKey, err error) { if priv == nil { return nil, ErrNilPrivateKey @@ -74,7 +74,7 @@ func PrivKeyToStdKey(priv PrivKey) (_priv crypto.PrivateKey, err error) { } } -// PubKeyToStdKey converts libp2p/go-libp2p-core/crypto private keys to standard library (and secp256k1) public keys +// PubKeyToStdKey converts libp2p/go-libp2p/core/crypto private keys to standard library (and secp256k1) public keys func PubKeyToStdKey(pub PubKey) (key crypto.PublicKey, err error) { if pub == nil { return nil, ErrNilPublicKey diff --git a/core/crypto/key_test.go b/core/crypto/key_test.go index 8984848a..1d6e2bdb 100644 --- a/core/crypto/key_test.go +++ b/core/crypto/key_test.go @@ -13,11 +13,12 @@ import ( "reflect" "testing" - btcec "github.com/btcsuite/btcd/btcec/v2" + . "github.com/libp2p/go-libp2p/core/crypto" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" + "github.com/libp2p/go-libp2p/core/test" + + "github.com/btcsuite/btcd/btcec/v2" btcececdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" - . "github.com/libp2p/go-libp2p-core/crypto" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" - "github.com/libp2p/go-libp2p-core/test" "github.com/minio/sha256-simd" ) diff --git a/core/crypto/openssl_common.go b/core/crypto/openssl_common.go index 257bfada..d97eb08b 100644 --- a/core/crypto/openssl_common.go +++ b/core/crypto/openssl_common.go @@ -6,7 +6,7 @@ package crypto import ( "sync" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" "github.com/libp2p/go-openssl" ) diff --git a/core/crypto/pb/crypto.proto b/core/crypto/pb/crypto.proto index 182b0d48..44e50442 100644 --- a/core/crypto/pb/crypto.proto +++ b/core/crypto/pb/crypto.proto @@ -2,7 +2,7 @@ syntax = "proto2"; package crypto.pb; -option go_package = "github.com/libp2p/go-libp2p-core/crypto/pb"; +option go_package = "github.com/libp2p/go-libp2p/core/crypto/pb"; enum KeyType { RSA = 0; diff --git a/core/crypto/rsa_go.go b/core/crypto/rsa_go.go index b0df60d9..1324447d 100644 --- a/core/crypto/rsa_go.go +++ b/core/crypto/rsa_go.go @@ -11,8 +11,8 @@ import ( "errors" "io" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" - "github.com/libp2p/go-libp2p-core/internal/catch" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" + "github.com/libp2p/go-libp2p/core/internal/catch" "github.com/minio/sha256-simd" ) diff --git a/core/crypto/secp256k1.go b/core/crypto/secp256k1.go index d90b2324..fbae3096 100644 --- a/core/crypto/secp256k1.go +++ b/core/crypto/secp256k1.go @@ -4,8 +4,8 @@ import ( "fmt" "io" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" - "github.com/libp2p/go-libp2p-core/internal/catch" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" + "github.com/libp2p/go-libp2p/core/internal/catch" btcec "github.com/btcsuite/btcd/btcec/v2" btcececdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" diff --git a/core/discovery/discovery.go b/core/discovery/discovery.go index f463e0e8..feeb2c79 100644 --- a/core/discovery/discovery.go +++ b/core/discovery/discovery.go @@ -5,7 +5,7 @@ import ( "context" "time" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) // Advertiser is an interface for advertising services diff --git a/core/event/addrs.go b/core/event/addrs.go index 9419d219..67026d17 100644 --- a/core/event/addrs.go +++ b/core/event/addrs.go @@ -1,7 +1,8 @@ package event import ( - "github.com/libp2p/go-libp2p-core/record" + "github.com/libp2p/go-libp2p/core/record" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/core/event/doc.go b/core/event/doc.go index 3a070f3a..7ba4bd6f 100644 --- a/core/event/doc.go +++ b/core/event/doc.go @@ -2,10 +2,10 @@ // that libp2p subsystems may emit. // // Source code is arranged as follows: -// * doc.go: this file. -// * bus.go: abstractions for the event bus. -// * rest: event structs, sensibly categorised in files by entity, and following this naming convention: -// Evt[Entity (noun)][Event (verb past tense / gerund)] -// The past tense is used to convey that something happened, whereas the gerund form of the verb (-ing) -// expresses that a process is in progress. Examples: EvtConnEstablishing, EvtConnEstablished. +// - doc.go: this file. +// - bus.go: abstractions for the event bus. +// - rest: event structs, sensibly categorised in files by entity, and following this naming convention: +// Evt[Entity (noun)][Event (verb past tense / gerund)] +// The past tense is used to convey that something happened, whereas the gerund form of the verb (-ing) +// expresses that a process is in progress. Examples: EvtConnEstablishing, EvtConnEstablished. package event diff --git a/core/event/identify.go b/core/event/identify.go index 7c4d1895..ff149958 100644 --- a/core/event/identify.go +++ b/core/event/identify.go @@ -1,6 +1,6 @@ package event -import "github.com/libp2p/go-libp2p-core/peer" +import "github.com/libp2p/go-libp2p/core/peer" // EvtPeerIdentificationCompleted is emitted when the initial identification round for a peer is completed. type EvtPeerIdentificationCompleted struct { diff --git a/core/event/nattype.go b/core/event/nattype.go index a24eb1a1..21ecdebd 100644 --- a/core/event/nattype.go +++ b/core/event/nattype.go @@ -1,6 +1,6 @@ package event -import "github.com/libp2p/go-libp2p-core/network" +import "github.com/libp2p/go-libp2p/core/network" // EvtNATDeviceTypeChanged is an event struct to be emitted when the type of the NAT device changes for a Transport Protocol. // diff --git a/core/event/network.go b/core/event/network.go index 15f9f6c8..37e9177d 100644 --- a/core/event/network.go +++ b/core/event/network.go @@ -1,48 +1,48 @@ package event import ( - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // EvtPeerConnectednessChanged should be emitted every time the "connectedness" to a // given peer changes. Specifically, this event is emitted in the following // cases: // -// * Connectedness = Connected: Every time we transition from having no -// connections to a peer to having at least one connection to the peer. -// * Connectedness = NotConnected: Every time we transition from having at least -// one connection to a peer to having no connections to the peer. +// - Connectedness = Connected: Every time we transition from having no +// connections to a peer to having at least one connection to the peer. +// - Connectedness = NotConnected: Every time we transition from having at least +// one connection to a peer to having no connections to the peer. // // Additional connectedness states may be added in the future. This list should // not be considered exhaustive. // // Take note: // -// * It's possible to have _multiple_ connections to a given peer. -// * Both libp2p and networks are asynchronous. +// - It's possible to have _multiple_ connections to a given peer. +// - Both libp2p and networks are asynchronous. // // This means that all of the following situations are possible: // // A connection is cut and is re-established: // -// * Peer A observes a transition from Connected -> NotConnected -> Connected -// * Peer B observes a transition from Connected -> NotConnected -> Connected +// - Peer A observes a transition from Connected -> NotConnected -> Connected +// - Peer B observes a transition from Connected -> NotConnected -> Connected // // Explanation: Both peers observe the connection die. This is the "nice" case. // // A connection is cut and is re-established. // -// * Peer A observes a transition from Connected -> NotConnected -> Connected. -// * Peer B observes no transition. +// - Peer A observes a transition from Connected -> NotConnected -> Connected. +// - Peer B observes no transition. // // Explanation: Peer A re-establishes the dead connection. Peer B observes the // new connection form before it observes the old connection die. // // A connection is cut: // -// * Peer A observes no transition. -// * Peer B observes no transition. +// - Peer A observes no transition. +// - Peer B observes no transition. // // Explanation: There were two connections and one was cut. This connection // might have been in active use but neither peer will observe a change in diff --git a/core/event/protocol.go b/core/event/protocol.go index 87b4312d..b8f1fe63 100644 --- a/core/event/protocol.go +++ b/core/event/protocol.go @@ -1,8 +1,8 @@ package event import ( - peer "github.com/libp2p/go-libp2p-core/peer" - protocol "github.com/libp2p/go-libp2p-core/protocol" + peer "github.com/libp2p/go-libp2p/core/peer" + protocol "github.com/libp2p/go-libp2p/core/protocol" ) // EvtPeerProtocolsUpdated should be emitted when a peer we're connected to adds or removes protocols from their stack. diff --git a/core/event/reachability.go b/core/event/reachability.go index 6bd7db49..6ab45238 100644 --- a/core/event/reachability.go +++ b/core/event/reachability.go @@ -1,7 +1,7 @@ package event import ( - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) // EvtLocalReachabilityChanged is an event struct to be emitted when the local's diff --git a/core/host/helpers.go b/core/host/helpers.go index a24beb1b..e57f326a 100644 --- a/core/host/helpers.go +++ b/core/host/helpers.go @@ -1,6 +1,6 @@ package host -import "github.com/libp2p/go-libp2p-core/peer" +import "github.com/libp2p/go-libp2p/core/peer" // InfoFromHost returns a peer.AddrInfo struct with the Host's ID and all of its Addrs. func InfoFromHost(h Host) *peer.AddrInfo { diff --git a/core/host/host.go b/core/host/host.go index 8712e68b..cfea91e5 100644 --- a/core/host/host.go +++ b/core/host/host.go @@ -6,13 +6,13 @@ package host import ( "context" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/introspection" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/introspection" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" ma "github.com/multiformats/go-multiaddr" ) diff --git a/core/introspection/introspector.go b/core/introspection/introspector.go index d3bd583f..e39f9673 100644 --- a/core/introspection/introspector.go +++ b/core/introspection/introspector.go @@ -3,7 +3,7 @@ package introspection import ( "io" - "github.com/libp2p/go-libp2p-core/introspection/pb" + "github.com/libp2p/go-libp2p/core/introspection/pb" ) // Introspector is the interface to be satisfied by components that are capable diff --git a/core/introspection/pb/introspection.pb.go b/core/introspection/pb/introspection.pb.go index 6af5361d..b8c609d8 100644 --- a/core/introspection/pb/introspection.pb.go +++ b/core/introspection/pb/introspection.pb.go @@ -397,11 +397,12 @@ func (m *ResultCounter) GetErr() uint32 { // // time past -> present an event 16 min ago // ======================================================X================>> -// | | 1m -// | |---| 5m -// | |-------------| 15m -// |------------X---------------| 30m -// |------------------------------------------X---------------| 60m +// +// | | 1m +// | |---| 5m +// | |-------------| 15m +// |------------X---------------| 30m +// |------------------------------------------X---------------| 60m type SlidingCounter struct { Over_1M uint32 `protobuf:"varint,1,opt,name=over_1m,json=over1m,proto3" json:"over_1m,omitempty"` Over_5M uint32 `protobuf:"varint,2,opt,name=over_5m,json=over5m,proto3" json:"over_5m,omitempty"` diff --git a/core/metrics/bandwidth.go b/core/metrics/bandwidth.go index 399d1fb4..3532bf5e 100644 --- a/core/metrics/bandwidth.go +++ b/core/metrics/bandwidth.go @@ -6,8 +6,8 @@ import ( "github.com/libp2p/go-flow-metrics" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" ) // BandwidthCounter tracks incoming and outgoing data transferred by the local peer. diff --git a/core/metrics/bandwidth_test.go b/core/metrics/bandwidth_test.go index e0bd8d98..84c507ec 100644 --- a/core/metrics/bandwidth_test.go +++ b/core/metrics/bandwidth_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" "github.com/libp2p/go-flow-metrics" diff --git a/core/metrics/reporter.go b/core/metrics/reporter.go index 860345d6..466dff9d 100644 --- a/core/metrics/reporter.go +++ b/core/metrics/reporter.go @@ -2,8 +2,8 @@ package metrics import ( - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" ) // Stats represents a point-in-time snapshot of bandwidth metrics. diff --git a/core/network/conn.go b/core/network/conn.go index b131bcc7..8554493e 100644 --- a/core/network/conn.go +++ b/core/network/conn.go @@ -4,8 +4,8 @@ import ( "context" "io" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) @@ -13,7 +13,8 @@ import ( // Conn is a connection to a remote peer. It multiplexes streams. // Usually there is no need to use a Conn directly, but it may // be useful to get information about the peer on the other side: -// stream.Conn().RemotePeer() +// +// stream.Conn().RemotePeer() type Conn interface { io.Closer diff --git a/core/network/network.go b/core/network/network.go index 7d5373f3..bf96697d 100644 --- a/core/network/network.go +++ b/core/network/network.go @@ -10,8 +10,8 @@ import ( "io" "time" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" ma "github.com/multiformats/go-multiaddr" ) diff --git a/core/network/rcmgr.go b/core/network/rcmgr.go index 5350d47c..b6092575 100644 --- a/core/network/rcmgr.go +++ b/core/network/rcmgr.go @@ -1,8 +1,8 @@ package network import ( - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" "github.com/multiformats/go-multiaddr" ) @@ -15,16 +15,17 @@ import ( // Management Scopes, whereby resource usage is constrained by a DAG of scopes, // The following diagram illustrates the structure of the resource constraint DAG: // System -// +------------> Transient.............+................+ -// | . . -// +------------> Service------------- . ----------+ . -// | . | . -// +-------------> Protocol----------- . ----------+ . -// | . | . -// +--------------> Peer \ | . -// +------------> Connection | . -// | \ \ -// +---------------------------> Stream +// +// +------------> Transient.............+................+ +// | . . +// +------------> Service------------- . ----------+ . +// | . | . +// +-------------> Protocol----------- . ----------+ . +// | . | . +// +--------------> Peer \ | . +// +------------> Connection | . +// | \ \ +// +---------------------------> Stream // // The basic resources accounted by the ResourceManager include memory, streams, connections, // and file descriptors. These account for both space and time used by @@ -59,16 +60,16 @@ import ( // scopes can form trees, with nested spans. // // Typical Usage: -// - Low level components of the system (transports, muxers) all have access to the resource -// manager and create connection and stream scopes through it. These scopes are accessible -// to the user, albeit with a narrower interface, through Conn and Stream objects who have -// a Scope method. -// - Services typically center around streams, where the programmer can attach streams to a -// particular service. They can also directly reserve memory for a service by accessing the -// service scope using the ResourceManager interface. -// - Applications that want to account for their network resource usage can reserve memory, -// typically using a span, directly in the System or a Service scope; they can also -// opt to use appropriate steam scopes for streams that they create or own. +// - Low level components of the system (transports, muxers) all have access to the resource +// manager and create connection and stream scopes through it. These scopes are accessible +// to the user, albeit with a narrower interface, through Conn and Stream objects who have +// a Scope method. +// - Services typically center around streams, where the programmer can attach streams to a +// particular service. They can also directly reserve memory for a service by accessing the +// service scope using the ResourceManager interface. +// - Applications that want to account for their network resource usage can reserve memory, +// typically using a span, directly in the System or a Service scope; they can also +// opt to use appropriate steam scopes for streams that they create or own. // // User Serviceable Parts: the user has the option to specify their own implementation of the // interface. We provide a canonical implementation in the go-libp2p-resource-manager package. @@ -76,7 +77,8 @@ import ( // or dynamic. // // WARNING The ResourceManager interface is considered experimental and subject to change -// in subsequent releases. +// +// in subsequent releases. type ResourceManager interface { ResourceScopeViewer @@ -172,12 +174,13 @@ type ResourceScope interface { // when the programmer calls Done. // // Example: -// s, err := someScope.BeginSpan() -// if err != nil { ... } -// defer s.Done() // -// if err := s.ReserveMemory(...); err != nil { ... } -// // ... use memory +// s, err := someScope.BeginSpan() +// if err != nil { ... } +// defer s.Done() +// +// if err := s.ReserveMemory(...); err != nil { ... } +// // ... use memory type ResourceScopeSpan interface { ResourceScope // Done ends the span and releases associated resources. diff --git a/core/network/stream.go b/core/network/stream.go index d1f928bf..62e23003 100644 --- a/core/network/stream.go +++ b/core/network/stream.go @@ -1,7 +1,7 @@ package network import ( - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/protocol" ) // Stream represents a bidirectional channel between two agents in diff --git a/core/peer/addrinfo_serde.go b/core/peer/addrinfo_serde.go index eae253d1..a848ea6c 100644 --- a/core/peer/addrinfo_serde.go +++ b/core/peer/addrinfo_serde.go @@ -3,7 +3,8 @@ package peer import ( "encoding/json" - "github.com/libp2p/go-libp2p-core/internal/catch" + "github.com/libp2p/go-libp2p/core/internal/catch" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/core/peer/addrinfo_test.go b/core/peer/addrinfo_test.go index 86fe87ff..9f18a8b6 100644 --- a/core/peer/addrinfo_test.go +++ b/core/peer/addrinfo_test.go @@ -5,7 +5,7 @@ import ( ma "github.com/multiformats/go-multiaddr" - . "github.com/libp2p/go-libp2p-core/peer" + . "github.com/libp2p/go-libp2p/core/peer" ) var ( diff --git a/core/peer/pb/peer_record.pb.go b/core/peer/pb/peer_record.pb.go index dd0755ef..36040c3c 100644 --- a/core/peer/pb/peer_record.pb.go +++ b/core/peer/pb/peer_record.pb.go @@ -5,10 +5,11 @@ package peer_pb import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. @@ -28,7 +29,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // // PeerRecords are designed to be serialized to bytes and placed inside of // SignedEnvelopes before sharing with other peers. -// See https://github.com/libp2p/go-libp2p-core/record/pb/envelope.proto for +// See https://github.com/libp2p/go-libp2p/core/record/pb/envelope.proto for // the SignedEnvelope definition. type PeerRecord struct { // peer_id contains a libp2p peer id in its binary representation. diff --git a/core/peer/pb/peer_record.proto b/core/peer/pb/peer_record.proto index fb2835d8..55dd43a2 100644 --- a/core/peer/pb/peer_record.proto +++ b/core/peer/pb/peer_record.proto @@ -8,7 +8,7 @@ package peer.pb; // // PeerRecords are designed to be serialized to bytes and placed inside of // SignedEnvelopes before sharing with other peers. -// See https://github.com/libp2p/go-libp2p-core/record/pb/envelope.proto for +// See https://github.com/libp2p/go-libp2p/core/record/pb/envelope.proto for // the SignedEnvelope definition. message PeerRecord { diff --git a/core/peer/peer.go b/core/peer/peer.go index 885d8513..7bd4f8d2 100644 --- a/core/peer/peer.go +++ b/core/peer/peer.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/ipfs/go-cid" - ic "github.com/libp2p/go-libp2p-core/crypto" + ic "github.com/libp2p/go-libp2p/core/crypto" b58 "github.com/mr-tron/base58/base58" mc "github.com/multiformats/go-multicodec" mh "github.com/multiformats/go-multihash" diff --git a/core/peer/peer_serde_test.go b/core/peer/peer_serde_test.go index 8a52ba9a..c503d66b 100644 --- a/core/peer/peer_serde_test.go +++ b/core/peer/peer_serde_test.go @@ -3,8 +3,8 @@ package peer_test import ( "testing" - "github.com/libp2p/go-libp2p-core/peer" - . "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/peer" + . "github.com/libp2p/go-libp2p/core/test" ) func TestPeerSerdePB(t *testing.T) { diff --git a/core/peer/peer_test.go b/core/peer/peer_test.go index 0ae38e48..d7fa930b 100644 --- a/core/peer/peer_test.go +++ b/core/peer/peer_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" - ic "github.com/libp2p/go-libp2p-core/crypto" - . "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/test" + ic "github.com/libp2p/go-libp2p/core/crypto" + . "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/test" b58 "github.com/mr-tron/base58/base58" mh "github.com/multiformats/go-multihash" diff --git a/core/peer/record.go b/core/peer/record.go index aae1d76a..9f8861af 100644 --- a/core/peer/record.go +++ b/core/peer/record.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/internal/catch" - pb "github.com/libp2p/go-libp2p-core/peer/pb" - "github.com/libp2p/go-libp2p-core/record" + "github.com/libp2p/go-libp2p/core/internal/catch" + pb "github.com/libp2p/go-libp2p/core/peer/pb" + "github.com/libp2p/go-libp2p/core/record" ma "github.com/multiformats/go-multiaddr" @@ -40,14 +40,14 @@ var PeerRecordEnvelopePayloadType = []byte{0x03, 0x01} // a PeerRecord with a timestamp-based Seq value. The other PeerRecord fields should // be set by the caller: // -// rec := peer.NewPeerRecord() -// rec.PeerID = aPeerID -// rec.Addrs = someAddrs +// rec := peer.NewPeerRecord() +// rec.PeerID = aPeerID +// rec.Addrs = someAddrs // // Alternatively, you can construct a PeerRecord struct directly and use the TimestampSeq // helper to set the Seq field: // -// rec := peer.PeerRecord{PeerID: aPeerID, Addrs: someAddrs, Seq: peer.TimestampSeq()} +// rec := peer.PeerRecord{PeerID: aPeerID, Addrs: someAddrs, Seq: peer.TimestampSeq()} // // Failing to set the Seq field will not result in an error, however, a PeerRecord with a // Seq value of zero may be ignored or rejected by other peers. @@ -59,28 +59,27 @@ var PeerRecordEnvelopePayloadType = []byte{0x03, 0x01} // To share a PeerRecord, first call Sign to wrap the record in a Envelope // and sign it with the local peer's private key: // -// rec := &PeerRecord{PeerID: myPeerId, Addrs: myAddrs} -// envelope, err := rec.Sign(myPrivateKey) +// rec := &PeerRecord{PeerID: myPeerId, Addrs: myAddrs} +// envelope, err := rec.Sign(myPrivateKey) // // The resulting record.Envelope can be marshalled to a []byte and shared // publicly. As a convenience, the MarshalSigned method will produce the // Envelope and marshal it to a []byte in one go: // -// rec := &PeerRecord{PeerID: myPeerId, Addrs: myAddrs} -// recordBytes, err := rec.MarshalSigned(myPrivateKey) +// rec := &PeerRecord{PeerID: myPeerId, Addrs: myAddrs} +// recordBytes, err := rec.MarshalSigned(myPrivateKey) // // To validate and unmarshal a signed PeerRecord from a remote peer, // "consume" the containing envelope, which will return both the // routing.Envelope and the inner Record. The Record must be cast to // a PeerRecord pointer before use: // -// envelope, untypedRecord, err := ConsumeEnvelope(envelopeBytes, PeerRecordEnvelopeDomain) -// if err != nil { -// handleError(err) -// return -// } -// peerRec := untypedRecord.(*PeerRecord) -// +// envelope, untypedRecord, err := ConsumeEnvelope(envelopeBytes, PeerRecordEnvelopeDomain) +// if err != nil { +// handleError(err) +// return +// } +// peerRec := untypedRecord.(*PeerRecord) type PeerRecord struct { // PeerID is the ID of the peer this record pertains to. PeerID ID diff --git a/core/peer/record_test.go b/core/peer/record_test.go index 4022d929..4ac8ffba 100644 --- a/core/peer/record_test.go +++ b/core/peer/record_test.go @@ -4,10 +4,10 @@ import ( "bytes" "testing" - "github.com/libp2p/go-libp2p-core/crypto" - . "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/crypto" + . "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/record" + "github.com/libp2p/go-libp2p/core/test" ) func TestPeerRecordConstants(t *testing.T) { diff --git a/core/peerstore/helpers.go b/core/peerstore/helpers.go index e41cf781..92e522d5 100644 --- a/core/peerstore/helpers.go +++ b/core/peerstore/helpers.go @@ -1,7 +1,7 @@ package peerstore import ( - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) // AddrInfos returns an AddrInfo for each specified peer ID, in-order. diff --git a/core/peerstore/peerstore.go b/core/peerstore/peerstore.go index f93d8fb5..213513bc 100644 --- a/core/peerstore/peerstore.go +++ b/core/peerstore/peerstore.go @@ -9,9 +9,9 @@ import ( "math" "time" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/record" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/record" ma "github.com/multiformats/go-multiaddr" ) @@ -142,10 +142,9 @@ type AddrBook interface { // certified addresses, callers should use the GetCertifiedAddrBook helper or // type-assert on the CertifiedAddrBook interface: // -// if cab, ok := aPeerstore.(CertifiedAddrBook); ok { -// cab.ConsumePeerRecord(signedPeerRecord, aTTL) -// } -// +// if cab, ok := aPeerstore.(CertifiedAddrBook); ok { +// cab.ConsumePeerRecord(signedPeerRecord, aTTL) +// } type CertifiedAddrBook interface { // ConsumePeerRecord adds addresses from a signed peer.PeerRecord (contained in // a record.Envelope), which will expire after the given TTL. diff --git a/core/record/envelope.go b/core/record/envelope.go index df1eee7a..38811994 100644 --- a/core/record/envelope.go +++ b/core/record/envelope.go @@ -6,9 +6,9 @@ import ( "fmt" "sync" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/internal/catch" - pb "github.com/libp2p/go-libp2p-core/record/pb" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/internal/catch" + pb "github.com/libp2p/go-libp2p/core/record/pb" pool "github.com/libp2p/go-buffer-pool" @@ -94,15 +94,15 @@ func Seal(rec Record, privateKey crypto.PrivKey) (*Envelope, error) { // You can type assert on the returned Record to convert it to an instance of the concrete // Record type: // -// envelope, rec, err := ConsumeEnvelope(envelopeBytes, peer.PeerRecordEnvelopeDomain) -// if err != nil { -// handleError(envelope, err) // envelope may be non-nil, even if errors occur! -// return -// } -// peerRec, ok := rec.(*peer.PeerRecord) -// if ok { -// doSomethingWithPeerRecord(peerRec) -// } +// envelope, rec, err := ConsumeEnvelope(envelopeBytes, peer.PeerRecordEnvelopeDomain) +// if err != nil { +// handleError(envelope, err) // envelope may be non-nil, even if errors occur! +// return +// } +// peerRec, ok := rec.(*peer.PeerRecord) +// if ok { +// doSomethingWithPeerRecord(peerRec) +// } // // Important: you MUST check the error value before using the returned Envelope. In some error // cases, including when the envelope signature is invalid, both the Envelope and an error will @@ -140,12 +140,12 @@ func ConsumeEnvelope(data []byte, domain string) (envelope *Envelope, rec Record // responsibility to determine whether the given Record type is able to unmarshal the payload // correctly. // -// rec := &MyRecordType{} -// envelope, err := ConsumeTypedEnvelope(envelopeBytes, rec) -// if err != nil { -// handleError(envelope, err) -// } -// doSomethingWithRecord(rec) +// rec := &MyRecordType{} +// envelope, err := ConsumeTypedEnvelope(envelopeBytes, rec) +// if err != nil { +// handleError(envelope, err) +// } +// doSomethingWithRecord(rec) // // Important: you MUST check the error value before using the returned Envelope. In some error // cases, including when the envelope signature is invalid, both the Envelope and an error will diff --git a/core/record/envelope_test.go b/core/record/envelope_test.go index 40c50d61..45ac0e66 100644 --- a/core/record/envelope_test.go +++ b/core/record/envelope_test.go @@ -5,10 +5,10 @@ import ( "errors" "testing" - crypto "github.com/libp2p/go-libp2p-core/crypto" - . "github.com/libp2p/go-libp2p-core/record" - pb "github.com/libp2p/go-libp2p-core/record/pb" - "github.com/libp2p/go-libp2p-core/test" + crypto "github.com/libp2p/go-libp2p/core/crypto" + . "github.com/libp2p/go-libp2p/core/record" + pb "github.com/libp2p/go-libp2p/core/record/pb" + "github.com/libp2p/go-libp2p/core/test" "github.com/gogo/protobuf/proto" ) diff --git a/core/record/pb/envelope.pb.go b/core/record/pb/envelope.pb.go index 412809f1..a9990217 100644 --- a/core/record/pb/envelope.pb.go +++ b/core/record/pb/envelope.pb.go @@ -5,11 +5,12 @@ package record_pb import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" io "io" math "math" math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/core/record/record.go b/core/record/record.go index af30a47e..704227f2 100644 --- a/core/record/record.go +++ b/core/record/record.go @@ -4,7 +4,7 @@ import ( "errors" "reflect" - "github.com/libp2p/go-libp2p-core/internal/catch" + "github.com/libp2p/go-libp2p/core/internal/catch" ) var ( @@ -59,15 +59,14 @@ type Record interface { // a pointer type. Registration should be done in the init function of the package // where the Record type is defined: // -// package hello_record -// import record "github.com/libp2p/go-libp2p-core/record" +// package hello_record +// import record "github.com/libp2p/go-libp2p/core/record" // -// func init() { -// record.RegisterType(&HelloRecord{}) -// } -// -// type HelloRecord struct { } // etc.. +// func init() { +// record.RegisterType(&HelloRecord{}) +// } // +// type HelloRecord struct { } // etc.. func RegisterType(prototype Record) { payloadTypeRegistry[string(prototype.Codec())] = getValueType(prototype) } diff --git a/core/routing/query.go b/core/routing/query.go index 26743af0..72791b52 100644 --- a/core/routing/query.go +++ b/core/routing/query.go @@ -4,7 +4,7 @@ import ( "context" "sync" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) // QueryEventType indicates the query event's type. diff --git a/core/routing/query_serde.go b/core/routing/query_serde.go index c33f02d2..6b566e0c 100644 --- a/core/routing/query_serde.go +++ b/core/routing/query_serde.go @@ -3,7 +3,7 @@ package routing import ( "encoding/json" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) func (qe *QueryEvent) MarshalJSON() ([]byte, error) { diff --git a/core/routing/routing.go b/core/routing/routing.go index 807f968e..07437b5d 100644 --- a/core/routing/routing.go +++ b/core/routing/routing.go @@ -5,8 +5,8 @@ import ( "context" "errors" - ci "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" + ci "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" cid "github.com/ipfs/go-cid" ) diff --git a/core/sec/insecure/insecure.go b/core/sec/insecure/insecure.go index 1fd52457..12bd1842 100644 --- a/core/sec/insecure/insecure.go +++ b/core/sec/insecure/insecure.go @@ -9,12 +9,12 @@ import ( "io" "net" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-msgio" + ci "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + pb "github.com/libp2p/go-libp2p/core/sec/insecure/pb" - ci "github.com/libp2p/go-libp2p-core/crypto" - pb "github.com/libp2p/go-libp2p-core/sec/insecure/pb" + "github.com/libp2p/go-msgio" ) // ID is the multistream-select protocol ID that should be used when identifying diff --git a/core/sec/insecure/insecure_test.go b/core/sec/insecure/insecure_test.go index 433df841..a3ce8314 100644 --- a/core/sec/insecure/insecure_test.go +++ b/core/sec/insecure/insecure_test.go @@ -6,11 +6,11 @@ import ( "net" "testing" - "github.com/stretchr/testify/require" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/stretchr/testify/require" ) // Run a set of sessions through the session setup and verification. diff --git a/core/sec/insecure/pb/plaintext.pb.go b/core/sec/insecure/pb/plaintext.pb.go index 4c5af183..cd8719d1 100644 --- a/core/sec/insecure/pb/plaintext.pb.go +++ b/core/sec/insecure/pb/plaintext.pb.go @@ -5,11 +5,12 @@ package plaintext_pb import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" - pb "github.com/libp2p/go-libp2p-core/crypto/pb" io "io" math "math" math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" + pb "github.com/libp2p/go-libp2p/core/crypto/pb" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/core/sec/insecure/pb/plaintext.proto b/core/sec/insecure/pb/plaintext.proto index 1e299df5..0e792b3c 100644 --- a/core/sec/insecure/pb/plaintext.proto +++ b/core/sec/insecure/pb/plaintext.proto @@ -2,7 +2,7 @@ syntax = "proto2"; package plaintext.pb; -import "github.com/libp2p/go-libp2p-core/crypto/pb/crypto.proto"; +import "github.com/libp2p/go-libp2p/core/crypto/pb/crypto.proto"; message Exchange { optional bytes id = 1; diff --git a/core/sec/security.go b/core/sec/security.go index a4cd7a2e..c192a56a 100644 --- a/core/sec/security.go +++ b/core/sec/security.go @@ -5,8 +5,8 @@ import ( "context" "net" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // SecureConn is an authenticated, encrypted connection. diff --git a/core/test/crypto.go b/core/test/crypto.go index 8733cf92..5032485b 100644 --- a/core/test/crypto.go +++ b/core/test/crypto.go @@ -4,7 +4,7 @@ import ( "math/rand" "sync/atomic" - ci "github.com/libp2p/go-libp2p-core/crypto" + ci "github.com/libp2p/go-libp2p/core/crypto" ) var globalSeed int64 diff --git a/core/test/peer.go b/core/test/peer.go index b95639fe..11998ff8 100644 --- a/core/test/peer.go +++ b/core/test/peer.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" mh "github.com/multiformats/go-multihash" ) diff --git a/core/transport/transport.go b/core/transport/transport.go index 91cb75a3..379e9d6d 100644 --- a/core/transport/transport.go +++ b/core/transport/transport.go @@ -6,8 +6,8 @@ import ( "context" "net" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/defaults.go b/defaults.go index 50985f34..ca706448 100644 --- a/defaults.go +++ b/defaults.go @@ -5,6 +5,7 @@ package libp2p import ( "crypto/rand" + "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager" "github.com/libp2p/go-libp2p/p2p/muxer/yamux" @@ -15,8 +16,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/transport/tcp" ws "github.com/libp2p/go-libp2p/p2p/transport/websocket" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/multiformats/go-multiaddr" ) diff --git a/go.mod b/go.mod index 3abfc038..1b6324bf 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( github.com/benbjohnson/clock v1.3.0 + github.com/btcsuite/btcd/btcec/v2 v2.2.0 github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c github.com/flynn/noise v1.0.0 github.com/gogo/protobuf v1.3.2 @@ -19,13 +20,14 @@ require ( github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/klauspost/compress v1.15.1 github.com/libp2p/go-buffer-pool v0.1.0 + github.com/libp2p/go-flow-metrics v0.1.0 github.com/libp2p/go-libp2p-asn-util v0.2.0 - github.com/libp2p/go-libp2p-core v0.19.1 github.com/libp2p/go-libp2p-testing v0.11.0 github.com/libp2p/go-mplex v0.7.0 github.com/libp2p/go-msgio v0.2.0 github.com/libp2p/go-nat v0.1.0 github.com/libp2p/go-netroute v0.2.0 + github.com/libp2p/go-openssl v0.0.7 github.com/libp2p/go-reuseport v0.2.0 github.com/libp2p/go-yamux/v3 v3.1.2 github.com/libp2p/zeroconf/v2 v2.1.1 @@ -33,10 +35,12 @@ require ( github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b github.com/minio/sha256-simd v1.0.0 + github.com/mr-tron/base58 v1.2.0 github.com/multiformats/go-base32 v0.0.4 github.com/multiformats/go-multiaddr v0.6.0 github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multiaddr-fmt v0.1.0 + github.com/multiformats/go-multicodec v0.5.0 github.com/multiformats/go-multihash v0.2.0 github.com/multiformats/go-multistream v0.3.3 github.com/multiformats/go-varint v0.0.6 @@ -54,7 +58,6 @@ require ( require ( github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cheekybits/genny v1.0.0 // indirect @@ -80,8 +83,7 @@ require ( github.com/klauspost/cpuid/v2 v2.0.14 // indirect github.com/koron/go-ssdp v0.0.3 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect - github.com/libp2p/go-flow-metrics v0.0.3 // indirect - github.com/libp2p/go-openssl v0.0.7 // indirect + github.com/libp2p/go-libp2p-core v0.19.1 // indirect github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect @@ -90,10 +92,8 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/miekg/dns v1.1.50 // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect - github.com/mr-tron/base58 v1.2.0 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-multibase v0.1.1 // indirect - github.com/multiformats/go-multicodec v0.5.0 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/opencontainers/runtime-spec v1.0.2 // indirect diff --git a/go.sum b/go.sum index 996b2313..bd5db6d8 100644 --- a/go.sum +++ b/go.sum @@ -299,8 +299,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= -github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= -github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= +github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= +github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p-asn-util v0.2.0 h1:rg3+Os8jbnO5DxkC7K/Utdi+DkY3q/d1/1q+8WeNAsw= github.com/libp2p/go-libp2p-asn-util v0.2.0/go.mod h1:WoaWxbHKBymSN41hWSq/lGKJEca7TNm58+gGJi2WsLI= github.com/libp2p/go-libp2p-core v0.19.1 h1:zaZQQCeCrFMtxFa1wHy6AhsVynyNmZAvwgWqSSPT3WE= diff --git a/libp2p.go b/libp2p.go index 7fdd3b71..d77c3b9b 100644 --- a/libp2p.go +++ b/libp2p.go @@ -2,8 +2,7 @@ package libp2p import ( "github.com/libp2p/go-libp2p/config" - - "github.com/libp2p/go-libp2p-core/host" + "github.com/libp2p/go-libp2p/core/host" ) // Config describes a set of settings for a libp2p node. diff --git a/libp2p_test.go b/libp2p_test.go index 92be78c1..992b0839 100644 --- a/libp2p_test.go +++ b/libp2p_test.go @@ -7,14 +7,13 @@ import ( "strings" "testing" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/transport/tcp" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - "github.com/stretchr/testify/require" ) diff --git a/limits.go b/limits.go index 94eea3b1..cf81fa76 100644 --- a/limits.go +++ b/limits.go @@ -1,8 +1,7 @@ package libp2p import ( - "github.com/libp2p/go-libp2p-core/protocol" - + "github.com/libp2p/go-libp2p/core/protocol" "github.com/libp2p/go-libp2p/p2p/host/autonat" rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager" relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay" diff --git a/options.go b/options.go index a10f3a6c..6ed6a94d 100644 --- a/options.go +++ b/options.go @@ -8,15 +8,14 @@ import ( "fmt" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/metrics" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/pnet" - "github.com/libp2p/go-libp2p/config" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/metrics" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/pnet" "github.com/libp2p/go-libp2p/p2p/host/autorelay" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay" @@ -330,7 +329,7 @@ func AutoNATServiceRateLimit(global, perPeer int, interval time.Duration) Option // to actively reject inbound/outbound connections based on the lifecycle stage // of the connection. // -// For more information, refer to go-libp2p-core.ConnectionGater. +// For more information, refer to go-libp2p/core.ConnectionGater. func ConnectionGater(cg connmgr.ConnectionGater) Option { return func(cfg *Config) error { if cfg.ConnectionGater != nil { diff --git a/options_filter.go b/options_filter.go index c6b8175d..1f94ac3f 100644 --- a/options_filter.go +++ b/options_filter.go @@ -1,10 +1,10 @@ package libp2p import ( - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/control" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/control" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/discovery/backoff/backoffcache.go b/p2p/discovery/backoff/backoffcache.go index 9aacfdad..82c07241 100644 --- a/p2p/discovery/backoff/backoffcache.go +++ b/p2p/discovery/backoff/backoffcache.go @@ -6,8 +6,8 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/discovery" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/discovery" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/discovery/backoff/backoffcache_test.go b/p2p/discovery/backoff/backoffcache_test.go index 15b998af..fe528cca 100644 --- a/p2p/discovery/backoff/backoffcache_test.go +++ b/p2p/discovery/backoff/backoffcache_test.go @@ -10,8 +10,8 @@ import ( bhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/discovery" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/discovery" + "github.com/libp2p/go-libp2p/core/peer" mockClock "github.com/benbjohnson/clock" ) diff --git a/p2p/discovery/backoff/backoffconnector.go b/p2p/discovery/backoff/backoffconnector.go index 62ac4989..8a355a2d 100644 --- a/p2p/discovery/backoff/backoffconnector.go +++ b/p2p/discovery/backoff/backoffconnector.go @@ -5,10 +5,10 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" + lru "github.com/hashicorp/golang-lru" ) // BackoffConnector is a utility to connect to peers, but only if we have not recently tried connecting to them already diff --git a/p2p/discovery/backoff/backoffconnector_test.go b/p2p/discovery/backoff/backoffconnector_test.go index 6bf958f9..e95796c3 100644 --- a/p2p/discovery/backoff/backoffconnector_test.go +++ b/p2p/discovery/backoff/backoffconnector_test.go @@ -7,12 +7,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" bhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" ) diff --git a/p2p/discovery/mdns/mdns.go b/p2p/discovery/mdns/mdns.go index cbae29a2..637fcdcb 100644 --- a/p2p/discovery/mdns/mdns.go +++ b/p2p/discovery/mdns/mdns.go @@ -8,11 +8,12 @@ import ( "strings" "sync" - logging "github.com/ipfs/go-log/v2" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/zeroconf/v2" + logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/discovery/mdns/mdns_test.go b/p2p/discovery/mdns/mdns_test.go index 60a49cae..a2462790 100644 --- a/p2p/discovery/mdns/mdns_test.go +++ b/p2p/discovery/mdns/mdns_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/libp2p/go-libp2p" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/p2p/discovery/mocks/mocks.go b/p2p/discovery/mocks/mocks.go index 8b31ead0..be0c429d 100644 --- a/p2p/discovery/mocks/mocks.go +++ b/p2p/discovery/mocks/mocks.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/discovery" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/discovery" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" ) type clock interface { diff --git a/p2p/discovery/routing/routing.go b/p2p/discovery/routing/routing.go index ed010617..c312c32b 100644 --- a/p2p/discovery/routing/routing.go +++ b/p2p/discovery/routing/routing.go @@ -4,9 +4,9 @@ import ( "context" "time" - "github.com/libp2p/go-libp2p-core/discovery" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/routing" + "github.com/libp2p/go-libp2p/core/discovery" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/routing" "github.com/ipfs/go-cid" mh "github.com/multiformats/go-multihash" diff --git a/p2p/discovery/routing/routing_test.go b/p2p/discovery/routing/routing_test.go index d24a5818..ed8ab25d 100644 --- a/p2p/discovery/routing/routing_test.go +++ b/p2p/discovery/routing/routing_test.go @@ -13,9 +13,9 @@ import ( swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p-core/discovery" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/discovery" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" ) type mockRoutingTable struct { diff --git a/p2p/discovery/util/util.go b/p2p/discovery/util/util.go index ad10d242..74175261 100644 --- a/p2p/discovery/util/util.go +++ b/p2p/discovery/util/util.go @@ -4,8 +4,8 @@ import ( "context" "time" - "github.com/libp2p/go-libp2p-core/discovery" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/discovery" + "github.com/libp2p/go-libp2p/core/peer" logging "github.com/ipfs/go-log/v2" ) diff --git a/p2p/host/autonat/autonat.go b/p2p/host/autonat/autonat.go index 68b330a4..0fd8b0ec 100644 --- a/p2p/host/autonat/autonat.go +++ b/p2p/host/autonat/autonat.go @@ -7,13 +7,12 @@ import ( "sync/atomic" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/host/eventbus" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/host/autonat/autonat_test.go b/p2p/host/autonat/autonat_test.go index 693079a2..6c743650 100644 --- a/p2p/host/autonat/autonat_test.go +++ b/p2p/host/autonat/autonat_test.go @@ -5,15 +5,14 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" pb "github.com/libp2p/go-libp2p/p2p/host/autonat/pb" bhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-msgio/protoio" ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" diff --git a/p2p/host/autonat/client.go b/p2p/host/autonat/client.go index f4eb08ad..3edbeb50 100644 --- a/p2p/host/autonat/client.go +++ b/p2p/host/autonat/client.go @@ -5,13 +5,12 @@ import ( "fmt" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" pb "github.com/libp2p/go-libp2p/p2p/host/autonat/pb" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-msgio/protoio" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/autonat/dialpolicy.go b/p2p/host/autonat/dialpolicy.go index 653882cb..96152295 100644 --- a/p2p/host/autonat/dialpolicy.go +++ b/p2p/host/autonat/dialpolicy.go @@ -3,7 +3,8 @@ package autonat import ( "net" - "github.com/libp2p/go-libp2p-core/host" + "github.com/libp2p/go-libp2p/core/host" + ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/host/autonat/dialpolicy_test.go b/p2p/host/autonat/dialpolicy_test.go index afa047eb..75731ae9 100644 --- a/p2p/host/autonat/dialpolicy_test.go +++ b/p2p/host/autonat/dialpolicy_test.go @@ -6,12 +6,11 @@ import ( "net" "testing" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" blankhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/autonat/interface.go b/p2p/host/autonat/interface.go index 2551f2c5..f4c89bea 100644 --- a/p2p/host/autonat/interface.go +++ b/p2p/host/autonat/interface.go @@ -4,8 +4,8 @@ import ( "context" "io" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/autonat/notify.go b/p2p/host/autonat/notify.go index fb8e980a..a57bf156 100644 --- a/p2p/host/autonat/notify.go +++ b/p2p/host/autonat/notify.go @@ -1,7 +1,7 @@ package autonat import ( - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/host/autonat/options.go b/p2p/host/autonat/options.go index 39053313..0935dc23 100644 --- a/p2p/host/autonat/options.go +++ b/p2p/host/autonat/options.go @@ -4,8 +4,8 @@ import ( "errors" "time" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" ) // config holds configurable options for the autonat subsystem. diff --git a/p2p/host/autonat/proto.go b/p2p/host/autonat/proto.go index 69ac5871..93f273cd 100644 --- a/p2p/host/autonat/proto.go +++ b/p2p/host/autonat/proto.go @@ -1,10 +1,9 @@ package autonat import ( + "github.com/libp2p/go-libp2p/core/peer" pb "github.com/libp2p/go-libp2p/p2p/host/autonat/pb" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/autonat/svc.go b/p2p/host/autonat/svc.go index fc1fc3a8..10136a7d 100644 --- a/p2p/host/autonat/svc.go +++ b/p2p/host/autonat/svc.go @@ -7,12 +7,11 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" pb "github.com/libp2p/go-libp2p/p2p/host/autonat/pb" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-msgio/protoio" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/autonat/svc_test.go b/p2p/host/autonat/svc_test.go index d01230e3..e1d751f1 100644 --- a/p2p/host/autonat/svc_test.go +++ b/p2p/host/autonat/svc_test.go @@ -6,13 +6,12 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" bhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/host/autonat/test/autonat_test.go b/p2p/host/autonat/test/autonat_test.go index 46a592e7..5bc89393 100644 --- a/p2p/host/autonat/test/autonat_test.go +++ b/p2p/host/autonat/test/autonat_test.go @@ -7,10 +7,9 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/stretchr/testify/require" diff --git a/p2p/host/autorelay/autorelay.go b/p2p/host/autorelay/autorelay.go index cb06561d..e4e3568e 100644 --- a/p2p/host/autorelay/autorelay.go +++ b/p2p/host/autorelay/autorelay.go @@ -4,10 +4,9 @@ import ( "context" "sync" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" basic "github.com/libp2p/go-libp2p/p2p/host/basic" logging "github.com/ipfs/go-log/v2" diff --git a/p2p/host/autorelay/autorelay_test.go b/p2p/host/autorelay/autorelay_test.go index 3a5ed75e..cb4d7e88 100644 --- a/p2p/host/autorelay/autorelay_test.go +++ b/p2p/host/autorelay/autorelay_test.go @@ -7,14 +7,13 @@ import ( "time" "github.com/libp2p/go-libp2p" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/host/autorelay" relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay" circuitv2_proto "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/benbjohnson/clock" ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" diff --git a/p2p/host/autorelay/host.go b/p2p/host/autorelay/host.go index 9a90c9e6..740ca236 100644 --- a/p2p/host/autorelay/host.go +++ b/p2p/host/autorelay/host.go @@ -1,7 +1,7 @@ package autorelay import ( - "github.com/libp2p/go-libp2p-core/host" + "github.com/libp2p/go-libp2p/core/host" ) type AutoRelayHost struct { diff --git a/p2p/host/autorelay/options.go b/p2p/host/autorelay/options.go index 69de152a..e62f129d 100644 --- a/p2p/host/autorelay/options.go +++ b/p2p/host/autorelay/options.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" "github.com/benbjohnson/clock" ) diff --git a/p2p/host/autorelay/relay_finder.go b/p2p/host/autorelay/relay_finder.go index 2fa872d1..a62947d3 100644 --- a/p2p/host/autorelay/relay_finder.go +++ b/p2p/host/autorelay/relay_finder.go @@ -10,15 +10,14 @@ import ( "golang.org/x/sync/errgroup" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" basic "github.com/libp2p/go-libp2p/p2p/host/basic" relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay" circuitv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client" circuitv2_proto "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index 423cbe87..d3642bd8 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -9,6 +9,15 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/libp2p/go-libp2p/core/record" "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/libp2p/go-libp2p/p2p/host/eventbus" "github.com/libp2p/go-libp2p/p2p/host/pstoremanager" @@ -19,16 +28,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/protocol/identify" "github.com/libp2p/go-libp2p/p2p/protocol/ping" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-netroute" logging "github.com/ipfs/go-log/v2" diff --git a/p2p/host/basic/basic_host_test.go b/p2p/host/basic/basic_host_test.go index 8bc83b6f..02243c23 100644 --- a/p2p/host/basic/basic_host_test.go +++ b/p2p/host/basic/basic_host_test.go @@ -10,20 +10,19 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/libp2p/go-libp2p/core/record" + "github.com/libp2p/go-libp2p/core/test" "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/libp2p/go-libp2p/p2p/host/eventbus" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" "github.com/libp2p/go-libp2p/p2p/protocol/identify" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-libp2p-core/test" - ma "github.com/multiformats/go-multiaddr" madns "github.com/multiformats/go-multiaddr-dns" diff --git a/p2p/host/basic/natmgr.go b/p2p/host/basic/natmgr.go index ab4cef62..782c116d 100644 --- a/p2p/host/basic/natmgr.go +++ b/p2p/host/basic/natmgr.go @@ -8,10 +8,9 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/network" inat "github.com/libp2p/go-libp2p/p2p/net/nat" - "github.com/libp2p/go-libp2p-core/network" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/basic/peer_connectedness.go b/p2p/host/basic/peer_connectedness.go index 5460498c..bfc46ed8 100644 --- a/p2p/host/basic/peer_connectedness.go +++ b/p2p/host/basic/peer_connectedness.go @@ -3,9 +3,9 @@ package basichost import ( "sync" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/basic/peer_connectedness_test.go b/p2p/host/basic/peer_connectedness_test.go index fc8ecb60..f124b109 100644 --- a/p2p/host/basic/peer_connectedness_test.go +++ b/p2p/host/basic/peer_connectedness_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" ) diff --git a/p2p/host/blank/blank.go b/p2p/host/blank/blank.go index 08f1f2fa..16753eb0 100644 --- a/p2p/host/blank/blank.go +++ b/p2p/host/blank/blank.go @@ -6,17 +6,16 @@ import ( "fmt" "io" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/libp2p/go-libp2p/core/record" "github.com/libp2p/go-libp2p/p2p/host/eventbus" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-libp2p-core/record" - logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/host/blank/peer_connectedness.go b/p2p/host/blank/peer_connectedness.go index 670edc54..4f70540f 100644 --- a/p2p/host/blank/peer_connectedness.go +++ b/p2p/host/blank/peer_connectedness.go @@ -3,9 +3,9 @@ package blankhost import ( "sync" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/blank/peer_connectedness_test.go b/p2p/host/blank/peer_connectedness_test.go index cabf3fe1..260daa1e 100644 --- a/p2p/host/blank/peer_connectedness_test.go +++ b/p2p/host/blank/peer_connectedness_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" ) diff --git a/p2p/host/eventbus/basic.go b/p2p/host/eventbus/basic.go index 94685d56..6ab6c410 100644 --- a/p2p/host/eventbus/basic.go +++ b/p2p/host/eventbus/basic.go @@ -7,10 +7,10 @@ import ( "sync" "sync/atomic" - "github.com/libp2p/go-libp2p-core/event" + "github.com/libp2p/go-libp2p/core/event" ) -/////////////////////// +// ///////////////////// // BUS // basicBus is a type-based event delivery system @@ -273,7 +273,7 @@ func (b *basicBus) GetAllEventTypes() []reflect.Type { return types } -/////////////////////// +// ///////////////////// // NODE type wildcardNode struct { diff --git a/p2p/host/eventbus/basic_test.go b/p2p/host/eventbus/basic_test.go index 95faebe3..d2ede36a 100644 --- a/p2p/host/eventbus/basic_test.go +++ b/p2p/host/eventbus/basic_test.go @@ -9,7 +9,8 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/event" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p-testing/race" "github.com/stretchr/testify/require" diff --git a/p2p/host/peerstore/metrics.go b/p2p/host/peerstore/metrics.go index 87a94104..e05fda7d 100644 --- a/p2p/host/peerstore/metrics.go +++ b/p2p/host/peerstore/metrics.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) // LatencyEWMASmoothing governs the decay of the EWMA (the speed diff --git a/p2p/host/peerstore/metrics_test.go b/p2p/host/peerstore/metrics_test.go index 723baad2..d92a482b 100644 --- a/p2p/host/peerstore/metrics_test.go +++ b/p2p/host/peerstore/metrics_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/test" ) func TestLatencyEWMAFun(t *testing.T) { diff --git a/p2p/host/peerstore/pb/custom.go b/p2p/host/peerstore/pb/custom.go index 41784a4f..6f22f92a 100644 --- a/p2p/host/peerstore/pb/custom.go +++ b/p2p/host/peerstore/pb/custom.go @@ -3,9 +3,10 @@ package pstore_pb import ( "encoding/json" - proto "github.com/gogo/protobuf/proto" - peer "github.com/libp2p/go-libp2p-core/peer" - pt "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/peer" + pt "github.com/libp2p/go-libp2p/core/test" + + "github.com/gogo/protobuf/proto" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/peerstore/peerstore.go b/p2p/host/peerstore/peerstore.go index 9f5eda8f..45c22c36 100644 --- a/p2p/host/peerstore/peerstore.go +++ b/p2p/host/peerstore/peerstore.go @@ -1,8 +1,8 @@ package peerstore import ( - "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ) func PeerInfos(ps pstore.Peerstore, peers peer.IDSlice) []peer.AddrInfo { diff --git a/p2p/host/peerstore/pstoreds/addr_book.go b/p2p/host/peerstore/pstoreds/addr_book.go index ac540154..b3c5b323 100644 --- a/p2p/host/peerstore/pstoreds/addr_book.go +++ b/p2p/host/peerstore/pstoreds/addr_book.go @@ -7,13 +7,12 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/record" pb "github.com/libp2p/go-libp2p/p2p/host/peerstore/pb" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" - "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/record" - lru "github.com/hashicorp/golang-lru" ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" @@ -282,7 +281,7 @@ func (ab *dsAddrBook) AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Duratio // ConsumePeerRecord adds addresses from a signed peer.PeerRecord (contained in // a record.Envelope), which will expire after the given TTL. -// See https://godoc.org/github.com/libp2p/go-libp2p-core/peerstore#CertifiedAddrBook for more details. +// See https://godoc.org/github.com/libp2p/go-libp2p/core/peerstore#CertifiedAddrBook for more details. func (ab *dsAddrBook) ConsumePeerRecord(recordEnvelope *record.Envelope, ttl time.Duration) (bool, error) { r, err := recordEnvelope.Record() if err != nil { diff --git a/p2p/host/peerstore/pstoreds/addr_book_gc.go b/p2p/host/peerstore/pstoreds/addr_book_gc.go index 06df6489..1cca7ad6 100644 --- a/p2p/host/peerstore/pstoreds/addr_book_gc.go +++ b/p2p/host/peerstore/pstoreds/addr_book_gc.go @@ -6,10 +6,9 @@ import ( "strconv" "time" + "github.com/libp2p/go-libp2p/core/peer" pb "github.com/libp2p/go-libp2p/p2p/host/peerstore/pb" - "github.com/libp2p/go-libp2p-core/peer" - ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" b32 "github.com/multiformats/go-base32" diff --git a/p2p/host/peerstore/pstoreds/addr_book_gc_test.go b/p2p/host/peerstore/pstoreds/addr_book_gc_test.go index 3a2cab0b..68446edc 100644 --- a/p2p/host/peerstore/pstoreds/addr_book_gc_test.go +++ b/p2p/host/peerstore/pstoreds/addr_book_gc_test.go @@ -5,10 +5,9 @@ import ( "testing" "time" + pstore "github.com/libp2p/go-libp2p/core/peerstore" "github.com/libp2p/go-libp2p/p2p/host/peerstore/test" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - mockClock "github.com/benbjohnson/clock" "github.com/ipfs/go-datastore/query" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/host/peerstore/pstoreds/ds_test.go b/p2p/host/peerstore/pstoreds/ds_test.go index ce3be5ab..60a4ba17 100644 --- a/p2p/host/peerstore/pstoreds/ds_test.go +++ b/p2p/host/peerstore/pstoreds/ds_test.go @@ -6,10 +6,9 @@ import ( "testing" "time" + pstore "github.com/libp2p/go-libp2p/core/peerstore" pt "github.com/libp2p/go-libp2p/p2p/host/peerstore/test" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - mockClock "github.com/benbjohnson/clock" ds "github.com/ipfs/go-datastore" badger "github.com/ipfs/go-ds-badger" diff --git a/p2p/host/peerstore/pstoreds/keybook.go b/p2p/host/peerstore/pstoreds/keybook.go index 7ee06c81..9db799b1 100644 --- a/p2p/host/peerstore/pstoreds/keybook.go +++ b/p2p/host/peerstore/pstoreds/keybook.go @@ -4,14 +4,13 @@ import ( "context" "errors" - "github.com/multiformats/go-base32" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" - - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/multiformats/go-base32" ) // Public and private keys are stored under the following db key pattern: diff --git a/p2p/host/peerstore/pstoreds/metadata.go b/p2p/host/peerstore/pstoreds/metadata.go index 14201735..64c24fd7 100644 --- a/p2p/host/peerstore/pstoreds/metadata.go +++ b/p2p/host/peerstore/pstoreds/metadata.go @@ -6,8 +6,8 @@ import ( "encoding/gob" pool "github.com/libp2p/go-buffer-pool" - "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" diff --git a/p2p/host/peerstore/pstoreds/peerstore.go b/p2p/host/peerstore/pstoreds/peerstore.go index df6069b7..bd547681 100644 --- a/p2p/host/peerstore/pstoreds/peerstore.go +++ b/p2p/host/peerstore/pstoreds/peerstore.go @@ -6,9 +6,8 @@ import ( "io" "time" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" pstore "github.com/libp2p/go-libp2p/p2p/host/peerstore" ds "github.com/ipfs/go-datastore" diff --git a/p2p/host/peerstore/pstoreds/protobook.go b/p2p/host/peerstore/pstoreds/protobook.go index af44722c..cfc6ef7d 100644 --- a/p2p/host/peerstore/pstoreds/protobook.go +++ b/p2p/host/peerstore/pstoreds/protobook.go @@ -5,9 +5,8 @@ import ( "fmt" "sync" - "github.com/libp2p/go-libp2p-core/peer" - - pstore "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ) type protoSegment struct { diff --git a/p2p/host/peerstore/pstoremem/addr_book.go b/p2p/host/peerstore/pstoremem/addr_book.go index 7e6a67fa..28aa6d4d 100644 --- a/p2p/host/peerstore/pstoremem/addr_book.go +++ b/p2p/host/peerstore/pstoremem/addr_book.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/record" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/record" logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" @@ -183,7 +183,7 @@ func (mab *memoryAddrBook) AddAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Du // ConsumePeerRecord adds addresses from a signed peer.PeerRecord (contained in // a record.Envelope), which will expire after the given TTL. -// See https://godoc.org/github.com/libp2p/go-libp2p-core/peerstore#CertifiedAddrBook for more details. +// See https://godoc.org/github.com/libp2p/go-libp2p/core/peerstore#CertifiedAddrBook for more details. func (mab *memoryAddrBook) ConsumePeerRecord(recordEnvelope *record.Envelope, ttl time.Duration) (bool, error) { r, err := recordEnvelope.Record() if err != nil { diff --git a/p2p/host/peerstore/pstoremem/inmem_test.go b/p2p/host/peerstore/pstoremem/inmem_test.go index b025cd46..097a1fd2 100644 --- a/p2p/host/peerstore/pstoremem/inmem_test.go +++ b/p2p/host/peerstore/pstoremem/inmem_test.go @@ -3,10 +3,9 @@ package pstoremem import ( "testing" + pstore "github.com/libp2p/go-libp2p/core/peerstore" pt "github.com/libp2p/go-libp2p/p2p/host/peerstore/test" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - mockClock "github.com/benbjohnson/clock" "github.com/stretchr/testify/require" "go.uber.org/goleak" diff --git a/p2p/host/peerstore/pstoremem/keybook.go b/p2p/host/peerstore/pstoremem/keybook.go index 387a5736..f995a087 100644 --- a/p2p/host/peerstore/pstoremem/keybook.go +++ b/p2p/host/peerstore/pstoremem/keybook.go @@ -4,10 +4,9 @@ import ( "errors" "sync" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - - pstore "github.com/libp2p/go-libp2p-core/peerstore" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ) type memoryKeyBook struct { diff --git a/p2p/host/peerstore/pstoremem/metadata.go b/p2p/host/peerstore/pstoremem/metadata.go index 0fd41c07..305c7417 100644 --- a/p2p/host/peerstore/pstoremem/metadata.go +++ b/p2p/host/peerstore/pstoremem/metadata.go @@ -3,8 +3,8 @@ package pstoremem import ( "sync" - "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ) type memoryPeerMetadata struct { diff --git a/p2p/host/peerstore/pstoremem/peerstore.go b/p2p/host/peerstore/pstoremem/peerstore.go index 7c0d18b9..ec403f84 100644 --- a/p2p/host/peerstore/pstoremem/peerstore.go +++ b/p2p/host/peerstore/pstoremem/peerstore.go @@ -4,10 +4,9 @@ import ( "fmt" "io" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" pstore "github.com/libp2p/go-libp2p/p2p/host/peerstore" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" ) type pstoremem struct { diff --git a/p2p/host/peerstore/pstoremem/protobook.go b/p2p/host/peerstore/pstoremem/protobook.go index b2cf73e1..7a955c07 100644 --- a/p2p/host/peerstore/pstoremem/protobook.go +++ b/p2p/host/peerstore/pstoremem/protobook.go @@ -4,9 +4,8 @@ import ( "errors" "sync" - "github.com/libp2p/go-libp2p-core/peer" - - pstore "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ) type protoSegment struct { diff --git a/p2p/host/peerstore/test/addr_book_suite.go b/p2p/host/peerstore/test/addr_book_suite.go index 5bcf8820..dba2b3cd 100644 --- a/p2p/host/peerstore/test/addr_book_suite.go +++ b/p2p/host/peerstore/test/addr_book_suite.go @@ -4,14 +4,14 @@ import ( "testing" "time" - mockClock "github.com/benbjohnson/clock" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/record" - "github.com/libp2p/go-libp2p-core/test" - "github.com/multiformats/go-multiaddr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/record" + "github.com/libp2p/go-libp2p/core/test" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + mockClock "github.com/benbjohnson/clock" + "github.com/multiformats/go-multiaddr" ) var addressBookSuite = map[string]func(book pstore.AddrBook, clk *mockClock.Mock) func(*testing.T){ diff --git a/p2p/host/peerstore/test/benchmarks_suite.go b/p2p/host/peerstore/test/benchmarks_suite.go index c67303b1..d45cac89 100644 --- a/p2p/host/peerstore/test/benchmarks_suite.go +++ b/p2p/host/peerstore/test/benchmarks_suite.go @@ -6,7 +6,7 @@ import ( "sort" "testing" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + pstore "github.com/libp2p/go-libp2p/core/peerstore" ) var peerstoreBenchmarks = map[string]func(pstore.Peerstore, chan *peerpair) func(*testing.B){ diff --git a/p2p/host/peerstore/test/keybook_suite.go b/p2p/host/peerstore/test/keybook_suite.go index 2774b3df..3e559753 100644 --- a/p2p/host/peerstore/test/keybook_suite.go +++ b/p2p/host/peerstore/test/keybook_suite.go @@ -4,13 +4,12 @@ import ( "sort" "testing" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" + pt "github.com/libp2p/go-libp2p/core/test" + "github.com/stretchr/testify/require" - - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - pt "github.com/libp2p/go-libp2p-core/test" - - pstore "github.com/libp2p/go-libp2p-core/peerstore" ) var keyBookSuite = map[string]func(kb pstore.KeyBook) func(*testing.T){ diff --git a/p2p/host/peerstore/test/peerstore_suite.go b/p2p/host/peerstore/test/peerstore_suite.go index 38f9a495..325399de 100644 --- a/p2p/host/peerstore/test/peerstore_suite.go +++ b/p2p/host/peerstore/test/peerstore_suite.go @@ -9,11 +9,11 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + pstore "github.com/libp2p/go-libp2p/core/peerstore" - pstore "github.com/libp2p/go-libp2p-core/peerstore" + ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/host/peerstore/test/utils.go b/p2p/host/peerstore/test/utils.go index c169894b..8d327f45 100644 --- a/p2p/host/peerstore/test/utils.go +++ b/p2p/host/peerstore/test/utils.go @@ -5,8 +5,9 @@ import ( "fmt" "testing" - peer "github.com/libp2p/go-libp2p-core/peer" - pt "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/peer" + pt "github.com/libp2p/go-libp2p/core/test" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/pstoremanager/mock_peerstore_test.go b/p2p/host/pstoremanager/mock_peerstore_test.go index c1414cce..a1547648 100644 --- a/p2p/host/pstoremanager/mock_peerstore_test.go +++ b/p2p/host/pstoremanager/mock_peerstore_test.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/libp2p/go-libp2p-core/peerstore (interfaces: Peerstore) +// Source: github.com/libp2p/go-libp2p/core/peerstore (interfaces: Peerstore) // Package pstoremanager_test is a generated GoMock package. package pstoremanager_test @@ -10,8 +10,8 @@ import ( time "time" gomock "github.com/golang/mock/gomock" - crypto "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" + crypto "github.com/libp2p/go-libp2p/core/crypto" + peer "github.com/libp2p/go-libp2p/core/peer" multiaddr "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/pstoremanager/pstoremanager.go b/p2p/host/pstoremanager/pstoremanager.go index 311ca0c9..f8382c70 100644 --- a/p2p/host/pstoremanager/pstoremanager.go +++ b/p2p/host/pstoremanager/pstoremanager.go @@ -5,10 +5,10 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" logging "github.com/ipfs/go-log/v2" ) diff --git a/p2p/host/pstoremanager/pstoremanager_test.go b/p2p/host/pstoremanager/pstoremanager_test.go index dec09cdf..064e6259 100644 --- a/p2p/host/pstoremanager/pstoremanager_test.go +++ b/p2p/host/pstoremanager/pstoremanager_test.go @@ -4,18 +4,17 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/host/eventbus" "github.com/libp2p/go-libp2p/p2p/host/pstoremanager" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) -//go:generate sh -c "mockgen -package pstoremanager_test -destination mock_peerstore_test.go github.com/libp2p/go-libp2p-core/peerstore Peerstore" +//go:generate sh -c "mockgen -package pstoremanager_test -destination mock_peerstore_test.go github.com/libp2p/go-libp2p/core/peerstore Peerstore" func TestGracePeriod(t *testing.T) { t.Parallel() diff --git a/p2p/host/relaysvc/relay.go b/p2p/host/relaysvc/relay.go index d1928b33..a36e20e0 100644 --- a/p2p/host/relaysvc/relay.go +++ b/p2p/host/relaysvc/relay.go @@ -6,9 +6,9 @@ import ( relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" ) type RelayManager struct { diff --git a/p2p/host/resource-manager/allowlist.go b/p2p/host/resource-manager/allowlist.go index fd72af07..d2bdb869 100644 --- a/p2p/host/resource-manager/allowlist.go +++ b/p2p/host/resource-manager/allowlist.go @@ -7,7 +7,8 @@ import ( "net" "sync" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/host/resource-manager/allowlist_test.go b/p2p/host/resource-manager/allowlist_test.go index 2e8ce3f7..d665b63f 100644 --- a/p2p/host/resource-manager/allowlist_test.go +++ b/p2p/host/resource-manager/allowlist_test.go @@ -6,8 +6,9 @@ import ( "net" "testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/test" + "github.com/multiformats/go-multiaddr" ) @@ -22,7 +23,7 @@ func ExampleWithAllowlistedMultiaddrs() { // Any peer connecting from this IP address multiaddr.StringCast("/ip4/1.2.3.4"), // Only the specified peer from this address - multiaddr.StringCast("/ip4/2.2.3.4/p2p/" + peer.Encode(somePeer)), + multiaddr.StringCast("/ip4/2.2.3.4/p2p/" + somePeer.String()), // Only peers from this 1.2.3.0/24 IP address range multiaddr.StringCast("/ip4/1.2.3.0/ipcidr/24"), })) @@ -77,7 +78,7 @@ func TestAllowedWithPeer(t *testing.T) { name: "Blocked wrong peer", isConnAllowed: true, isAllowedWithPeer: false, - allowlist: []string{"/ip4/1.2.3.4" + "/p2p/" + peer.Encode(peerB)}, + allowlist: []string{"/ip4/1.2.3.4" + "/p2p/" + peerB.String()}, endpoint: multiaddrA, peer: peerA, }, @@ -100,7 +101,7 @@ func TestAllowedWithPeer(t *testing.T) { name: "allowed. right network, right peer", isConnAllowed: true, isAllowedWithPeer: true, - allowlist: []string{"/ip4/1.2.3.0/ipcidr/24" + "/p2p/" + peer.Encode(peerA)}, + allowlist: []string{"/ip4/1.2.3.0/ipcidr/24" + "/p2p/" + peerA.String()}, endpoint: multiaddrA, peer: peerA, }, { @@ -115,7 +116,7 @@ func TestAllowedWithPeer(t *testing.T) { name: "Blocked. right network, wrong peer", isConnAllowed: true, isAllowedWithPeer: false, - allowlist: []string{"/ip4/1.2.3.0/ipcidr/24" + "/p2p/" + peer.Encode(peerB)}, + allowlist: []string{"/ip4/1.2.3.0/ipcidr/24" + "/p2p/" + peerB.String()}, endpoint: multiaddrA, peer: peerA, }, @@ -131,7 +132,7 @@ func TestAllowedWithPeer(t *testing.T) { name: "allowed peer multiple ips in allowlist", isConnAllowed: true, isAllowedWithPeer: true, - allowlist: []string{"/ip4/1.2.3.4/p2p/" + peer.Encode(peerA), "/ip4/2.2.3.4/p2p/" + peer.Encode(peerA)}, + allowlist: []string{"/ip4/1.2.3.4/p2p/" + peerA.String(), "/ip4/2.2.3.4/p2p/" + peerA.String()}, endpoint: multiaddrA, peer: peerA, }, @@ -139,7 +140,7 @@ func TestAllowedWithPeer(t *testing.T) { name: "allowed peer multiple ips in allowlist", isConnAllowed: true, isAllowedWithPeer: true, - allowlist: []string{"/ip4/1.2.3.4/p2p/" + peer.Encode(peerA), "/ip4/1.2.3.4/p2p/" + peer.Encode(peerA)}, + allowlist: []string{"/ip4/1.2.3.4/p2p/" + peerA.String(), "/ip4/1.2.3.4/p2p/" + peerA.String()}, endpoint: multiaddrA, peer: peerA, }, @@ -147,7 +148,7 @@ func TestAllowedWithPeer(t *testing.T) { name: "allowed peer multiple ips in allowlist", isConnAllowed: true, isAllowedWithPeer: true, - allowlist: []string{"/ip4/1.2.3.4/p2p/" + peer.Encode(peerA), "/ip4/2.2.3.4/p2p/" + peer.Encode(peerA)}, + allowlist: []string{"/ip4/1.2.3.4/p2p/" + peerA.String(), "/ip4/2.2.3.4/p2p/" + peerA.String()}, endpoint: multiaddrB, peer: peerA, }, @@ -186,9 +187,9 @@ func TestRemoved(t *testing.T) { testCases := []testCase{ {name: "ip4", allowedMA: "/ip4/1.2.3.4"}, - {name: "ip4 with peer", allowedMA: "/ip4/1.2.3.4/p2p/" + peer.Encode(peerA)}, + {name: "ip4 with peer", allowedMA: "/ip4/1.2.3.4/p2p/" + peerA.String()}, {name: "ip4 network", allowedMA: "/ip4/0.0.0.0/ipcidr/0"}, - {name: "ip4 network with peer", allowedMA: "/ip4/0.0.0.0/ipcidr/0/p2p/" + peer.Encode(peerA)}, + {name: "ip4 network with peer", allowedMA: "/ip4/0.0.0.0/ipcidr/0/p2p/" + peerA.String()}, } for _, tc := range testCases { @@ -255,7 +256,7 @@ func BenchmarkAllowlistCheck(b *testing.B) { var ma multiaddr.Multiaddr if i%ratioOfSpecifiedPeers == 0 { - ma = multiaddr.StringCast(ipString + "/p2p/" + peer.Encode(test.RandPeerIDFatal(b))) + ma = multiaddr.StringCast(ipString + "/p2p/" + test.RandPeerIDFatal(b).String()) } else { ma = multiaddr.StringCast(ipString) } diff --git a/p2p/host/resource-manager/error.go b/p2p/host/resource-manager/error.go index 1ccc86f9..4b02672b 100644 --- a/p2p/host/resource-manager/error.go +++ b/p2p/host/resource-manager/error.go @@ -3,7 +3,7 @@ package rcmgr import ( "errors" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) type errStreamOrConnLimitExceeded struct { diff --git a/p2p/host/resource-manager/extapi.go b/p2p/host/resource-manager/extapi.go index 92605c82..302678e1 100644 --- a/p2p/host/resource-manager/extapi.go +++ b/p2p/host/resource-manager/extapi.go @@ -5,9 +5,9 @@ import ( "sort" "strings" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" ) // ResourceScopeLimiter is a trait interface that allows you to access scope limits. diff --git a/p2p/host/resource-manager/limit.go b/p2p/host/resource-manager/limit.go index 21dffb7d..3fd57ff5 100644 --- a/p2p/host/resource-manager/limit.go +++ b/p2p/host/resource-manager/limit.go @@ -13,9 +13,9 @@ import ( "encoding/json" "io" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" ) // Limit is an object that specifies basic resource limits. diff --git a/p2p/host/resource-manager/limit_config_test.go b/p2p/host/resource-manager/limit_config_test.go index 1330d4bf..21dede56 100644 --- a/p2p/host/resource-manager/limit_config_test.go +++ b/p2p/host/resource-manager/limit_config_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" ) diff --git a/p2p/host/resource-manager/limit_defaults.go b/p2p/host/resource-manager/limit_defaults.go index 39980ed8..e037ca6a 100644 --- a/p2p/host/resource-manager/limit_defaults.go +++ b/p2p/host/resource-manager/limit_defaults.go @@ -4,8 +4,8 @@ import ( "encoding/json" "math" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" "github.com/pbnjay/memory" ) @@ -141,7 +141,7 @@ func (cfg *LimitConfig) MarshalJSON() ([]byte, error) { // we want to marshal the encoded peer id encodedPeerMap := make(map[string]BaseLimit, len(cfg.Peer)) for p, v := range cfg.Peer { - encodedPeerMap[peer.Encode(p)] = v + encodedPeerMap[p.String()] = v } type Alias LimitConfig diff --git a/p2p/host/resource-manager/metrics.go b/p2p/host/resource-manager/metrics.go index a875415a..2f9e6b31 100644 --- a/p2p/host/resource-manager/metrics.go +++ b/p2p/host/resource-manager/metrics.go @@ -1,9 +1,9 @@ package rcmgr import ( - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" ) // MetricsReporter is an interface for collecting metrics from resource manager actions diff --git a/p2p/host/resource-manager/rcmgr.go b/p2p/host/resource-manager/rcmgr.go index b2cd18cc..03d100a6 100644 --- a/p2p/host/resource-manager/rcmgr.go +++ b/p2p/host/resource-manager/rcmgr.go @@ -7,12 +7,12 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/multiformats/go-multiaddr" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" logging "github.com/ipfs/go-log/v2" + "github.com/multiformats/go-multiaddr" ) var log = logging.Logger("rcmgr") diff --git a/p2p/host/resource-manager/rcmgr_test.go b/p2p/host/resource-manager/rcmgr_test.go index de41cf6b..12420ac7 100644 --- a/p2p/host/resource-manager/rcmgr_test.go +++ b/p2p/host/resource-manager/rcmgr_test.go @@ -3,10 +3,11 @@ package rcmgr import ( "testing" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/libp2p/go-libp2p/core/test" + "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/host/resource-manager/scope.go b/p2p/host/resource-manager/scope.go index 21905272..872f0eb6 100644 --- a/p2p/host/resource-manager/scope.go +++ b/p2p/host/resource-manager/scope.go @@ -5,7 +5,7 @@ import ( "strings" "sync" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) // resources tracks the current state of resource consumption diff --git a/p2p/host/resource-manager/scope_test.go b/p2p/host/resource-manager/scope_test.go index 3743068a..af192a7b 100644 --- a/p2p/host/resource-manager/scope_test.go +++ b/p2p/host/resource-manager/scope_test.go @@ -3,7 +3,7 @@ package rcmgr import ( "testing" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) func checkResources(t *testing.T, rc *resources, st network.ScopeStat) { diff --git a/p2p/host/resource-manager/trace.go b/p2p/host/resource-manager/trace.go index ae871a0a..1af71edd 100644 --- a/p2p/host/resource-manager/trace.go +++ b/p2p/host/resource-manager/trace.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) type trace struct { diff --git a/p2p/host/routed/routed.go b/p2p/host/routed/routed.go index e783ebec..55c8d347 100644 --- a/p2p/host/routed/routed.go +++ b/p2p/host/routed/routed.go @@ -5,13 +5,13 @@ import ( "fmt" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" logging "github.com/ipfs/go-log/v2" diff --git a/p2p/muxer/mplex/conn.go b/p2p/muxer/mplex/conn.go index 1abef546..ed4e847e 100644 --- a/p2p/muxer/mplex/conn.go +++ b/p2p/muxer/mplex/conn.go @@ -3,7 +3,7 @@ package mplex import ( "context" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" mp "github.com/libp2p/go-mplex" ) diff --git a/p2p/muxer/mplex/stream.go b/p2p/muxer/mplex/stream.go index 64b70fbd..53e9e6da 100644 --- a/p2p/muxer/mplex/stream.go +++ b/p2p/muxer/mplex/stream.go @@ -3,7 +3,7 @@ package mplex import ( "time" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" mp "github.com/libp2p/go-mplex" ) diff --git a/p2p/muxer/mplex/transport.go b/p2p/muxer/mplex/transport.go index f24c1cc7..b7fbe84c 100644 --- a/p2p/muxer/mplex/transport.go +++ b/p2p/muxer/mplex/transport.go @@ -3,7 +3,7 @@ package mplex import ( "net" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" mp "github.com/libp2p/go-mplex" ) diff --git a/p2p/muxer/mplex/transport_test.go b/p2p/muxer/mplex/transport_test.go index 1226b5d7..3a7d00fa 100644 --- a/p2p/muxer/mplex/transport_test.go +++ b/p2p/muxer/mplex/transport_test.go @@ -5,7 +5,7 @@ import ( "net" "testing" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" test "github.com/libp2p/go-libp2p/p2p/muxer/testsuite" ) diff --git a/p2p/muxer/muxer-multistream/multistream.go b/p2p/muxer/muxer-multistream/multistream.go index 1668c0b9..bf9d4163 100644 --- a/p2p/muxer/muxer-multistream/multistream.go +++ b/p2p/muxer/muxer-multistream/multistream.go @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" mss "github.com/multiformats/go-multistream" ) diff --git a/p2p/muxer/testsuite/mux.go b/p2p/muxer/testsuite/mux.go index fbfea2c0..d77d4073 100644 --- a/p2p/muxer/testsuite/mux.go +++ b/p2p/muxer/testsuite/mux.go @@ -16,9 +16,9 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-testing/ci" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" ) diff --git a/p2p/muxer/yamux/conn.go b/p2p/muxer/yamux/conn.go index 4feff1de..30f9f351 100644 --- a/p2p/muxer/yamux/conn.go +++ b/p2p/muxer/yamux/conn.go @@ -3,7 +3,7 @@ package yamux import ( "context" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-yamux/v3" ) diff --git a/p2p/muxer/yamux/stream.go b/p2p/muxer/yamux/stream.go index f75e77d6..e6a3a04b 100644 --- a/p2p/muxer/yamux/stream.go +++ b/p2p/muxer/yamux/stream.go @@ -3,7 +3,7 @@ package yamux import ( "time" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-yamux/v3" ) diff --git a/p2p/muxer/yamux/transport.go b/p2p/muxer/yamux/transport.go index 148fb5e9..bba53d7a 100644 --- a/p2p/muxer/yamux/transport.go +++ b/p2p/muxer/yamux/transport.go @@ -5,7 +5,7 @@ import ( "math" "net" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-yamux/v3" ) diff --git a/p2p/net/conn-security-multistream/ssms.go b/p2p/net/conn-security-multistream/ssms.go index 46bb334a..595d8dfd 100644 --- a/p2p/net/conn-security-multistream/ssms.go +++ b/p2p/net/conn-security-multistream/ssms.go @@ -6,8 +6,9 @@ import ( "log" "net" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + mss "github.com/multiformats/go-multistream" ) diff --git a/p2p/net/conn-security-multistream/ssms_test.go b/p2p/net/conn-security-multistream/ssms_test.go index f027d729..130b4ef4 100644 --- a/p2p/net/conn-security-multistream/ssms_test.go +++ b/p2p/net/conn-security-multistream/ssms_test.go @@ -7,10 +7,10 @@ import ( "sync" "testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/sec/insecure" tnet "github.com/libp2p/go-libp2p-testing/net" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/sec/insecure" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/conngater/conngater.go b/p2p/net/conngater/conngater.go index fdfd7aea..bcc927f1 100644 --- a/p2p/net/conngater/conngater.go +++ b/p2p/net/conngater/conngater.go @@ -5,10 +5,10 @@ import ( "net" "sync" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/control" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/control" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/net/conngater/conngater_test.go b/p2p/net/conngater/conngater_test.go index 7765e824..d60b5e45 100644 --- a/p2p/net/conngater/conngater_test.go +++ b/p2p/net/conngater/conngater_test.go @@ -5,8 +5,9 @@ import ( "testing" "github.com/ipfs/go-datastore" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/connmgr/bench_test.go b/p2p/net/connmgr/bench_test.go index 73e25e97..83442f91 100644 --- a/p2p/net/connmgr/bench_test.go +++ b/p2p/net/connmgr/bench_test.go @@ -5,7 +5,7 @@ import ( "sync" "testing" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/connmgr/connmgr.go b/p2p/net/connmgr/connmgr.go index b73e3a71..22b83c44 100644 --- a/p2p/net/connmgr/connmgr.go +++ b/p2p/net/connmgr/connmgr.go @@ -7,9 +7,9 @@ import ( "sync/atomic" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/net/connmgr/connmgr_test.go b/p2p/net/connmgr/connmgr_test.go index d70ec363..c2db206c 100644 --- a/p2p/net/connmgr/connmgr_test.go +++ b/p2p/net/connmgr/connmgr_test.go @@ -7,14 +7,12 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + tu "github.com/libp2p/go-libp2p/core/test" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - - tu "github.com/libp2p/go-libp2p-core/test" ma "github.com/multiformats/go-multiaddr" - "github.com/stretchr/testify/require" ) diff --git a/p2p/net/connmgr/decay.go b/p2p/net/connmgr/decay.go index 58e34a08..9841c2f1 100644 --- a/p2p/net/connmgr/decay.go +++ b/p2p/net/connmgr/decay.go @@ -6,8 +6,8 @@ import ( "sync/atomic" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/peer" "github.com/benbjohnson/clock" ) diff --git a/p2p/net/connmgr/decay_test.go b/p2p/net/connmgr/decay_test.go index c271a1da..bd28b326 100644 --- a/p2p/net/connmgr/decay_test.go +++ b/p2p/net/connmgr/decay_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/peer" - tu "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/peer" + tu "github.com/libp2p/go-libp2p/core/test" "github.com/benbjohnson/clock" "github.com/stretchr/testify/require" diff --git a/p2p/net/mock/complement.go b/p2p/net/mock/complement.go index 4a8b251d..d0162ca4 100644 --- a/p2p/net/mock/complement.go +++ b/p2p/net/mock/complement.go @@ -1,7 +1,7 @@ package mocknet import ( - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) // StreamComplement returns the other end of the given stream. This function diff --git a/p2p/net/mock/interface.go b/p2p/net/mock/interface.go index 68dee445..d89342b0 100644 --- a/p2p/net/mock/interface.go +++ b/p2p/net/mock/interface.go @@ -10,11 +10,11 @@ import ( "io" "time" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/mock/mock_conn.go b/p2p/net/mock/mock_conn.go index dae0867d..5664fabb 100644 --- a/p2p/net/mock/mock_conn.go +++ b/p2p/net/mock/mock_conn.go @@ -7,9 +7,9 @@ import ( "sync" "sync/atomic" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/net/mock/mock_link.go b/p2p/net/mock/mock_link.go index fe65398e..47bf9a3f 100644 --- a/p2p/net/mock/mock_link.go +++ b/p2p/net/mock/mock_link.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // link implements mocknet.Link diff --git a/p2p/net/mock/mock_net.go b/p2p/net/mock/mock_net.go index 9ec54d54..21d214ec 100644 --- a/p2p/net/mock/mock_net.go +++ b/p2p/net/mock/mock_net.go @@ -8,12 +8,11 @@ import ( "sort" "sync" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" diff --git a/p2p/net/mock/mock_notif_test.go b/p2p/net/mock/mock_notif_test.go index 7b038f53..600e0af2 100644 --- a/p2p/net/mock/mock_notif_test.go +++ b/p2p/net/mock/mock_notif_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/mock/mock_peernet.go b/p2p/net/mock/mock_peernet.go index d633c741..2e931a66 100644 --- a/p2p/net/mock/mock_peernet.go +++ b/p2p/net/mock/mock_peernet.go @@ -7,9 +7,9 @@ import ( "math/rand" "sync" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/mock/mock_printer.go b/p2p/net/mock/mock_printer.go index 344560e0..33e1b965 100644 --- a/p2p/net/mock/mock_printer.go +++ b/p2p/net/mock/mock_printer.go @@ -4,8 +4,8 @@ import ( "fmt" "io" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // separate object so our interfaces are separate :) diff --git a/p2p/net/mock/mock_stream.go b/p2p/net/mock/mock_stream.go index 0d386b49..61303dab 100644 --- a/p2p/net/mock/mock_stream.go +++ b/p2p/net/mock/mock_stream.go @@ -9,8 +9,8 @@ import ( "sync/atomic" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/protocol" ) var streamCounter int64 diff --git a/p2p/net/mock/mock_test.go b/p2p/net/mock/mock_test.go index f99d82c9..153c1af1 100644 --- a/p2p/net/mock/mock_test.go +++ b/p2p/net/mock/mock_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" "github.com/libp2p/go-libp2p-testing/ci" tnet "github.com/libp2p/go-libp2p-testing/net" diff --git a/p2p/net/pnet/protector.go b/p2p/net/pnet/protector.go index ed63a690..643e904d 100644 --- a/p2p/net/pnet/protector.go +++ b/p2p/net/pnet/protector.go @@ -4,7 +4,7 @@ import ( "errors" "net" - ipnet "github.com/libp2p/go-libp2p-core/pnet" + ipnet "github.com/libp2p/go-libp2p/core/pnet" ) // NewProtectedConn creates a new protected connection diff --git a/p2p/net/pnet/psk_conn.go b/p2p/net/pnet/psk_conn.go index 5d35d879..c600c8d0 100644 --- a/p2p/net/pnet/psk_conn.go +++ b/p2p/net/pnet/psk_conn.go @@ -6,7 +6,7 @@ import ( "io" "net" - "github.com/libp2p/go-libp2p-core/pnet" + "github.com/libp2p/go-libp2p/core/pnet" "github.com/davidlazar/go-crypto/salsa20" pool "github.com/libp2p/go-buffer-pool" diff --git a/p2p/net/swarm/dial_error.go b/p2p/net/swarm/dial_error.go index f2986348..711ee060 100644 --- a/p2p/net/swarm/dial_error.go +++ b/p2p/net/swarm/dial_error.go @@ -5,7 +5,7 @@ import ( "os" "strings" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/swarm/dial_sync.go b/p2p/net/swarm/dial_sync.go index f24ecd3c..2a8ff431 100644 --- a/p2p/net/swarm/dial_sync.go +++ b/p2p/net/swarm/dial_sync.go @@ -4,8 +4,8 @@ import ( "context" "sync" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) // dialWorkerFunc is used by dialSync to spawn a new dial worker diff --git a/p2p/net/swarm/dial_sync_test.go b/p2p/net/swarm/dial_sync_test.go index 976f4609..e2b8e88d 100644 --- a/p2p/net/swarm/dial_sync_test.go +++ b/p2p/net/swarm/dial_sync_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/dial_test.go b/p2p/net/swarm/dial_test.go index bda5546f..aed15d4a 100644 --- a/p2p/net/swarm/dial_test.go +++ b/p2p/net/swarm/dial_test.go @@ -7,18 +7,17 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + testutil "github.com/libp2p/go-libp2p/core/test" . "github.com/libp2p/go-libp2p/p2p/net/swarm" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - testutil "github.com/libp2p/go-libp2p-core/test" - "github.com/libp2p/go-libp2p-testing/ci" + ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" - "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/dial_worker.go b/p2p/net/swarm/dial_worker.go index cf9dfe59..ff339d2f 100644 --- a/p2p/net/swarm/dial_worker.go +++ b/p2p/net/swarm/dial_worker.go @@ -4,8 +4,8 @@ import ( "context" "sync" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/net/swarm/dial_worker_test.go b/p2p/net/swarm/dial_worker_test.go index 80235a74..66c98ed8 100644 --- a/p2p/net/swarm/dial_worker_test.go +++ b/p2p/net/swarm/dial_worker_test.go @@ -8,6 +8,9 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/sec/insecure" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" msmux "github.com/libp2p/go-libp2p/p2p/muxer/muxer-multistream" "github.com/libp2p/go-libp2p/p2p/muxer/yamux" @@ -16,13 +19,9 @@ import ( quic "github.com/libp2p/go-libp2p/p2p/transport/quic" "github.com/libp2p/go-libp2p/p2p/transport/tcp" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/sec/insecure" - "github.com/libp2p/go-libp2p-core/transport" - tnet "github.com/libp2p/go-libp2p-testing/net" - ma "github.com/multiformats/go-multiaddr" + ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/limiter.go b/p2p/net/swarm/limiter.go index 6b49d8ec..ccfe7d23 100644 --- a/p2p/net/swarm/limiter.go +++ b/p2p/net/swarm/limiter.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/swarm/limiter_test.go b/p2p/net/swarm/limiter_test.go index 47918ce5..046b4c75 100644 --- a/p2p/net/swarm/limiter_test.go +++ b/p2p/net/swarm/limiter_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/test" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/test" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" mafmt "github.com/multiformats/go-multiaddr-fmt" diff --git a/p2p/net/swarm/peers_test.go b/p2p/net/swarm/peers_test.go index a2d8f820..44f1309f 100644 --- a/p2p/net/swarm/peers_test.go +++ b/p2p/net/swarm/peers_test.go @@ -5,13 +5,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" . "github.com/libp2p/go-libp2p/p2p/net/swarm" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - ma "github.com/multiformats/go-multiaddr" - "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/simul_test.go b/p2p/net/swarm/simul_test.go index 5f3d6d34..33026d0e 100644 --- a/p2p/net/swarm/simul_test.go +++ b/p2p/net/swarm/simul_test.go @@ -7,12 +7,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" . "github.com/libp2p/go-libp2p/p2p/net/swarm" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-testing/ci" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/swarm/swarm.go b/p2p/net/swarm/swarm.go index 532ae244..80d67eb9 100644 --- a/p2p/net/swarm/swarm.go +++ b/p2p/net/swarm/swarm.go @@ -10,12 +10,12 @@ import ( "sync/atomic" "time" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/metrics" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/metrics" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/transport" logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/net/swarm/swarm_addr_test.go b/p2p/net/swarm/swarm_addr_test.go index 2bdc1ba3..af98400a 100644 --- a/p2p/net/swarm/swarm_addr_test.go +++ b/p2p/net/swarm/swarm_addr_test.go @@ -4,11 +4,10 @@ import ( "context" "testing" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/test" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/test" - ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/swarm_conn.go b/p2p/net/swarm/swarm_conn.go index 64fb2ed5..779ee373 100644 --- a/p2p/net/swarm/swarm_conn.go +++ b/p2p/net/swarm/swarm_conn.go @@ -8,10 +8,10 @@ import ( "sync/atomic" "time" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/swarm/swarm_dial.go b/p2p/net/swarm/swarm_dial.go index b6f06256..0e232a18 100644 --- a/p2p/net/swarm/swarm_dial.go +++ b/p2p/net/swarm/swarm_dial.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/canonicallog" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/canonicallog" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" @@ -403,7 +403,7 @@ func (s *Swarm) dialAddr(ctx context.Context, p peer.ID, addr ma.Multiaddr) (tra return connC, nil } -// TODO We should have a `IsFdConsuming() bool` method on the `Transport` interface in go-libp2p-core/transport. +// TODO We should have a `IsFdConsuming() bool` method on the `Transport` interface in go-libp2p/core/transport. // This function checks if any of the transport protocols in the address requires a file descriptor. // For now: // A Non-circuit address which has the TCP/UNIX protocol is deemed FD consuming. diff --git a/p2p/net/swarm/swarm_listen.go b/p2p/net/swarm/swarm_listen.go index 9159c559..044da2e8 100644 --- a/p2p/net/swarm/swarm_listen.go +++ b/p2p/net/swarm/swarm_listen.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "github.com/libp2p/go-libp2p-core/canonicallog" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/canonicallog" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/swarm/swarm_net_test.go b/p2p/net/swarm/swarm_net_test.go index 1626f5e9..1dbdc57b 100644 --- a/p2p/net/swarm/swarm_net_test.go +++ b/p2p/net/swarm/swarm_net_test.go @@ -7,10 +7,9 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/network" . "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/network" - "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/swarm_notif_test.go b/p2p/net/swarm/swarm_notif_test.go index ba4609d2..0b6d5612 100644 --- a/p2p/net/swarm/swarm_notif_test.go +++ b/p2p/net/swarm/swarm_notif_test.go @@ -5,11 +5,10 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" . "github.com/libp2p/go-libp2p/p2p/net/swarm" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" diff --git a/p2p/net/swarm/swarm_stream.go b/p2p/net/swarm/swarm_stream.go index 109cce58..7a5bb275 100644 --- a/p2p/net/swarm/swarm_stream.go +++ b/p2p/net/swarm/swarm_stream.go @@ -6,8 +6,8 @@ import ( "sync/atomic" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/protocol" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/protocol" ) // Validate Stream conforms to the go-libp2p-net Stream interface diff --git a/p2p/net/swarm/swarm_test.go b/p2p/net/swarm/swarm_test.go index a5e193f0..93aa9eec 100644 --- a/p2p/net/swarm/swarm_test.go +++ b/p2p/net/swarm/swarm_test.go @@ -11,22 +11,19 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/protocol" - + mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" + "github.com/libp2p/go-libp2p/core/control" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" "github.com/libp2p/go-libp2p/p2p/net/swarm" . "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/control" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - + "github.com/golang/mock/gomock" logging "github.com/ipfs/go-log/v2" - mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" - - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/swarm_transport.go b/p2p/net/swarm/swarm_transport.go index 21728ac3..96a3a8e2 100644 --- a/p2p/net/swarm/swarm_transport.go +++ b/p2p/net/swarm/swarm_transport.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/swarm/testing/testing.go b/p2p/net/swarm/testing/testing.go index b250fff5..24e9db3f 100644 --- a/p2p/net/swarm/testing/testing.go +++ b/p2p/net/swarm/testing/testing.go @@ -4,6 +4,15 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/control" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/metrics" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/sec/insecure" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" msmux "github.com/libp2p/go-libp2p/p2p/muxer/muxer-multistream" "github.com/libp2p/go-libp2p/p2p/muxer/yamux" @@ -13,16 +22,6 @@ import ( quic "github.com/libp2p/go-libp2p/p2p/transport/quic" "github.com/libp2p/go-libp2p/p2p/transport/tcp" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/control" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/metrics" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/sec/insecure" - "github.com/libp2p/go-libp2p-core/transport" - tnet "github.com/libp2p/go-libp2p-testing/net" ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" diff --git a/p2p/net/swarm/transport_test.go b/p2p/net/swarm/transport_test.go index 3c863b23..fe743475 100644 --- a/p2p/net/swarm/transport_test.go +++ b/p2p/net/swarm/transport_test.go @@ -4,14 +4,12 @@ import ( "context" "testing" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/net/swarm" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - ma "github.com/multiformats/go-multiaddr" - "github.com/stretchr/testify/require" ) diff --git a/p2p/net/swarm/util_test.go b/p2p/net/swarm/util_test.go index 11124adb..66246b55 100644 --- a/p2p/net/swarm/util_test.go +++ b/p2p/net/swarm/util_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/libp2p/go-libp2p-core/test" - ma "github.com/multiformats/go-multiaddr" + "github.com/libp2p/go-libp2p/core/test" + ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/upgrader/conn.go b/p2p/net/upgrader/conn.go index 4ee0edc4..2fa7af64 100644 --- a/p2p/net/upgrader/conn.go +++ b/p2p/net/upgrader/conn.go @@ -3,8 +3,8 @@ package upgrader import ( "fmt" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/transport" ) type transportConn struct { diff --git a/p2p/net/upgrader/gater_test.go b/p2p/net/upgrader/gater_test.go index 2d6b8890..72b1d8fc 100644 --- a/p2p/net/upgrader/gater_test.go +++ b/p2p/net/upgrader/gater_test.go @@ -3,10 +3,10 @@ package upgrader_test import ( "sync" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/control" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/control" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/net/upgrader/listener.go b/p2p/net/upgrader/listener.go index 5e289a67..c07299c1 100644 --- a/p2p/net/upgrader/listener.go +++ b/p2p/net/upgrader/listener.go @@ -5,8 +5,8 @@ import ( "fmt" "sync" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/transport" logging "github.com/ipfs/go-log/v2" tec "github.com/jbenet/go-temp-err-catcher" diff --git a/p2p/net/upgrader/listener_test.go b/p2p/net/upgrader/listener_test.go index 929df0bb..48eb7b1e 100644 --- a/p2p/net/upgrader/listener_test.go +++ b/p2p/net/upgrader/listener_test.go @@ -11,18 +11,16 @@ import ( "testing" "time" + mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/net/upgrader" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/transport" - - mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" + "github.com/golang/mock/gomock" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" - - "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/p2p/net/upgrader/upgrader.go b/p2p/net/upgrader/upgrader.go index 4f8e7122..58347865 100644 --- a/p2p/net/upgrader/upgrader.go +++ b/p2p/net/upgrader/upgrader.go @@ -7,15 +7,14 @@ import ( "net" "time" + "github.com/libp2p/go-libp2p/core/connmgr" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + ipnet "github.com/libp2p/go-libp2p/core/pnet" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/net/pnet" - "github.com/libp2p/go-libp2p-core/connmgr" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - ipnet "github.com/libp2p/go-libp2p-core/pnet" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/transport" - manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/net/upgrader/upgrader_test.go b/p2p/net/upgrader/upgrader_test.go index be201eca..232dc9ae 100644 --- a/p2p/net/upgrader/upgrader_test.go +++ b/p2p/net/upgrader/upgrader_test.go @@ -6,21 +6,18 @@ import ( "net" "testing" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec/insecure" + "github.com/libp2p/go-libp2p/core/test" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/muxer/yamux" "github.com/libp2p/go-libp2p/p2p/net/upgrader" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec/insecure" - "github.com/libp2p/go-libp2p-core/test" - "github.com/libp2p/go-libp2p-core/transport" - - mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" - "github.com/golang/mock/gomock" + mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" ma "github.com/multiformats/go-multiaddr" - manet "github.com/multiformats/go-multiaddr/net" "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/circuitv1/relay/options.go b/p2p/protocol/circuitv1/relay/options.go index 22e04782..bfd2ed89 100644 --- a/p2p/protocol/circuitv1/relay/options.go +++ b/p2p/protocol/circuitv1/relay/options.go @@ -1,7 +1,7 @@ package relay import ( - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) type Resources struct { diff --git a/p2p/protocol/circuitv1/relay/relay.go b/p2p/protocol/circuitv1/relay/relay.go index 3c626bd0..3b6f7adc 100644 --- a/p2p/protocol/circuitv1/relay/relay.go +++ b/p2p/protocol/circuitv1/relay/relay.go @@ -8,13 +8,12 @@ import ( "sync/atomic" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" pb "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - logging "github.com/ipfs/go-log/v2" pool "github.com/libp2p/go-buffer-pool" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/protocol/circuitv2/client/client.go b/p2p/protocol/circuitv2/client/client.go index bdd9bf9e..aa302e7e 100644 --- a/p2p/protocol/circuitv2/client/client.go +++ b/p2p/protocol/circuitv2/client/client.go @@ -5,12 +5,11 @@ import ( "io" "sync" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - logging "github.com/ipfs/go-log/v2" ) diff --git a/p2p/protocol/circuitv2/client/conn.go b/p2p/protocol/circuitv2/client/conn.go index fcca1bea..23bde93d 100644 --- a/p2p/protocol/circuitv2/client/conn.go +++ b/p2p/protocol/circuitv2/client/conn.go @@ -5,8 +5,8 @@ import ( "net" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/protocol/circuitv2/client/dial.go b/p2p/protocol/circuitv2/client/dial.go index 4a1e0e6e..2e5fc73b 100644 --- a/p2p/protocol/circuitv2/client/dial.go +++ b/p2p/protocol/circuitv2/client/dial.go @@ -5,15 +5,14 @@ import ( "fmt" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" pbv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/pb" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/client/handlers.go b/p2p/protocol/circuitv2/client/handlers.go index fa338f8f..ef50b8e8 100644 --- a/p2p/protocol/circuitv2/client/handlers.go +++ b/p2p/protocol/circuitv2/client/handlers.go @@ -3,11 +3,10 @@ package client import ( "time" + "github.com/libp2p/go-libp2p/core/network" pbv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/pb" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" - - "github.com/libp2p/go-libp2p-core/network" ) var ( diff --git a/p2p/protocol/circuitv2/client/reservation.go b/p2p/protocol/circuitv2/client/reservation.go index aebcfe74..1cd451ad 100644 --- a/p2p/protocol/circuitv2/client/reservation.go +++ b/p2p/protocol/circuitv2/client/reservation.go @@ -5,15 +5,14 @@ import ( "fmt" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/record" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/record" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/client/reservation_test.go b/p2p/protocol/circuitv2/client/reservation_test.go index f2df0abd..c1abcc11 100644 --- a/p2p/protocol/circuitv2/client/reservation_test.go +++ b/p2p/protocol/circuitv2/client/reservation_test.go @@ -7,14 +7,13 @@ import ( "time" "github.com/libp2p/go-libp2p" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/circuitv2/client/transport.go b/p2p/protocol/circuitv2/client/transport.go index cd1c302d..97fc1ce1 100644 --- a/p2p/protocol/circuitv2/client/transport.go +++ b/p2p/protocol/circuitv2/client/transport.go @@ -5,11 +5,10 @@ import ( "fmt" "io" - "github.com/libp2p/go-libp2p-core/network" - - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/proto/voucher.go b/p2p/protocol/circuitv2/proto/voucher.go index fe8e3aee..fd50fccc 100644 --- a/p2p/protocol/circuitv2/proto/voucher.go +++ b/p2p/protocol/circuitv2/proto/voucher.go @@ -3,10 +3,9 @@ package proto import ( "time" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/record" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" - - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/record" ) const RecordDomain = "libp2p-relay-rsvp" diff --git a/p2p/protocol/circuitv2/proto/voucher_test.go b/p2p/protocol/circuitv2/proto/voucher_test.go index 148bd77a..643dd0a5 100644 --- a/p2p/protocol/circuitv2/proto/voucher_test.go +++ b/p2p/protocol/circuitv2/proto/voucher_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/record" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/record" ) func TestReservationVoucher(t *testing.T) { diff --git a/p2p/protocol/circuitv2/relay/acl.go b/p2p/protocol/circuitv2/relay/acl.go index 05010513..4191556a 100644 --- a/p2p/protocol/circuitv2/relay/acl.go +++ b/p2p/protocol/circuitv2/relay/acl.go @@ -1,7 +1,7 @@ package relay import ( - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/relay/compat_test.go b/p2p/protocol/circuitv2/relay/compat_test.go index 88252f01..693803f5 100644 --- a/p2p/protocol/circuitv2/relay/compat_test.go +++ b/p2p/protocol/circuitv2/relay/compat_test.go @@ -7,14 +7,13 @@ import ( "io" "testing" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay" compatv1 "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/relay/constraints.go b/p2p/protocol/circuitv2/relay/constraints.go index 1b0087ec..24353086 100644 --- a/p2p/protocol/circuitv2/relay/constraints.go +++ b/p2p/protocol/circuitv2/relay/constraints.go @@ -6,7 +6,8 @@ import ( "time" asnutil "github.com/libp2p/go-libp2p-asn-util" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" + ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/protocol/circuitv2/relay/constraints_test.go b/p2p/protocol/circuitv2/relay/constraints_test.go index 0eaaa680..352fe224 100644 --- a/p2p/protocol/circuitv2/relay/constraints_test.go +++ b/p2p/protocol/circuitv2/relay/constraints_test.go @@ -8,7 +8,8 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p-core/test" + "github.com/libp2p/go-libp2p/core/test" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/relay/relay.go b/p2p/protocol/circuitv2/relay/relay.go index 2ff153f3..5e2d9f18 100644 --- a/p2p/protocol/circuitv2/relay/relay.go +++ b/p2p/protocol/circuitv2/relay/relay.go @@ -8,15 +8,14 @@ import ( "sync/atomic" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/record" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/record" - logging "github.com/ipfs/go-log/v2" pool "github.com/libp2p/go-buffer-pool" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/protocol/circuitv2/relay/relay_test.go b/p2p/protocol/circuitv2/relay/relay_test.go index 78ed022c..33a85016 100644 --- a/p2p/protocol/circuitv2/relay/relay_test.go +++ b/p2p/protocol/circuitv2/relay/relay_test.go @@ -9,6 +9,12 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/metrics" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" bhost "github.com/libp2p/go-libp2p/p2p/host/blank" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" "github.com/libp2p/go-libp2p/p2p/net/swarm" @@ -17,13 +23,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay" "github.com/libp2p/go-libp2p/p2p/transport/tcp" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/metrics" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/circuitv2/util/pbconv.go b/p2p/protocol/circuitv2/util/pbconv.go index a5b73f62..ae1b9b50 100644 --- a/p2p/protocol/circuitv2/util/pbconv.go +++ b/p2p/protocol/circuitv2/util/pbconv.go @@ -3,11 +3,10 @@ package util import ( "errors" + "github.com/libp2p/go-libp2p/core/peer" pbv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/pb" pbv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/pb" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/holepunch/holepunch_test.go b/p2p/protocol/holepunch/holepunch_test.go index d4f68adb..5c364ff0 100644 --- a/p2p/protocol/holepunch/holepunch_test.go +++ b/p2p/protocol/holepunch/holepunch_test.go @@ -7,25 +7,21 @@ import ( "testing" "time" - "github.com/libp2p/go-libp2p/p2p/host/autorelay" - "github.com/libp2p/go-libp2p" - - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp2p/go-libp2p-testing/race" - + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/p2p/host/autorelay" relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay" "github.com/libp2p/go-libp2p/p2p/protocol/holepunch" holepunch_pb "github.com/libp2p/go-libp2p/p2p/protocol/holepunch/pb" "github.com/libp2p/go-libp2p/p2p/protocol/identify" - "github.com/libp2p/go-msgio/protoio" + ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" - "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/holepunch/holepuncher.go b/p2p/protocol/holepunch/holepuncher.go index 810608f2..7f2bbbd1 100644 --- a/p2p/protocol/holepunch/holepuncher.go +++ b/p2p/protocol/holepunch/holepuncher.go @@ -7,13 +7,12 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" pb "github.com/libp2p/go-libp2p/p2p/protocol/holepunch/pb" "github.com/libp2p/go-libp2p/p2p/protocol/identify" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-msgio/protoio" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/protocol/holepunch/svc.go b/p2p/protocol/holepunch/svc.go index 3bfff1dd..1df779fc 100644 --- a/p2p/protocol/holepunch/svc.go +++ b/p2p/protocol/holepunch/svc.go @@ -7,15 +7,14 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" pb "github.com/libp2p/go-libp2p/p2p/protocol/holepunch/pb" "github.com/libp2p/go-libp2p/p2p/protocol/identify" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" - logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-msgio/protoio" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/protocol/holepunch/tracer.go b/p2p/protocol/holepunch/tracer.go index 1512ba10..87aa6136 100644 --- a/p2p/protocol/holepunch/tracer.go +++ b/p2p/protocol/holepunch/tracer.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/holepunch/util.go b/p2p/protocol/holepunch/util.go index af707757..825f855e 100644 --- a/p2p/protocol/holepunch/util.go +++ b/p2p/protocol/holepunch/util.go @@ -3,9 +3,10 @@ package holepunch import ( "context" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index 8e520dea..4794619d 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -7,13 +7,13 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/record" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/record" "github.com/libp2p/go-libp2p/p2p/host/eventbus" pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb" diff --git a/p2p/protocol/identify/id_delta.go b/p2p/protocol/identify/id_delta.go index 467a101d..7f7c75f1 100644 --- a/p2p/protocol/identify/id_delta.go +++ b/p2p/protocol/identify/id_delta.go @@ -3,11 +3,10 @@ package identify import ( "time" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" - + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb" "github.com/libp2p/go-msgio/protoio" diff --git a/p2p/protocol/identify/id_glass_test.go b/p2p/protocol/identify/id_glass_test.go index de83d8be..e716f0a9 100644 --- a/p2p/protocol/identify/id_glass_test.go +++ b/p2p/protocol/identify/id_glass_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" blhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/identify/id_push.go b/p2p/protocol/identify/id_push.go index 1f644d1e..cbb47a9f 100644 --- a/p2p/protocol/identify/id_push.go +++ b/p2p/protocol/identify/id_push.go @@ -1,7 +1,7 @@ package identify import ( - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" ) // IDPush is the protocol.ID of the Identify push protocol. It sends full identify messages containing diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index ae6ed4b2..d86fc915 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -10,6 +10,15 @@ import ( "time" "github.com/libp2p/go-libp2p" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/libp2p/go-libp2p/core/record" + coretest "github.com/libp2p/go-libp2p/core/test" blhost "github.com/libp2p/go-libp2p/p2p/host/blank" "github.com/libp2p/go-libp2p/p2p/host/eventbus" "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" @@ -19,16 +28,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/protocol/identify" pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-libp2p-core/record" - coretest "github.com/libp2p/go-libp2p-core/test" - mockClock "github.com/benbjohnson/clock" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-msgio/protoio" diff --git a/p2p/protocol/identify/obsaddr.go b/p2p/protocol/identify/obsaddr.go index 31e72692..bd72175d 100644 --- a/p2p/protocol/identify/obsaddr.go +++ b/p2p/protocol/identify/obsaddr.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peerstore" "github.com/libp2p/go-libp2p/p2p/host/eventbus" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/protocol/identify/obsaddr_test.go b/p2p/protocol/identify/obsaddr_test.go index ea5dc0ae..aa347e59 100644 --- a/p2p/protocol/identify/obsaddr_test.go +++ b/p2p/protocol/identify/obsaddr_test.go @@ -5,16 +5,15 @@ import ( "testing" "time" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/p2p/host/eventbus" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" "github.com/libp2p/go-libp2p/p2p/protocol/identify" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/event" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/identify/pb/identify.pb.go b/p2p/protocol/identify/pb/identify.pb.go index 27d77f7c..3cfed827 100644 --- a/p2p/protocol/identify/pb/identify.pb.go +++ b/p2p/protocol/identify/pb/identify.pb.go @@ -5,10 +5,11 @@ package identify_pb import ( fmt "fmt" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. @@ -102,8 +103,8 @@ type Identify struct { // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers. - // see github.com/libp2p/go-libp2p-core/record/pb/envelope.proto and - // github.com/libp2p/go-libp2p-core/peer/pb/peer_record.proto for message definitions. + // see github.com/libp2p/go-libp2p/core/record/pb/envelope.proto and + // github.com/libp2p/go-libp2p/core/peer/pb/peer_record.proto for message definitions. SignedPeerRecord []byte `protobuf:"bytes,8,opt,name=signedPeerRecord" json:"signedPeerRecord,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` diff --git a/p2p/protocol/identify/pb/identify.proto b/p2p/protocol/identify/pb/identify.proto index afc85253..bdb28330 100644 --- a/p2p/protocol/identify/pb/identify.proto +++ b/p2p/protocol/identify/pb/identify.proto @@ -40,7 +40,7 @@ message Identify { // signedPeerRecord contains a serialized SignedEnvelope containing a PeerRecord, // signed by the sending node. It contains the same addresses as the listenAddrs field, but // in a form that lets us share authenticated addrs with other peers. - // see github.com/libp2p/go-libp2p-core/record/pb/envelope.proto and - // github.com/libp2p/go-libp2p-core/peer/pb/peer_record.proto for message definitions. + // see github.com/libp2p/go-libp2p/core/record/pb/envelope.proto and + // github.com/libp2p/go-libp2p/core/peer/pb/peer_record.proto for message definitions. optional bytes signedPeerRecord = 8; } diff --git a/p2p/protocol/identify/peer_loop.go b/p2p/protocol/identify/peer_loop.go index 5fd31258..af854933 100644 --- a/p2p/protocol/identify/peer_loop.go +++ b/p2p/protocol/identify/peer_loop.go @@ -7,11 +7,10 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/libp2p/go-libp2p-core/record" - + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" + "github.com/libp2p/go-libp2p/core/record" pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb" "github.com/libp2p/go-msgio/protoio" diff --git a/p2p/protocol/identify/peer_loop_test.go b/p2p/protocol/identify/peer_loop_test.go index c6bbbd3f..54fe63b2 100644 --- a/p2p/protocol/identify/peer_loop_test.go +++ b/p2p/protocol/identify/peer_loop_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" blhost "github.com/libp2p/go-libp2p/p2p/host/blank" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" ) diff --git a/p2p/protocol/internal/circuitv1-deprecated/conn.go b/p2p/protocol/internal/circuitv1-deprecated/conn.go index 82b86d15..19d2964e 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/conn.go +++ b/p2p/protocol/internal/circuitv1-deprecated/conn.go @@ -5,9 +5,9 @@ import ( "net" "time" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/protocol/internal/circuitv1-deprecated/dial.go b/p2p/protocol/internal/circuitv1-deprecated/dial.go index f454bcc0..acc1217c 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/dial.go +++ b/p2p/protocol/internal/circuitv1-deprecated/dial.go @@ -4,10 +4,10 @@ import ( "context" "fmt" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/internal/circuitv1-deprecated/relay.go b/p2p/protocol/internal/circuitv1-deprecated/relay.go index e468dd90..f3a491d2 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/relay.go +++ b/p2p/protocol/internal/circuitv1-deprecated/relay.go @@ -10,11 +10,11 @@ import ( pb "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated/pb" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" + "github.com/libp2p/go-libp2p/core/transport" pool "github.com/libp2p/go-buffer-pool" diff --git a/p2p/protocol/internal/circuitv1-deprecated/relay_test.go b/p2p/protocol/internal/circuitv1-deprecated/relay_test.go index 6e6f3b27..9b76cffc 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/relay_test.go +++ b/p2p/protocol/internal/circuitv1-deprecated/relay_test.go @@ -16,7 +16,7 @@ import ( . "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated" pb "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated/pb" - "github.com/libp2p/go-libp2p-core/host" + "github.com/libp2p/go-libp2p/core/host" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/protocol/internal/circuitv1-deprecated/transport.go b/p2p/protocol/internal/circuitv1-deprecated/transport.go index 39515876..d37b59b6 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/transport.go +++ b/p2p/protocol/internal/circuitv1-deprecated/transport.go @@ -4,8 +4,8 @@ import ( "fmt" "io" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/internal/circuitv1-deprecated/transport_test.go b/p2p/protocol/internal/circuitv1-deprecated/transport_test.go index 2dfa9df4..02b37161 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/transport_test.go +++ b/p2p/protocol/internal/circuitv1-deprecated/transport_test.go @@ -13,9 +13,9 @@ import ( swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" . "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peerstore" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/protocol/internal/circuitv1-deprecated/util.go b/p2p/protocol/internal/circuitv1-deprecated/util.go index c04326c6..966d9c59 100644 --- a/p2p/protocol/internal/circuitv1-deprecated/util.go +++ b/p2p/protocol/internal/circuitv1-deprecated/util.go @@ -6,7 +6,7 @@ import ( pb "github.com/libp2p/go-libp2p/p2p/protocol/internal/circuitv1-deprecated/pb" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" pool "github.com/libp2p/go-buffer-pool" "github.com/libp2p/go-msgio/protoio" diff --git a/p2p/protocol/ping/ping.go b/p2p/protocol/ping/ping.go index 2a977de4..583eea5c 100644 --- a/p2p/protocol/ping/ping.go +++ b/p2p/protocol/ping/ping.go @@ -12,9 +12,9 @@ import ( logging "github.com/ipfs/go-log/v2" pool "github.com/libp2p/go-buffer-pool" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" ) var log = logging.Logger("ping") diff --git a/p2p/protocol/ping/ping_test.go b/p2p/protocol/ping/ping_test.go index 51e7f18f..afda0816 100644 --- a/p2p/protocol/ping/ping_test.go +++ b/p2p/protocol/ping/ping_test.go @@ -5,12 +5,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/peer" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" "github.com/libp2p/go-libp2p/p2p/protocol/ping" - "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/security/noise/benchmark_test.go b/p2p/security/noise/benchmark_test.go index 0019eb9a..52454f59 100644 --- a/p2p/security/noise/benchmark_test.go +++ b/p2p/security/noise/benchmark_test.go @@ -10,8 +10,8 @@ import ( "golang.org/x/crypto/chacha20poly1305" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/sec" ) type testMode int diff --git a/p2p/security/noise/crypto_test.go b/p2p/security/noise/crypto_test.go index 87efb848..35837a5a 100644 --- a/p2p/security/noise/crypto_test.go +++ b/p2p/security/noise/crypto_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p/core/crypto" ) func TestEncryptAndDecrypt_InitToResp(t *testing.T) { diff --git a/p2p/security/noise/handshake.go b/p2p/security/noise/handshake.go index 504a2b15..b71d7ef8 100644 --- a/p2p/security/noise/handshake.go +++ b/p2p/security/noise/handshake.go @@ -15,8 +15,8 @@ import ( "github.com/libp2p/go-libp2p/p2p/security/noise/pb" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" "github.com/flynn/noise" "github.com/gogo/protobuf/proto" diff --git a/p2p/security/noise/session.go b/p2p/security/noise/session.go index 9770178a..a563e58b 100644 --- a/p2p/security/noise/session.go +++ b/p2p/security/noise/session.go @@ -9,8 +9,8 @@ import ( "github.com/flynn/noise" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" ) type secureSession struct { diff --git a/p2p/security/noise/session_test.go b/p2p/security/noise/session_test.go index ff2d69b5..85de01b2 100644 --- a/p2p/security/noise/session_test.go +++ b/p2p/security/noise/session_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p/core/crypto" "github.com/stretchr/testify/require" ) diff --git a/p2p/security/noise/session_transport.go b/p2p/security/noise/session_transport.go index b996d95b..b4414136 100644 --- a/p2p/security/noise/session_transport.go +++ b/p2p/security/noise/session_transport.go @@ -4,9 +4,9 @@ import ( "context" "net" - "github.com/libp2p/go-libp2p-core/canonicallog" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/libp2p/go-libp2p/core/canonicallog" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/security/noise/transport.go b/p2p/security/noise/transport.go index 689a5e12..f935b82a 100644 --- a/p2p/security/noise/transport.go +++ b/p2p/security/noise/transport.go @@ -4,10 +4,11 @@ import ( "context" "net" - "github.com/libp2p/go-libp2p-core/canonicallog" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/libp2p/go-libp2p/core/canonicallog" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + manet "github.com/multiformats/go-multiaddr/net" ) @@ -17,7 +18,7 @@ const ID = "/noise" var _ sec.SecureTransport = &Transport{} // Transport implements the interface sec.SecureTransport -// https://godoc.org/github.com/libp2p/go-libp2p-core/sec#SecureConn +// https://godoc.org/github.com/libp2p/go-libp2p/core/sec#SecureConn type Transport struct { localID peer.ID privateKey crypto.PrivKey diff --git a/p2p/security/noise/transport_test.go b/p2p/security/noise/transport_test.go index 4ce47613..5269be29 100644 --- a/p2p/security/noise/transport_test.go +++ b/p2p/security/noise/transport_test.go @@ -13,9 +13,9 @@ import ( "golang.org/x/crypto/chacha20poly1305" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/p2p/security/tls/cmd/tlsdiag/client.go b/p2p/security/tls/cmd/tlsdiag/client.go index 841a7385..7f1a7efe 100644 --- a/p2p/security/tls/cmd/tlsdiag/client.go +++ b/p2p/security/tls/cmd/tlsdiag/client.go @@ -10,7 +10,7 @@ import ( libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) func StartClient() error { diff --git a/p2p/security/tls/cmd/tlsdiag/key.go b/p2p/security/tls/cmd/tlsdiag/key.go index 557a485c..c192d221 100644 --- a/p2p/security/tls/cmd/tlsdiag/key.go +++ b/p2p/security/tls/cmd/tlsdiag/key.go @@ -4,7 +4,7 @@ import ( "crypto/rand" "fmt" - ic "github.com/libp2p/go-libp2p-core/crypto" + ic "github.com/libp2p/go-libp2p/core/crypto" ) func generateKey(keyType string) (priv ic.PrivKey, err error) { diff --git a/p2p/security/tls/cmd/tlsdiag/server.go b/p2p/security/tls/cmd/tlsdiag/server.go index 5f85bc72..16f51f4a 100644 --- a/p2p/security/tls/cmd/tlsdiag/server.go +++ b/p2p/security/tls/cmd/tlsdiag/server.go @@ -9,7 +9,7 @@ import ( libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/peer" ) func StartServer() error { diff --git a/p2p/security/tls/conn.go b/p2p/security/tls/conn.go index cf32fa45..6353eac8 100644 --- a/p2p/security/tls/conn.go +++ b/p2p/security/tls/conn.go @@ -3,9 +3,9 @@ package libp2ptls import ( "crypto/tls" - ci "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + ci "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" ) type conn struct { diff --git a/p2p/security/tls/crypto.go b/p2p/security/tls/crypto.go index 698cccf4..aa16b334 100644 --- a/p2p/security/tls/crypto.go +++ b/p2p/security/tls/crypto.go @@ -18,8 +18,8 @@ import ( "golang.org/x/sys/cpu" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" ) const certValidityPeriod = 100 * 365 * 24 * time.Hour // ~100 years diff --git a/p2p/security/tls/transport.go b/p2p/security/tls/transport.go index 90c71491..f6aa64f6 100644 --- a/p2p/security/tls/transport.go +++ b/p2p/security/tls/transport.go @@ -9,10 +9,11 @@ import ( "os" "runtime/debug" - "github.com/libp2p/go-libp2p-core/canonicallog" - ci "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + "github.com/libp2p/go-libp2p/core/canonicallog" + ci "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + manet "github.com/multiformats/go-multiaddr/net" ) diff --git a/p2p/security/tls/transport_test.go b/p2p/security/tls/transport_test.go index 1d272f0f..ef0009eb 100644 --- a/p2p/security/tls/transport_test.go +++ b/p2p/security/tls/transport_test.go @@ -20,9 +20,9 @@ import ( "testing" "time" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/p2p/test/backpressure/backpressure_test.go b/p2p/test/backpressure/backpressure_test.go index 20336f02..e7dfe91e 100644 --- a/p2p/test/backpressure/backpressure_test.go +++ b/p2p/test/backpressure/backpressure_test.go @@ -6,12 +6,11 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/protocol" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/protocol" - logging "github.com/ipfs/go-log/v2" "github.com/stretchr/testify/require" ) diff --git a/p2p/test/reconnects/reconnect_test.go b/p2p/test/reconnects/reconnect_test.go index 72523ffd..07e7f221 100644 --- a/p2p/test/reconnects/reconnect_test.go +++ b/p2p/test/reconnects/reconnect_test.go @@ -9,14 +9,13 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/protocol" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" - "github.com/stretchr/testify/require" ) diff --git a/p2p/test/resource-manager/echo.go b/p2p/test/resource-manager/echo.go index 90acec56..8689bab9 100644 --- a/p2p/test/resource-manager/echo.go +++ b/p2p/test/resource-manager/echo.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/libp2p/go-libp2p-core/host" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" logging "github.com/ipfs/go-log/v2" ) diff --git a/p2p/test/resource-manager/echo_test.go b/p2p/test/resource-manager/echo_test.go index f181cb10..cb26e918 100644 --- a/p2p/test/resource-manager/echo_test.go +++ b/p2p/test/resource-manager/echo_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/libp2p/go-libp2p" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/peerstore" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/peerstore" "github.com/stretchr/testify/require" ) diff --git a/p2p/test/resource-manager/rcmgr_test.go b/p2p/test/resource-manager/rcmgr_test.go index cd1c10bd..634b7253 100644 --- a/p2p/test/resource-manager/rcmgr_test.go +++ b/p2p/test/resource-manager/rcmgr_test.go @@ -10,11 +10,10 @@ import ( "time" "github.com/libp2p/go-libp2p" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/stretchr/testify/require" ) diff --git a/p2p/transport/quic/cmd/client/main.go b/p2p/transport/quic/cmd/client/main.go index 90355fe7..f8071b6e 100644 --- a/p2p/transport/quic/cmd/client/main.go +++ b/p2p/transport/quic/cmd/client/main.go @@ -8,9 +8,10 @@ import ( "log" "os" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/quic/cmd/server/main.go b/p2p/transport/quic/cmd/server/main.go index 066e981b..e6585137 100644 --- a/p2p/transport/quic/cmd/server/main.go +++ b/p2p/transport/quic/cmd/server/main.go @@ -7,10 +7,11 @@ import ( "log" "os" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/peer" - tpt "github.com/libp2p/go-libp2p-core/transport" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + tpt "github.com/libp2p/go-libp2p/core/transport" libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic" + ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/quic/conn.go b/p2p/transport/quic/conn.go index 778460c6..58537b6b 100644 --- a/p2p/transport/quic/conn.go +++ b/p2p/transport/quic/conn.go @@ -3,10 +3,10 @@ package libp2pquic import ( "context" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - tpt "github.com/libp2p/go-libp2p-core/transport" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + tpt "github.com/libp2p/go-libp2p/core/transport" "github.com/lucas-clemente/quic-go" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/transport/quic/conn_test.go b/p2p/transport/quic/conn_test.go index b409f4df..21d1855f 100644 --- a/p2p/transport/quic/conn_test.go +++ b/p2p/transport/quic/conn_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - tpt "github.com/libp2p/go-libp2p-core/transport" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + tpt "github.com/libp2p/go-libp2p/core/transport" mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" @@ -27,7 +27,7 @@ import ( "github.com/stretchr/testify/require" ) -//go:generate sh -c "mockgen -package libp2pquic -destination mock_connection_gater_test.go github.com/libp2p/go-libp2p-core/connmgr ConnectionGater && goimports -w mock_connection_gater_test.go" +//go:generate sh -c "mockgen -package libp2pquic -destination mock_connection_gater_test.go github.com/libp2p/go-libp2p/core/connmgr ConnectionGater && goimports -w mock_connection_gater_test.go" func createPeer(t *testing.T) (peer.ID, ic.PrivKey) { var priv ic.PrivKey diff --git a/p2p/transport/quic/listener.go b/p2p/transport/quic/listener.go index 955c0f6c..ddf18441 100644 --- a/p2p/transport/quic/listener.go +++ b/p2p/transport/quic/listener.go @@ -5,13 +5,12 @@ import ( "crypto/tls" "net" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + tpt "github.com/libp2p/go-libp2p/core/transport" p2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - tpt "github.com/libp2p/go-libp2p-core/transport" - "github.com/lucas-clemente/quic-go" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/quic/listener_test.go b/p2p/transport/quic/listener_test.go index 7a72f76c..7c8494ae 100644 --- a/p2p/transport/quic/listener_test.go +++ b/p2p/transport/quic/listener_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - tpt "github.com/libp2p/go-libp2p-core/transport" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + tpt "github.com/libp2p/go-libp2p/core/transport" "github.com/lucas-clemente/quic-go" ma "github.com/multiformats/go-multiaddr" diff --git a/p2p/transport/quic/mock_connection_gater_test.go b/p2p/transport/quic/mock_connection_gater_test.go index 3a2cdcdb..4ee40085 100644 --- a/p2p/transport/quic/mock_connection_gater_test.go +++ b/p2p/transport/quic/mock_connection_gater_test.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/libp2p/go-libp2p-core/connmgr (interfaces: ConnectionGater) +// Source: github.com/libp2p/go-libp2p/core/connmgr (interfaces: ConnectionGater) // Package libp2pquic is a generated GoMock package. package libp2pquic @@ -8,9 +8,9 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - control "github.com/libp2p/go-libp2p-core/control" - network "github.com/libp2p/go-libp2p-core/network" - peer "github.com/libp2p/go-libp2p-core/peer" + control "github.com/libp2p/go-libp2p/core/control" + network "github.com/libp2p/go-libp2p/core/network" + peer "github.com/libp2p/go-libp2p/core/peer" multiaddr "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/quic/stream.go b/p2p/transport/quic/stream.go index 883b0cc3..5d276dab 100644 --- a/p2p/transport/quic/stream.go +++ b/p2p/transport/quic/stream.go @@ -3,7 +3,7 @@ package libp2pquic import ( "errors" - "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p/core/network" "github.com/lucas-clemente/quic-go" ) diff --git a/p2p/transport/quic/transport.go b/p2p/transport/quic/transport.go index cee7b137..3702c505 100644 --- a/p2p/transport/quic/transport.go +++ b/p2p/transport/quic/transport.go @@ -12,15 +12,14 @@ import ( "golang.org/x/crypto/hkdf" + "github.com/libp2p/go-libp2p/core/connmgr" + ic "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/pnet" + tpt "github.com/libp2p/go-libp2p/core/transport" p2ptls "github.com/libp2p/go-libp2p/p2p/security/tls" - "github.com/libp2p/go-libp2p-core/connmgr" - ic "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/pnet" - tpt "github.com/libp2p/go-libp2p-core/transport" - ma "github.com/multiformats/go-multiaddr" mafmt "github.com/multiformats/go-multiaddr-fmt" manet "github.com/multiformats/go-multiaddr/net" diff --git a/p2p/transport/quic/transport_test.go b/p2p/transport/quic/transport_test.go index 64bf24e0..26cabbd7 100644 --- a/p2p/transport/quic/transport_test.go +++ b/p2p/transport/quic/transport_test.go @@ -11,13 +11,12 @@ import ( "net" "testing" - "github.com/stretchr/testify/require" - - ic "github.com/libp2p/go-libp2p-core/crypto" - tpt "github.com/libp2p/go-libp2p-core/transport" - ma "github.com/multiformats/go-multiaddr" + ic "github.com/libp2p/go-libp2p/core/crypto" + tpt "github.com/libp2p/go-libp2p/core/transport" "github.com/lucas-clemente/quic-go" + ma "github.com/multiformats/go-multiaddr" + "github.com/stretchr/testify/require" ) func getTransport(t *testing.T) tpt.Transport { diff --git a/p2p/transport/tcp/tcp.go b/p2p/transport/tcp/tcp.go index 120feee8..9e6f5386 100644 --- a/p2p/transport/tcp/tcp.go +++ b/p2p/transport/tcp/tcp.go @@ -9,12 +9,11 @@ import ( "syscall" "time" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/net/reuseport" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" - logging "github.com/ipfs/go-log/v2" ma "github.com/multiformats/go-multiaddr" mafmt "github.com/multiformats/go-multiaddr-fmt" diff --git a/p2p/transport/tcp/tcp_test.go b/p2p/transport/tcp/tcp_test.go index 9874cade..d4004961 100644 --- a/p2p/transport/tcp/tcp_test.go +++ b/p2p/transport/tcp/tcp_test.go @@ -5,23 +5,21 @@ import ( "errors" "testing" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/sec/insecure" + "github.com/libp2p/go-libp2p/core/transport" "github.com/libp2p/go-libp2p/p2p/muxer/yamux" csms "github.com/libp2p/go-libp2p/p2p/net/conn-security-multistream" tptu "github.com/libp2p/go-libp2p/p2p/net/upgrader" ttransport "github.com/libp2p/go-libp2p/p2p/transport/testsuite" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/sec/insecure" - "github.com/libp2p/go-libp2p-core/transport" - mocknetwork "github.com/libp2p/go-libp2p-testing/mocks/network" - ma "github.com/multiformats/go-multiaddr" - "github.com/golang/mock/gomock" + ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" ) diff --git a/p2p/transport/testsuite/stream_suite.go b/p2p/transport/testsuite/stream_suite.go index 439fd068..b139976b 100644 --- a/p2p/transport/testsuite/stream_suite.go +++ b/p2p/transport/testsuite/stream_suite.go @@ -15,10 +15,10 @@ import ( crand "crypto/rand" mrand "math/rand" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" "github.com/libp2p/go-libp2p-testing/race" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/testsuite/transport_suite.go b/p2p/transport/testsuite/transport_suite.go index bba97474..bd8892e8 100644 --- a/p2p/transport/testsuite/transport_suite.go +++ b/p2p/transport/testsuite/transport_suite.go @@ -8,8 +8,8 @@ import ( "sync" "testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/testsuite/utils_suite.go b/p2p/transport/testsuite/utils_suite.go index 201d43d9..5e488397 100644 --- a/p2p/transport/testsuite/utils_suite.go +++ b/p2p/transport/testsuite/utils_suite.go @@ -5,8 +5,8 @@ import ( "runtime" "testing" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/transport/websocket/websocket.go b/p2p/transport/websocket/websocket.go index af74ccfb..42c4c618 100644 --- a/p2p/transport/websocket/websocket.go +++ b/p2p/transport/websocket/websocket.go @@ -7,9 +7,9 @@ import ( "net/http" "time" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/transport" ma "github.com/multiformats/go-multiaddr" mafmt "github.com/multiformats/go-multiaddr-fmt" diff --git a/p2p/transport/websocket/websocket_test.go b/p2p/transport/websocket/websocket_test.go index 167fe31c..77dda801 100644 --- a/p2p/transport/websocket/websocket_test.go +++ b/p2p/transport/websocket/websocket_test.go @@ -14,19 +14,18 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/go-libp2p/core/sec" + "github.com/libp2p/go-libp2p/core/sec/insecure" + "github.com/libp2p/go-libp2p/core/test" + "github.com/libp2p/go-libp2p/core/transport" + "github.com/libp2p/go-libp2p/p2p/muxer/yamux" csms "github.com/libp2p/go-libp2p/p2p/net/conn-security-multistream" tptu "github.com/libp2p/go-libp2p/p2p/net/upgrader" ttransport "github.com/libp2p/go-libp2p/p2p/transport/testsuite" - "github.com/libp2p/go-libp2p-core/crypto" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/sec" - "github.com/libp2p/go-libp2p-core/sec/insecure" - "github.com/libp2p/go-libp2p-core/test" - "github.com/libp2p/go-libp2p-core/transport" - "github.com/libp2p/go-libp2p/p2p/muxer/yamux" - ma "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" )