Browse Source

chore: fix typos (#2608)

Co-authored-by: Sukun <sukunrt@gmail.com>
pull/2653/head
shuoer86 12 months ago
committed by GitHub
parent
commit
3089ac3061
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      examples/echo/README.md
  2. 2
      examples/relay/main.go
  3. 2
      p2p/host/autonat/svc_test.go
  4. 2
      p2p/host/basic/basic_host.go
  5. 6
      p2p/net/swarm/dial_test.go

2
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.

2
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 {

2
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) {

2
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

6
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

Loading…
Cancel
Save