diff --git a/alias.go b/alias.go index 7cca5dcc1a8d45a4fb3a3a9cdc5d4cded9a8fb37..98780587bea66d20741ebb43c798db693ed3c324 100644 --- a/alias.go +++ b/alias.go @@ -1,15 +1,15 @@ -// Package core provides convenient access to foundational, central go-libp2p primitives via type aliases. +// Package core provides convenient access to foundational, central go-p2p primitives via type aliases. package core import ( - "github.com/multiformats/go-multiaddr" + "gitlab.dms3.io/mf/go-multiaddr" "gitlab.dms3.io/p2p/go-p2p-core/host" "gitlab.dms3.io/p2p/go-p2p-core/network" "gitlab.dms3.io/p2p/go-p2p-core/peer" "gitlab.dms3.io/p2p/go-p2p-core/protocol" ) -// Multiaddr aliases the Multiaddr type from github.com/multiformats/go-multiaddr. +// Multiaddr aliases the Multiaddr type from gitlab.dms3.io/mf/go-multiaddr. // // Refer to the docs on that type for more info. type Multiaddr = multiaddr.Multiaddr diff --git a/connmgr/gater.go b/connmgr/gater.go index 10f4ad063689c39b1a2eaffbbf17df9d3d8b91a5..28876edbec06bcd54588f1905e384963de247245 100644 --- a/connmgr/gater.go +++ b/connmgr/gater.go @@ -1,7 +1,7 @@ package connmgr import ( - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" "gitlab.dms3.io/p2p/go-p2p-core/control" "gitlab.dms3.io/p2p/go-p2p-core/network" @@ -34,7 +34,7 @@ import ( // 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, +// p2p has finished upgrading the connection entirely to a secure, // multiplexed channel. // // This interface can be used to implement *strict/active* connection management @@ -85,6 +85,6 @@ type ConnectionGater interface { // When rejecting a connection, the gater can return a DisconnectReason. // Refer to the godoc on the ConnectionGater type for more information. // - // NOTE: the go-libp2p implementation currently IGNORES the disconnect reason. + // NOTE: the go-p2p implementation currently IGNORES the disconnect reason. InterceptUpgraded(network.Conn) (allow bool, reason control.DisconnectReason) } diff --git a/connmgr/manager.go b/connmgr/manager.go index 46de0f4814a49a067d5087eeaab7efb58a8603f7..9b1b883abaf4ca06ef78445466d0e15cd3503c66 100644 --- a/connmgr/manager.go +++ b/connmgr/manager.go @@ -1,6 +1,6 @@ -// Package connmgr provides connection tracking and management interfaces for libp2p. +// Package connmgr provides connection tracking and management interfaces for p2p. // -// The ConnManager interface exported from this package allows libp2p to enforce an +// The ConnManager interface exported from this package allows p2p to enforce an // upper bound on the total number of open connections. To avoid service disruptions, // connections can be tagged with metadata and optionally "protected" to ensure that // essential connections are not arbitrarily cut. @@ -25,7 +25,7 @@ func SupportsDecay(mgr ConnManager) (Decayer, bool) { // metadata with each peer. // // It enables connections to be trimmed based on implementation-defined -// heuristics. The ConnManager allows libp2p to enforce an upper bound on the +// heuristics. The ConnManager allows p2p to enforce an upper bound on the // total number of open connections. // // ConnManagers supporting decaying tags implement Decayer. Use the diff --git a/crypto/fixture_test.go b/crypto/fixture_test.go index 8cec7c53ad2f475a5bcf310f1dc7fcd654b1fd3c..8245c3072857c7eda2396b15ed4fc0a991e701e9 100644 --- a/crypto/fixture_test.go +++ b/crypto/fixture_test.go @@ -12,7 +12,7 @@ import ( crypto_pb "gitlab.dms3.io/p2p/go-p2p-core/crypto/pb" ) -var message = []byte("Libp2p is the _best_!") +var message = []byte("P2p is the _best_!") type testCase struct { keyType crypto_pb.KeyType diff --git a/crypto/key.go b/crypto/key.go index 5fa0a90b8a0f76cb8b89243efd4e9d916948acbf..c5f8e49b04e99d5ff82978678e71c66902d70af2 100644 --- a/crypto/key.go +++ b/crypto/key.go @@ -1,4 +1,4 @@ -// Package crypto implements various cryptographic utilities used by libp2p. +// Package crypto implements various cryptographic utilities used by p2p. // This includes a Public and Private key interface and key implementations // for supported key algorithms. package crypto @@ -77,7 +77,7 @@ type Key interface { Equals(Key) bool // Raw returns the raw bytes of the key (not wrapped in the - // libp2p-crypto protobuf). + // p2p-crypto protobuf). // // This function is the inverse of {Priv,Pub}KeyUnmarshaler. Raw() ([]byte, error) diff --git a/crypto/key_not_openssl.go b/crypto/key_not_openssl.go index 1499feaab78aa35039d93b940682d73d9e9a2b75..82f6c785b413477a668f87f1e13ffc0b87d1efef 100644 --- a/crypto/key_not_openssl.go +++ b/crypto/key_not_openssl.go @@ -11,7 +11,7 @@ import ( btcec "github.com/btcsuite/btcd/btcec" ) -// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys +// KeyPairFromStdKey wraps standard library (and secp256k1) private keys in p2p/go-p2p-core/crypto keys func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { if priv == nil { return nil, nil, ErrNilPrivateKey @@ -39,7 +39,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 p2p/go-p2p-core/crypto private keys to standard library (and secp256k1) private keys func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { if priv == nil { return nil, ErrNilPrivateKey @@ -59,7 +59,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 p2p/go-p2p-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/crypto/key_openssl.go b/crypto/key_openssl.go index 198f0d511934fb85eac9193461a232253ec00f6e..df6c83eb59656e34f94250cf89bee2ae162195ce 100644 --- a/crypto/key_openssl.go +++ b/crypto/key_openssl.go @@ -13,7 +13,7 @@ import ( openssl "gitlab.dms3.io/p2p/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 p2p/go-p2p-core/crypto keys func KeyPairFromStdKey(priv crypto.PrivateKey) (PrivKey, PubKey, error) { if priv == nil { return nil, nil, ErrNilPrivateKey @@ -46,7 +46,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 p2p/go-p2p-core/crypto private keys to standard library (and secp256k1) private keys func PrivKeyToStdKey(priv PrivKey) (crypto.PrivateKey, error) { if priv == nil { return nil, ErrNilPrivateKey @@ -69,7 +69,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 p2p/go-p2p-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/crypto/rsa_common.go b/crypto/rsa_common.go index c7e305439a3ae20592d59f8249a073e0a3b53a47..b44f2d378d491119a994a3e135ee05cc2030ccbb 100644 --- a/crypto/rsa_common.go +++ b/crypto/rsa_common.go @@ -8,7 +8,7 @@ import ( // WeakRsaKeyEnv is an environment variable which, when set, lowers the // minimum required bits of RSA keys to 512. This should be used exclusively in // test situations. -const WeakRsaKeyEnv = "LIBP2P_ALLOW_WEAK_RSA_KEYS" +const WeakRsaKeyEnv = "P2P_ALLOW_WEAK_RSA_KEYS" var MinRsaKeyBits = 2048 diff --git a/discovery/discovery.go b/discovery/discovery.go index 8200967a071e8648c2eb7aafb7eab64b4b75270b..31f08e86dbfd679ecfcf760a8150bdbb6e112782 100644 --- a/discovery/discovery.go +++ b/discovery/discovery.go @@ -1,4 +1,4 @@ -// Package discovery provides service advertisement and peer discovery interfaces for libp2p. +// Package discovery provides service advertisement and peer discovery interfaces for p2p. package discovery import ( diff --git a/event/addrs.go b/event/addrs.go index a6de95db750ad9363ba373b1894debf078f883a2..258287735925ab19b78901368c2fab8f45402560 100644 --- a/event/addrs.go +++ b/event/addrs.go @@ -1,7 +1,7 @@ package event import ( - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" "gitlab.dms3.io/p2p/go-p2p-core/record" ) diff --git a/event/doc.go b/event/doc.go index 3a070f3afb8d7f91c325c156b501844f24416b71..bcae2b629a32e47565e4825c4125efbd3fe83b9f 100644 --- a/event/doc.go +++ b/event/doc.go @@ -1,5 +1,5 @@ // Package event contains the abstractions for a local event bus, along with the standard events -// that libp2p subsystems may emit. +// that p2p subsystems may emit. // // Source code is arranged as follows: // * doc.go: this file. diff --git a/event/network.go b/event/network.go index 3604ebfb6f71495a24819bb9b6ec224a646c4762..2bef0dd964f33e29bbd00cdb92fed67228e45b7f 100644 --- a/event/network.go +++ b/event/network.go @@ -20,7 +20,7 @@ import ( // Take note: // // * It's possible to have _multiple_ connections to a given peer. -// * Both libp2p and networks are asynchronous. +// * Both p2p and networks are asynchronous. // // This means that all of the following situations are possible: // diff --git a/go.mod b/go.mod index 8fa713315298cfa13902c870cba352b296821374..17bd4ddb9044cfa3e2d9be3e8d1a3cfb9fd98af0 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,10 @@ require ( github.com/jbenet/goprocess v0.1.4 github.com/minio/sha256-simd v0.1.1 github.com/mr-tron/base58 v1.2.0 - github.com/multiformats/go-multiaddr v0.2.2 github.com/multiformats/go-multihash v0.0.14 github.com/multiformats/go-varint v0.0.6 - gitlab.dms3.io/dms3/public/go-cid v0.0.1 + gitlab.dms3.io/dms3/public/go-cid v0.0.2 + gitlab.dms3.io/mf/go-multiaddr v0.0.1 gitlab.dms3.io/p2p/go-buffer-pool v0.0.1 gitlab.dms3.io/p2p/go-flow-metrics v0.0.1 gitlab.dms3.io/p2p/go-msgio v0.0.1 diff --git a/go.sum b/go.sum index c350fbdf72f7d58f83a560dc3e11feac545206e8..638ee57c7c0ad4580b9360ff2e1c4321d6fcdc17 100644 --- a/go.sum +++ b/go.sum @@ -28,6 +28,8 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= +github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= @@ -49,8 +51,6 @@ github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= -github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= @@ -69,8 +69,10 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -gitlab.dms3.io/dms3/public/go-cid v0.0.1 h1:qs4dtkDigcLGY/58dIZaFjKLt+orrTcmTBvtqaM3570= -gitlab.dms3.io/dms3/public/go-cid v0.0.1/go.mod h1:GQw3gc4CSrFY+aX6M+OBQDlg0p5/eQJoRrayaZzkAOQ= +gitlab.dms3.io/dms3/public/go-cid v0.0.2 h1:DLI843W/j0Khbx2gLo1B+8YZPGybMeK5k6R8cSOxvr0= +gitlab.dms3.io/dms3/public/go-cid v0.0.2/go.mod h1:GQw3gc4CSrFY+aX6M+OBQDlg0p5/eQJoRrayaZzkAOQ= +gitlab.dms3.io/mf/go-multiaddr v0.0.1 h1:S8EH0XxrdRuiStoHuUqAIXmH61CHj+2o9iUHnWquSEM= +gitlab.dms3.io/mf/go-multiaddr v0.0.1/go.mod h1:LkClkC8aQ02IXWapAj5JrTqdZBPKslSvVzG2z9LPNss= gitlab.dms3.io/p2p/go-buffer-pool v0.0.1 h1:2IUBfHOWOarILKvoF1NHnfSUD5MMI/g6f64ZTUwacoA= gitlab.dms3.io/p2p/go-buffer-pool v0.0.1/go.mod h1:M+a5uWIUEkiKihMm5+IL0+pqzG6G7mcD6nNWosKUKO0= gitlab.dms3.io/p2p/go-flow-metrics v0.0.1 h1:Elax0cR4SUGUMMS9GfCzDHByNRPKUkG4YEAOv7gEHuY= diff --git a/host/host.go b/host/host.go index 8edb9e703f79d6f377b7c3dc4d0abcc18552d4e6..de82d78d915749c3c7ebb8fb9c4ebc86a089e9cd 100644 --- a/host/host.go +++ b/host/host.go @@ -1,6 +1,6 @@ -// Package host provides the core Host interface for libp2p. +// Package host provides the core Host interface for p2p. // -// Host represents a single libp2p node in a peer-to-peer network. +// Host represents a single p2p node in a peer-to-peer network. package host import ( @@ -14,7 +14,7 @@ import ( "gitlab.dms3.io/p2p/go-p2p-core/peerstore" "gitlab.dms3.io/p2p/go-p2p-core/protocol" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // Host is an object participating in a p2p network, which diff --git a/introspection/doc.go b/introspection/doc.go index 302c23f4cbceb194e4c0f286355085cbbce4e390..31ee359975c8a698909db67490cde60ea51730c5 100644 --- a/introspection/doc.go +++ b/introspection/doc.go @@ -1,7 +1,7 @@ // Package introspection is EXPERIMENTAL. It is subject to heavy change, and it // WILL change. For now, it is the simplest implementation to power the -// proof-of-concept of the libp2p introspection framework. +// proof-of-concept of the p2p introspection framework. // // Package introspect contains the abstract skeleton of the introspection system -// of go-libp2p, and holds the introspection data schema. +// of go-p2p, and holds the introspection data schema. package introspection diff --git a/introspection/endpoint.go b/introspection/endpoint.go index 51596a4644c03e5301f95a87ad6ab17b66a74d10..5056486f9c0e2b7eb55c9ffeb27c03226dfed555 100644 --- a/introspection/endpoint.go +++ b/introspection/endpoint.go @@ -3,7 +3,7 @@ package introspection // Endpoint is the interface to be implemented by introspection endpoints. // // An introspection endpoint makes introspection data accessible to external -// consumers, over, for example, WebSockets, or TCP, or libp2p itself. +// consumers, over, for example, WebSockets, or TCP, or p2p itself. // // Experimental. type Endpoint interface { diff --git a/introspection/pb/doc.go b/introspection/pb/doc.go index 58f6c50db22cd77a4b041502c90821394fa35853..546dd0c07fb68dc70294656b49634a35cd356d12 100644 --- a/introspection/pb/doc.go +++ b/introspection/pb/doc.go @@ -1,3 +1,3 @@ -// Package introspection/pb contains the protobuf definitions and objects for -// that form the libp2p introspection protocol. package pb +// Package introspection/pb contains the protobuf definitions and objects for +// that form the p2p introspection protocol. diff --git a/introspection/pb/introspection.pb.go b/introspection/pb/introspection.pb.go index 6af5361dad80f599669c3fa9e07768eb24062951..037adcf82d808e5115183adf29f1c22fa1a8dffc 100644 --- a/introspection/pb/introspection.pb.go +++ b/introspection/pb/introspection.pb.go @@ -5,10 +5,11 @@ package 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. @@ -704,7 +705,7 @@ func (m *EventType_EventProperty) GetHasMultiple() bool { // Runtime encapsulates runtime info about a node. type Runtime struct { - // e.g. go-libp2p, js-libp2p, rust-libp2p, etc. + // e.g. go-p2p, js-p2p, rust-p2p, etc. Implementation string `protobuf:"bytes,1,opt,name=implementation,proto3" json:"implementation,omitempty"` // e.g. 1.2.3. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` @@ -952,7 +953,7 @@ func (m *StreamList) GetStreams() []*Stream { return nil } -// Connection reports metrics and state of a libp2p connection. +// Connection reports metrics and state of a p2p connection. type Connection struct { // the id of this connection, not to be shown in user tooling, // used for (cross)referencing connections (e.g. relay). @@ -1269,7 +1270,7 @@ func (m *Connection_Attributes) GetEncryption() string { return "" } -// Stream reports metrics and state of a libp2p stream. +// Stream reports metrics and state of a p2p stream. type Stream struct { // the id of this stream, not to be shown in user tooling, // used for (cross)referencing streams. @@ -1886,7 +1887,7 @@ func (m *DHT_QueryGauge) GetTimeout() uint64 { return 0 } -// Subsystems encapsulates all instrumented subsystems for a libp2p host. +// Subsystems encapsulates all instrumented subsystems for a p2p host. type Subsystems struct { // connections data, source agnostic but currently only supports the Swarm subsystem Connections []*Connection `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"` diff --git a/metrics/bandwidth.go b/metrics/bandwidth.go index 314f50d64913a56459fd945956c66f33ca54c577..ae75bef058aa091292009ece6b277c962926f37c 100644 --- a/metrics/bandwidth.go +++ b/metrics/bandwidth.go @@ -1,4 +1,4 @@ -// Package metrics provides metrics collection and reporting interfaces for libp2p. +// Package metrics provides metrics collection and reporting interfaces for p2p. package metrics import ( diff --git a/metrics/reporter.go b/metrics/reporter.go index c3e89f32a00d64bc33b7e1515d4adf070e4adbf6..a7e822d75a99b426d55d5dc9416fd03bc3ad6a60 100644 --- a/metrics/reporter.go +++ b/metrics/reporter.go @@ -1,4 +1,4 @@ -// Package metrics provides metrics collection and reporting interfaces for libp2p. +// Package metrics provides metrics collection and reporting interfaces for p2p. package metrics import ( diff --git a/mux/mux.go b/mux/mux.go index 09dc31a8e05c5a4cd96be7178c6cab6f8c83900d..9639ecbaa5c7ec74ef3544002101bd3a7165b1b6 100644 --- a/mux/mux.go +++ b/mux/mux.go @@ -1,7 +1,7 @@ -// Package mux provides stream multiplexing interfaces for libp2p. +// Package mux provides stream multiplexing interfaces for p2p. // -// For a conceptual overview of stream multiplexing in libp2p, see -// https://docs.libp2p.io/concepts/stream-multiplexing/ +// For a conceptual overview of stream multiplexing in p2p, see +// https://docs.p2p.io/concepts/stream-multiplexing/ package mux import ( @@ -76,7 +76,7 @@ var NoopHandler = func(s MuxedStream) { s.Reset() } // // Together with network.ConnSecurity, MuxedConn is a component of the // transport.CapableConn interface, which represents a "raw" network -// connection that has been "upgraded" to support the libp2p capabilities +// connection that has been "upgraded" to support the p2p capabilities // of secure communication and stream multiplexing. type MuxedConn interface { // Close closes the stream muxer and the the underlying net.Conn. diff --git a/network/conn.go b/network/conn.go index 4f5ecebe6d052ad9bc84b4ae6133c39d647eacb4..aaf714a7712f206d311227d14a1e79d94276e367 100644 --- a/network/conn.go +++ b/network/conn.go @@ -7,7 +7,7 @@ import ( ic "gitlab.dms3.io/p2p/go-p2p-core/crypto" "gitlab.dms3.io/p2p/go-p2p-core/peer" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // Conn is a connection to a remote peer. It multiplexes streams. diff --git a/network/nattype.go b/network/nattype.go index bc95d68703d34086221a48ad74a4bfc7295c8373..e969309eb011bbcaeb39948cfc33f74791285222 100644 --- a/network/nattype.go +++ b/network/nattype.go @@ -19,7 +19,7 @@ const ( // NATDeviceTypeSymmetric indicates that the NAT device is a Symmetric NAT. // A Symmetric NAT maps outgoing connections with different destination addresses to different IP addresses and ports, // even if they originate from the same source IP address and port. - // NAT traversal with hole-punching is currently NOT possible in libp2p with Symmetric NATs irrespective of the remote peer's NAT type. + // NAT traversal with hole-punching is currently NOT possible in p2p with Symmetric NATs irrespective of the remote peer's NAT type. NATDeviceTypeSymmetric ) diff --git a/network/network.go b/network/network.go index eb5ab038222fc6c7746f6ed34055196a2e1f292c..466c9ca6899fd2d92196429c5d783781a15d10fc 100644 --- a/network/network.go +++ b/network/network.go @@ -1,7 +1,7 @@ -// Package network provides core networking abstractions for libp2p. +// Package network provides core networking abstractions for p2p. // // The network package provides the high-level Network interface for interacting -// with other libp2p peers, which is the primary public API for initiating and +// with other p2p peers, which is the primary public API for initiating and // accepting connections to remote peers. package network @@ -14,7 +14,7 @@ import ( "gitlab.dms3.io/p2p/go-p2p-core/peer" "gitlab.dms3.io/p2p/go-p2p-core/peerstore" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // MessageSizeMax is a soft (recommended) maximum for network messages. diff --git a/network/notifee.go b/network/notifee.go index 10ef72f1e1b3dabdf6ab6365a26e26e52c5257a7..fb37f22e4e28a3a74adc5b86202686498f434442 100644 --- a/network/notifee.go +++ b/network/notifee.go @@ -1,7 +1,7 @@ package network import ( - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // Notifiee is an interface for an object wishing to receive diff --git a/network/notifee_test.go b/network/notifee_test.go index 1948074a39ce45a98a2971eeac2c3ed45e974aaa..c2e35d3ccde2a6075863e67c96619c3ba4c2f1a5 100644 --- a/network/notifee_test.go +++ b/network/notifee_test.go @@ -3,7 +3,7 @@ package network import ( "testing" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) func TestListen(T *testing.T) { diff --git a/network/stream.go b/network/stream.go index 66b199f05b7fa2c37e52516f6f15c1520098d8f8..1af476a11523e4a6b57a07926899c780efd02d75 100644 --- a/network/stream.go +++ b/network/stream.go @@ -6,7 +6,7 @@ import ( ) // Stream represents a bidirectional channel between two agents in -// a libp2p network. "agent" is as granular as desired, potentially +// a p2p network. "agent" is as granular as desired, potentially // being a "request -> reply" pair, or whole protocols. // // Streams are backed by a multiplexer underneath the hood. diff --git a/peer/addrinfo.go b/peer/addrinfo.go index 175b93e472377b5bc13db0886043ce2dba5d035f..c60475a45cdeac8b7d26c162544ae5a4bda7b520 100644 --- a/peer/addrinfo.go +++ b/peer/addrinfo.go @@ -3,7 +3,7 @@ package peer import ( "fmt" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // AddrInfo is a small struct used to pass around a peer with diff --git a/peer/addrinfo_serde.go b/peer/addrinfo_serde.go index cef144fbe53c923ac53d557425419502999d7174..30fd20b77b005ba5df8767c8ddf68ef93a7f5074 100644 --- a/peer/addrinfo_serde.go +++ b/peer/addrinfo_serde.go @@ -3,7 +3,7 @@ package peer import ( "encoding/json" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // Helper struct for decoding as we can't unmarshal into an interface (Multiaddr). diff --git a/peer/addrinfo_test.go b/peer/addrinfo_test.go index 5c9f2af5c32d138f4cef1d7462739acc74b14ed3..357b1bc175be9a0702ca9142ae61b4fdbcc164ba 100644 --- a/peer/addrinfo_test.go +++ b/peer/addrinfo_test.go @@ -3,7 +3,7 @@ package peer_test import ( "testing" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" . "gitlab.dms3.io/p2p/go-p2p-core/peer" ) @@ -92,13 +92,13 @@ func TestAddrInfosFromP2pAddrs(t *testing.T) { } addrs := []ma.Multiaddr{ - ma.StringCast("/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"), - ma.StringCast("/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"), + ma.StringCast("/ip4/128.199.219.111/tcp/4001/dms3/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"), + ma.StringCast("/ip4/104.236.76.40/tcp/4001/dms3/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"), - ma.StringCast("/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"), - ma.StringCast("/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"), + ma.StringCast("/dms3/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"), + ma.StringCast("/ip4/178.62.158.247/tcp/4001/dms3/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"), - ma.StringCast("/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM"), + ma.StringCast("/dms3/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM"), } expected := map[string][]ma.Multiaddr{ "QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64": { diff --git a/peer/pb/peer_record.pb.go b/peer/pb/peer_record.pb.go index dd0755ef72e6ddde707d2aa05ee83f166d977001..080a694cfb9424464b60ea9f375248c6f01cef8a 100644 --- a/peer/pb/peer_record.pb.go +++ b/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,10 +29,10 @@ 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://gitlab.dms3.io/p2p/go-p2p-core/record/pb/envelope.proto for // the SignedEnvelope definition. type PeerRecord struct { - // peer_id contains a libp2p peer id in its binary representation. + // peer_id contains a p2p peer id in its binary representation. PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // seq contains a monotonically-increasing sequence counter to order PeerRecords in time. Seq uint64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"` diff --git a/peer/peer.go b/peer/peer.go index 1e62661ec74d243bec0b7b223298839e8fef7401..e55711734901ecd5d37941590fbff47e85837ea8 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -1,4 +1,4 @@ -// Package peer implements an object used to represent peers in the libp2p network. +// Package peer implements an object used to represent peers in the p2p network. package peer import ( @@ -35,7 +35,7 @@ var AdvancedEnableInlining = true const maxInlineKeyLength = 42 -// ID is a libp2p peer identity. +// ID is a p2p peer identity. // // Peer IDs are derived by hashing a peer's public key and encoding the // hash output as a multihash. See IDFromPublicKey for details. @@ -197,7 +197,7 @@ func Encode(id ID) string { // FromCid converts a CID to a peer ID, if possible. func FromCid(c cid.Cid) (ID, error) { ty := c.Type() - if ty != cid.Libp2pKey { + if ty != cid.P2pKey { s := cid.CodecToStr[ty] if s == "" { s = fmt.Sprintf("[unknown multicodec %d]", ty) @@ -215,7 +215,7 @@ func ToCid(id ID) cid.Cid { if err != nil { return cid.Cid{} } - return cid.NewCidV1(cid.Libp2pKey, m) + return cid.NewCidV1(cid.P2pKey, m) } // IDFromPublicKey returns the Peer ID corresponding to the public key pk. diff --git a/peer/peer_test.go b/peer/peer_test.go index bd5e1f0dd766f41d0b7b6c69ffb7561b52860f1a..f39729af1c840740d0d9e4e8095888ada7a840a8 100644 --- a/peer/peer_test.go +++ b/peer/peer_test.go @@ -199,7 +199,7 @@ func TestIDEncoding(t *testing.T) { } func TestPublicKeyExtraction(t *testing.T) { - t.Skip("disabled until libp2p/go-libp2p-crypto#51 is fixed") + t.Skip("disabled until p2p/go-p2p-crypto#51 is fixed") // Happy path _, originalPub, err := ic.GenerateEd25519Key(rand.Reader) if err != nil { diff --git a/peer/record.go b/peer/record.go index 1876352609376fc8a74f8dfbf92ca78b6b936009..c7e1439f1f83d3a2398c6afd9241e790245e5c24 100644 --- a/peer/record.go +++ b/peer/record.go @@ -7,7 +7,7 @@ import ( pb "gitlab.dms3.io/p2p/go-p2p-core/peer/pb" "gitlab.dms3.io/p2p/go-p2p-core/record" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" "github.com/gogo/protobuf/proto" ) @@ -19,15 +19,15 @@ func init() { } // PeerRecordEnvelopeDomain is the domain string used for peer records contained in a Envelope. -const PeerRecordEnvelopeDomain = "libp2p-peer-record" +const PeerRecordEnvelopeDomain = "p2p-peer-record" // PeerRecordEnvelopePayloadType is the type hint used to identify peer records in a Envelope. // Defined in https://github.com/multiformats/multicodec/blob/master/table.csv -// with name "libp2p-peer-record". +// with name "p2p-peer-record". var PeerRecordEnvelopePayloadType = []byte{0x03, 0x01} // PeerRecord contains information that is broadly useful to share with other peers, -// either through a direct exchange (as in the libp2p identify protocol), or through +// either through a direct exchange (as in the p2p identify protocol), or through // a Peer Routing provider, such as a DHT. // // Currently, a PeerRecord contains the public listen addresses for a peer, but this diff --git a/peer/record_test.go b/peer/record_test.go index d0baa3093ccdee1413fc91782b70f15302ad1ba4..7f9200b993eb3d999b61cc1a696520def05443c9 100644 --- a/peer/record_test.go +++ b/peer/record_test.go @@ -14,7 +14,7 @@ func TestPeerRecordConstants(t *testing.T) { msgf := "Changing the %s may cause peer records to be incompatible with older versions. " + "If you've already thought that through, please update this test so that it passes with the new values." rec := PeerRecord{} - if rec.Domain() != "libp2p-peer-record" { + if rec.Domain() != "p2p-peer-record" { t.Errorf(msgf, "signing domain") } if !bytes.Equal(rec.Codec(), []byte{0x03, 0x01}) { diff --git a/peerstore/peerstore.go b/peerstore/peerstore.go index 372bb036de3f3c01b01715359c7ddf38b1ba6381..663c28223321ba8f74bd177579f36682bcc438c4 100644 --- a/peerstore/peerstore.go +++ b/peerstore/peerstore.go @@ -1,5 +1,5 @@ // Package peerstore provides types and interfaces for local storage of address information, -// metadata, and public key material about libp2p peers. +// metadata, and public key material about p2p peers. package peerstore import ( @@ -13,7 +13,7 @@ import ( "gitlab.dms3.io/p2p/go-p2p-core/peer" "gitlab.dms3.io/p2p/go-p2p-core/record" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) var ErrNotFound = errors.New("item not found") @@ -206,7 +206,7 @@ type KeyBook interface { // PrivKey returns the private key of a peer, if known. Generally this might only be our own // private key, see - // https://discuss.libp2p.io/t/what-is-the-purpose-of-having-map-peer-id-privatekey-in-peerstore/74. + // https://discuss.p2p.io/t/what-is-the-purpose-of-having-map-peer-id-privatekey-in-peerstore/74. PrivKey(peer.ID) ic.PrivKey // AddPrivKey stores the private key of a peer. diff --git a/pnet/env.go b/pnet/env.go index c8db5e3cbd58869e0924eaed700fc938bfb7f4c4..13eeb19abdf3f406c1d8c113e826030eb943a83b 100644 --- a/pnet/env.go +++ b/pnet/env.go @@ -2,15 +2,15 @@ package pnet import "os" -// EnvKey defines environment variable name for forcing usage of PNet in libp2p +// EnvKey defines environment variable name for forcing usage of PNet in p2p // When environment variable of this name is set to "1" the ForcePrivateNetwork // variable will be set to true. -const EnvKey = "LIBP2P_FORCE_PNET" +const EnvKey = "P2P_FORCE_PNET" -// ForcePrivateNetwork is boolean variable that forces usage of PNet in libp2p -// Setting this variable to true or setting LIBP2P_FORCE_PNET environment variable -// to true will make libp2p to require private network protector. -// If no network protector is provided and this variable is set to true libp2p will +// ForcePrivateNetwork is boolean variable that forces usage of PNet in p2p +// Setting this variable to true or setting P2P_FORCE_PNET environment variable +// to true will make p2p to require private network protector. +// If no network protector is provided and this variable is set to true p2p will // refuse to connect. var ForcePrivateNetwork = false diff --git a/pnet/error.go b/pnet/error.go index 184b71d6acdf8f100c1654e4d1a5702fb8754439..b6df109ee830c5cd80b08ab2dc7be7b518968be6 100644 --- a/pnet/error.go +++ b/pnet/error.go @@ -1,6 +1,6 @@ package pnet -// ErrNotInPrivateNetwork is an error that should be returned by libp2p when it +// ErrNotInPrivateNetwork is an error that should be returned by p2p when it // tries to dial with ForcePrivateNetwork set and no PNet Protector var ErrNotInPrivateNetwork = NewError("private network was not configured but" + " is enforced by the environment") diff --git a/pnet/protector.go b/pnet/protector.go index 9d9dce92654ce109fe206832a8d526b8308edbbf..900f9cebf0ae3d79472cc353ff20aba7f26b1fe5 100644 --- a/pnet/protector.go +++ b/pnet/protector.go @@ -1,7 +1,7 @@ -// Package pnet provides interfaces for private networking in libp2p. +// Package pnet provides interfaces for private networking in p2p. package pnet -// A PSK enables private network implementation to be transparent in libp2p. +// A PSK enables private network implementation to be transparent in p2p. // It is used to ensure that peers can only establish connections to other peers // that are using the same PSK. type PSK []byte diff --git a/protocol/switch.go b/protocol/switch.go index f3ac369becb5738e41b6fe1e6d494be4e057a4cc..3585aaeae60fbbd9199ebdba590ecaade6e5e1af 100644 --- a/protocol/switch.go +++ b/protocol/switch.go @@ -1,4 +1,4 @@ -// Package protocol provides core interfaces for protocol routing and negotiation in libp2p. +// Package protocol provides core interfaces for protocol routing and negotiation in p2p. package protocol import ( diff --git a/record/envelope.go b/record/envelope.go index 54435931d4813d0b5b2264d43ce7da49421b2c33..c688f76b653ffbee26fec88cc95e3151e55736b4 100644 --- a/record/envelope.go +++ b/record/envelope.go @@ -15,7 +15,7 @@ import ( "github.com/multiformats/go-varint" ) -// Envelope contains an arbitrary []byte payload, signed by a libp2p peer. +// Envelope contains an arbitrary []byte payload, signed by a p2p peer. // // Envelopes are signed in the context of a particular "domain", which is a // string specified when creating and verifying the envelope. You must know the diff --git a/record/record.go b/record/record.go index 212005780e525658d6214639a1676fa6ce4c0502..e71741588fb246239d2c5e3280746ec3b0fe94b4 100644 --- a/record/record.go +++ b/record/record.go @@ -58,7 +58,7 @@ type Record interface { // where the Record type is defined: // // package hello_record -// import record "github.com/libp2p/go-libp2p-core/record" +// import record "gitlab.dms3.io/p2p/go-p2p-core/record" // // func init() { // record.RegisterType(&HelloRecord{}) diff --git a/routing/routing.go b/routing/routing.go index 7494533aeeea550eaae8843a933e3f7f6390354a..038c8adb066b9cd393d57c0b922d0b18c065867e 100644 --- a/routing/routing.go +++ b/routing/routing.go @@ -1,4 +1,4 @@ -// Package routing provides interfaces for peer routing and content routing in libp2p. +// Package routing provides interfaces for peer routing and content routing in p2p. package routing import ( @@ -67,7 +67,7 @@ type ValueStore interface { SearchValue(context.Context, string, ...Option) (<-chan []byte, error) } -// Routing is the combination of different routing types supported by libp2p. +// Routing is the combination of different routing types supported by p2p. // It can be satisfied by a single item (such as a DHT) or multiple different // pieces that are more optimized to each task. type Routing interface { @@ -85,7 +85,7 @@ type Routing interface { // PubKeyFetcher is an interfaces that should be implemented by value stores // that can optimize retrieval of public keys. // -// TODO(steb): Consider removing, see https://gitlab.dms3.io/p2p/go-libp2p-routing/issues/22. +// TODO(steb): Consider removing, see https://gitlab.dms3.io/p2p/go-p2p-routing/issues/22. type PubKeyFetcher interface { // GetPublicKey returns the public key for the given peer. GetPublicKey(context.Context, peer.ID) (ci.PubKey, error) diff --git a/sec/security.go b/sec/security.go index bd0e99339f455f30d65448b119cd2b60e0984905..858df6b07b4ffa320431f2ac7b5efcaec6976ebd 100644 --- a/sec/security.go +++ b/sec/security.go @@ -1,4 +1,4 @@ -// Package sec provides secure connection and transport interfaces for libp2p. +// Package sec provides secure connection and transport interfaces for p2p. package sec import ( diff --git a/test/addrs.go b/test/addrs.go index e18849c487c782294d142baa5b95adc50f1e8cea..e1bd750dfa53eaa6f351924d48005eb41c14215b 100644 --- a/test/addrs.go +++ b/test/addrs.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) func GenerateTestAddrs(n int) []ma.Multiaddr { diff --git a/transport/transport.go b/transport/transport.go index 3e260498af2cec90ed7e8c0134f69ca05ae90105..703ec0d40b698124c3b03a215c0fc123361ba014 100644 --- a/transport/transport.go +++ b/transport/transport.go @@ -11,7 +11,7 @@ import ( "gitlab.dms3.io/p2p/go-p2p-core/network" "gitlab.dms3.io/p2p/go-p2p-core/peer" - ma "github.com/multiformats/go-multiaddr" + ma "gitlab.dms3.io/mf/go-multiaddr" ) // DialTimeout is the maximum duration a Dial is allowed to take. @@ -25,7 +25,7 @@ var DialTimeout = 15 * time.Second var AcceptTimeout = 15 * time.Second // A CapableConn represents a connection that has offers the basic -// capabilities required by libp2p: stream multiplexing, encryption and +// capabilities required by p2p: stream multiplexing, encryption and // peer authentication. // // These capabilities may be natively provided by the transport, or they @@ -54,11 +54,11 @@ type CapableConn interface { // CapableConn, which means that they have been upgraded to support // stream multiplexing and connection security (encryption and authentication). // -// If a transport implements `io.Closer` (optional), libp2p will call `Close` on +// If a transport implements `io.Closer` (optional), p2p will call `Close` on // shutdown. NOTE: `Dial` and `Listen` may be called after or concurrently with // `Close`. // -// For a conceptual overview, see https://docs.libp2p.io/concepts/transport/ +// For a conceptual overview, see https://docs.p2p.io/concepts/transport/ type Transport interface { // Dial dials a remote peer. It should try to reuse local listener // addresses if possible but it may choose not to.