mirror of
https://github.com/ipfs/kubo.git
synced 2025-05-17 15:06:47 +08:00
chore: fix typos and comment formatting (#10653)
* fix typos and comment formatting (cherry picked from commit 7383e1ecbb41d91c3ac14e681d560c3a2702ebd2)
This commit is contained in:

committed by
Marcin Rataj

parent
5e1bacc2a8
commit
a0c57cba22
@ -231,7 +231,7 @@ fetching may be degraded.
|
||||
USE WITH CAUTION:
|
||||
The main use case for this is setups with manual Peering.Peers config.
|
||||
Data from this node will not be announced on the DHT. This will make
|
||||
DHT-based routing an data retrieval impossible if this node is the only
|
||||
DHT-based routing and data retrieval impossible if this node is the only
|
||||
one hosting it, and other peers are not already connected to it.
|
||||
`,
|
||||
Transform: func(c *Config) error {
|
||||
|
@ -16,14 +16,14 @@ var (
|
||||
)
|
||||
|
||||
// GetCidEncoder processes the `cid-base` and `output-cidv1` options and
|
||||
// returns a encoder to use based on those parameters.
|
||||
// returns an encoder to use based on those parameters.
|
||||
func GetCidEncoder(req *cmds.Request) (cidenc.Encoder, error) {
|
||||
return getCidBase(req, true)
|
||||
}
|
||||
|
||||
// GetLowLevelCidEncoder is like GetCidEncoder but meant to be used by
|
||||
// lower level commands. It differs from GetCidEncoder in that CIDv0
|
||||
// are not, by default, auto-upgraded to CIDv1.
|
||||
// GetLowLevelCidEncoder is like GetCidEncoder but meant to be used by lower
|
||||
// level commands. It differs from GetCidEncoder in that CIDv0 are not, by
|
||||
// default, auto-upgraded to CIDv1.
|
||||
func GetLowLevelCidEncoder(req *cmds.Request) (cidenc.Encoder, error) {
|
||||
return getCidBase(req, false)
|
||||
}
|
||||
@ -52,19 +52,19 @@ func getCidBase(req *cmds.Request, autoUpgrade bool) (cidenc.Encoder, error) {
|
||||
return e, nil
|
||||
}
|
||||
|
||||
// CidBaseDefined returns true if the `cid-base` option is specified
|
||||
// on the command line
|
||||
// CidBaseDefined returns true if the `cid-base` option is specified on the
|
||||
// command line
|
||||
func CidBaseDefined(req *cmds.Request) bool {
|
||||
base, _ := req.Options["cid-base"].(string)
|
||||
return base != ""
|
||||
}
|
||||
|
||||
// CidEncoderFromPath creates a new encoder that is influenced from
|
||||
// the encoded Cid in a Path. For CidV0 the multibase from the base
|
||||
// encoder is used and automatic upgrades are disabled. For CidV1 the
|
||||
// multibase from the CID is used and upgrades are enabled.
|
||||
// CidEncoderFromPath creates a new encoder that is influenced from the encoded
|
||||
// Cid in a Path. For CIDv0 the multibase from the base encoder is used and
|
||||
// automatic upgrades are disabled. For CIDv1 the multibase from the CID is
|
||||
// used and upgrades are enabled.
|
||||
//
|
||||
// This logic is intentionally fuzzy and will match anything of the form
|
||||
// This logic is intentionally fuzzy and matches anything of the form
|
||||
// `CidLike`, `CidLike/...`, or `/namespace/CidLike/...`.
|
||||
//
|
||||
// For example:
|
||||
|
@ -184,9 +184,8 @@ type p2pOnlineRoutingIn struct {
|
||||
Validator record.Validator
|
||||
}
|
||||
|
||||
// Routing will get all routers obtained from different methods
|
||||
// (delegated routers, pub-sub, and so on) and add them all together
|
||||
// using a TieredRouter.
|
||||
// Routing will get all routers obtained from different methods (delegated
|
||||
// routers, pub-sub, and so on) and add them all together using a TieredRouter.
|
||||
func Routing(in p2pOnlineRoutingIn) irouting.ProvideManyRouter {
|
||||
routers := in.Routers
|
||||
|
||||
@ -206,7 +205,8 @@ func Routing(in p2pOnlineRoutingIn) irouting.ProvideManyRouter {
|
||||
return routinghelpers.NewComposableParallel(cRouters)
|
||||
}
|
||||
|
||||
// OfflineRouting provides a special Router to the routers list when we are creating a offline node.
|
||||
// OfflineRouting provides a special Router to the routers list when we are
|
||||
// creating an offline node.
|
||||
func OfflineRouting(dstore ds.Datastore, validator record.Validator) p2pRouterOut {
|
||||
return p2pRouterOut{
|
||||
Router: Router{
|
||||
|
@ -44,7 +44,7 @@ caused the request to be blocked.
|
||||
[NOpfs](https://github.com/ipfs-shipyard/nopfs) supports the format from [IPIP-383](https://github.com/ipfs/specs/pull/383).
|
||||
|
||||
Clear-text rules are simple: just put content paths to block, one per line.
|
||||
Paths with unicode and whitespace need to be percend-encoded:
|
||||
Paths with unicode and whitespace need to be percent-encoded:
|
||||
|
||||
```
|
||||
/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
|
@ -106,6 +106,6 @@ See `tracing/doc.go` for more details.
|
||||
|
||||
### Other
|
||||
|
||||
If you have any questions, or want us to analyze some weird kubo behaviour,
|
||||
If you have any questions, or want us to analyze some weird kubo behavior,
|
||||
just let us know, and be sure to include all the profiling information
|
||||
mentioned at the top.
|
||||
|
@ -338,7 +338,7 @@ As test fixtures we can add different use cases here and see how the configurati
|
||||
|
||||
~~We need to create a config migration using [fs-repo-migrations](https://github.com/ipfs/fs-repo-migrations). We should remove the `Routing.Type` param and add the configuration specified [previously](#Mimic-previous-dual-DHT-config).~~
|
||||
|
||||
We don't need to create any config migration! To avoid to the users the hassle of understanding how the new routing system works, we are gonna keep the old behavior. We will add the Type `custom` to make available the new Routing system.
|
||||
We don't need to create any config migration! To avoid to the users the hassle of understanding how the new routing system works, we are going to keep the old behavior. We will add the Type `custom` to make available the new Routing system.
|
||||
|
||||
### Security
|
||||
|
||||
|
@ -159,7 +159,7 @@ Default: `true`
|
||||
|
||||
## `LIBP2P_TCP_MUX`
|
||||
|
||||
By default Kubo tries to reuse the same listener port for raw TCP and WebSockers transports via experimental `libp2p.ShareTCPListener()` feature introduced in [go-libp2p#2984](https://github.com/libp2p/go-libp2p/pull/2984).
|
||||
By default Kubo tries to reuse the same listener port for raw TCP and WebSockets transports via experimental `libp2p.ShareTCPListener()` feature introduced in [go-libp2p#2984](https://github.com/libp2p/go-libp2p/pull/2984).
|
||||
If this is an issue, you can disable it by setting `LIBP2P_TCP_MUX` to `false` and use separate ports for each TCP transport.
|
||||
|
||||
> [!CAUTION]
|
||||
|
@ -36,7 +36,7 @@ doesn't even know it has to connect to node A.
|
||||
|
||||
### Checking for existing connections
|
||||
|
||||
The first thing to do is to double check that both nodes are in fact running
|
||||
The first thing to do is to double-check that both nodes are in fact running
|
||||
and online. To do this, run `ipfs id` on each machine. If both nodes show some
|
||||
addresses (like the example below), then your nodes are online.
|
||||
|
||||
|
@ -112,7 +112,7 @@ func TestAllRootCommandsAreMentionedInHelpText(t *testing.T) {
|
||||
|
||||
// a few base commands are not expected to be in the help message
|
||||
// but we default to requiring them to be in the help message, so that we
|
||||
// have to make an conscious decision to exclude them
|
||||
// have to make a conscious decision to exclude them
|
||||
notInHelp := map[string]bool{
|
||||
"object": true,
|
||||
"shutdown": true,
|
||||
|
Reference in New Issue
Block a user