From 3089ac3061f82151b18553f4469349fa60e56a50 Mon Sep 17 00:00:00 2001 From: shuoer86 <129674997+shuoer86@users.noreply.github.com> Date: Sat, 18 Nov 2023 20:03:52 +0800 Subject: [PATCH] chore: fix typos (#2608) Co-authored-by: Sukun --- examples/echo/README.md | 2 +- examples/relay/main.go | 2 +- p2p/host/autonat/svc_test.go | 2 +- p2p/host/basic/basic_host.go | 2 +- p2p/net/swarm/dial_test.go | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/echo/README.md b/examples/echo/README.md index 380716001..4c30609fa 100644 --- a/examples/echo/README.md +++ b/examples/echo/README.md @@ -42,7 +42,7 @@ The `makeBasicHost()` function creates a [go-libp2p-basichost](https://godoc.org In order to create the swarm (and a `basichost`), the example needs: -- An [ipfs-procotol ID](https://godoc.org/github.com/libp2p/go-libp2p-peer#ID) like `QmNtX1cvrm2K6mQmMEaMxAuB4rTexhd87vpYVot4sEZzxc`. The example autogenerates a key pair on every run and uses an ID extracted from the public key (the hash of the public key). When using `-insecure`, it leaves the connection unencrypted (otherwise, it uses the key pair to encrypt communications). +- An [ipfs-protocol ID](https://godoc.org/github.com/libp2p/go-libp2p-peer#ID) like `QmNtX1cvrm2K6mQmMEaMxAuB4rTexhd87vpYVot4sEZzxc`. The example autogenerates a key pair on every run and uses an ID extracted from the public key (the hash of the public key). When using `-insecure`, it leaves the connection unencrypted (otherwise, it uses the key pair to encrypt communications). - A [Multiaddress](https://godoc.org/github.com/multiformats/go-multiaddr), which indicates how to reach this peer. There can be several of them (using different protocols or locations for example). Example: `/ip4/127.0.0.1/tcp/1234`. - A [go-libp2p-peerstore](https://godoc.org/github.com/libp2p/go-libp2p-peerstore), which is used as an address book which matches node IDs to the multiaddresses through which they can be contacted. This peerstore gets autopopulated when manually opening a connection (with [`Connect()`](https://godoc.org/github.com/libp2p/go-libp2p/p2p/host/basic#BasicHost.Connect). Alternatively, we can manually [`AddAddr()`](https://godoc.org/github.com/libp2p/go-libp2p-peerstore#AddrManager.AddAddr) as in the example. diff --git a/examples/relay/main.go b/examples/relay/main.go index e8fa8b7ba..7e16b1b19 100644 --- a/examples/relay/main.go +++ b/examples/relay/main.go @@ -27,7 +27,7 @@ func run() { unreachable1, err := libp2p.New( libp2p.NoListenAddrs, // Usually EnableRelay() is not required as it is enabled by default - // but NoListenAddrs overrides this, so we're adding it in explictly again. + // but NoListenAddrs overrides this, so we're adding it in explicitly again. libp2p.EnableRelay(), ) if err != nil { diff --git a/p2p/host/autonat/svc_test.go b/p2p/host/autonat/svc_test.go index 61e6038c5..96836d1db 100644 --- a/p2p/host/autonat/svc_test.go +++ b/p2p/host/autonat/svc_test.go @@ -189,7 +189,7 @@ func TestAutoNATServiceRateLimitJitter(t *testing.T) { svc.mx.Lock() defer svc.mx.Unlock() return svc.globalReqs == 0 - }, dur*5/2, 10*time.Millisecond, "reset of rate limitter occured slower than expected") + }, dur*5/2, 10*time.Millisecond, "reset of rate limitter occurred slower than expected") } func TestAutoNATServiceStartup(t *testing.T) { diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index acbb0984a..8e6e8efe7 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -542,7 +542,7 @@ func (h *BasicHost) background() { h.updateLocalIpAddr() } // Request addresses anyways because, technically, address filters still apply. - // The underlying AllAddrs call is effectivley a no-op. + // The underlying AllAddrs call is effectively a no-op. curr := h.Addrs() emitAddrChange(curr, lastAddrs) lastAddrs = curr diff --git a/p2p/net/swarm/dial_test.go b/p2p/net/swarm/dial_test.go index a614183bb..3b139ef38 100644 --- a/p2p/net/swarm/dial_test.go +++ b/p2p/net/swarm/dial_test.go @@ -562,7 +562,7 @@ func TestDialSimultaneousJoin(t *testing.T) { return } - t.Logf("first dial succedded; conn: %+v", c) + t.Logf("first dial succeeded; conn: %+v", c) connch <- c errs <- nil @@ -587,7 +587,7 @@ func TestDialSimultaneousJoin(t *testing.T) { return } - t.Logf("second dial succedded; conn: %+v", c) + t.Logf("second dial succeeded; conn: %+v", c) connch <- c errs <- nil @@ -605,7 +605,7 @@ func TestDialSimultaneousJoin(t *testing.T) { return } - t.Logf("third dial succedded; conn: %+v", c) + t.Logf("third dial succeeded; conn: %+v", c) connch <- c errs <- nil