From 13f9cc928259fc76a2e3ef89efedd96a27aac0ac Mon Sep 17 00:00:00 2001 From: tavit ohanian Date: Wed, 11 Aug 2021 02:33:20 -0400 Subject: [PATCH] initial port --- limiter.go | 2 +- swarm.go | 2 +- swarm_dial.go | 2 +- swarm_net_test.go | 2 +- swarm_stream.go | 2 +- swarm_test.go | 2 +- swarm_transport.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/limiter.go b/limiter.go index c484525..7959c06 100644 --- a/limiter.go +++ b/limiter.go @@ -59,7 +59,7 @@ type isFdConsumingFnc func(ma.Multiaddr) bool func newDialLimiter(df dialfunc, fdFnc isFdConsumingFnc) *dialLimiter { fd := ConcurrentFdDials - if env := os.Getenv("LIBP2P_SWARM_FD_LIMIT"); env != "" { + if env := os.Getenv("P2P_SWARM_FD_LIMIT"); env != "" { if n, err := strconv.ParseInt(env, 10, 32); err == nil { fd = int(n) } diff --git a/swarm.go b/swarm.go index 4c6c88f..f00fc29 100644 --- a/swarm.go +++ b/swarm.go @@ -99,7 +99,7 @@ type Swarm struct { // NewSwarm constructs a Swarm. // -// NOTE: go-libp2p will be moving to dependency injection soon. The variadic +// NOTE: go-p2p will be moving to dependency injection soon. The variadic // `extra` interface{} parameter facilitates the future migration. Supported // elements are: // - connmgr.ConnectionGater diff --git a/swarm_dial.go b/swarm_dial.go index 398ad13..37fd27d 100644 --- a/swarm_dial.go +++ b/swarm_dial.go @@ -719,7 +719,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-p2p-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/swarm_net_test.go b/swarm_net_test.go index ebb4a0c..eef6534 100644 --- a/swarm_net_test.go +++ b/swarm_net_test.go @@ -109,7 +109,7 @@ func TestNetworkOpenStream(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - testString := "hello ipfs" + testString := "hello dms3" nets := make([]network.Network, 4) for i := 0; i < 4; i++ { diff --git a/swarm_stream.go b/swarm_stream.go index b32b050..c22720d 100644 --- a/swarm_stream.go +++ b/swarm_stream.go @@ -11,7 +11,7 @@ import ( "gitlab.dms3.io/p2p/go-p2p-core/protocol" ) -// Validate Stream conforms to the go-libp2p-net Stream interface +// Validate Stream conforms to the go-p2p-net Stream interface var _ network.Stream = &Stream{} // Stream is the stream type used by swarm. In general, you won't use this type diff --git a/swarm_test.go b/swarm_test.go index 0107c4f..06b7d99 100644 --- a/swarm_test.go +++ b/swarm_test.go @@ -31,7 +31,7 @@ func EchoStreamHandler(stream network.Stream) { go func() { defer stream.Close() - // pull out the ipfs conn + // pull out the dms3 conn c := stream.Conn() log.Infof("%s ponging to %s", c.LocalPeer(), c.RemotePeer()) diff --git a/swarm_transport.go b/swarm_transport.go index b5ab2bd..d5a3f0d 100644 --- a/swarm_transport.go +++ b/swarm_transport.go @@ -73,7 +73,7 @@ func (s *Swarm) TransportForListening(a ma.Multiaddr) transport.Transport { // AddTransport adds a transport to this swarm. // -// Satisfies the Network interface from go-libp2p-transport. +// Satisfies the Network interface from go-p2p-transport. func (s *Swarm) AddTransport(t transport.Transport) error { protocols := t.Protocols() -- GitLab