Skip to content

Commit

Permalink
chore: fix typos (#2608)
Browse files Browse the repository at this point in the history
Co-authored-by: Sukun <[email protected]>
  • Loading branch information
shuoer86 and sukunrt authored Nov 18, 2023
1 parent 50cf207 commit 3089ac3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion examples/relay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion p2p/host/autonat/svc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions p2p/net/swarm/dial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3089ac3

Please sign in to comment.