Skip to content

Commit

Permalink
Merge branch 'master' into merge-release-v0.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel authored Sep 11, 2024
2 parents 846c5cc + 6454bdb commit 2b86fa8
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
shell: bash

- name: Log in to Docker Hub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
46 changes: 25 additions & 21 deletions client/rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> IPFS CoreAPI implementation using HTTP API
This packages implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/boxo/coreiface#CoreAPI) over the HTTP API.
This package implements [`coreiface.CoreAPI`](https://pkg.go.dev/github.com/ipfs/kubo/core/coreiface#CoreAPI) over the HTTP API.

## Documentation

Expand All @@ -16,29 +16,33 @@ Pin file on your local IPFS node based on its CID:
package main

import (
"context"
"fmt"
"context"
"fmt"

"github.com/ipfs/kubo/client/rpc"
path "github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-cid"
"github.com/ipfs/kubo/client/rpc"
)

func main() {
// "Connect" to local node
node, err := rpc.NewLocalApi()
if err != nil {
fmt.Printf(err)
return
}
// Pin a given file by its CID
ctx := context.Background()
cid := "bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku"
p := path.New(cid)
err = node.Pin().Add(ctx, p)
if err != nil {
fmt.Printf(err)
return
}
return
// "Connect" to local node
node, err := rpc.NewLocalApi()
if err != nil {
fmt.Println(err)
return
}
// Pin a given file by its CID
ctx := context.Background()
c, err := cid.Decode("bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku")
if err != nil {
fmt.Println(err)
return
}
p := path.FromCid(c)
err = node.Pin().Add(ctx, p)
if err != nil {
fmt.Println(err)
return
}
}
```
4 changes: 4 additions & 0 deletions docs/changelogs/v0.30.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ Announced libp2p addresses are no longer printed on startup, because libp2p may

When executing a [CLI command](https://docs.ipfs.tech/reference/kubo/cli/) over [Kubo RPC API](https://docs.ipfs.tech/reference/kubo/rpc/), if a hostname is specified by `--api=/dns4/<domain>/` the resulting HTTP request now contains the hostname, instead of the the IP address that the hostname resolved to, as was the previous behavior. This makes it easier for those trying to run Kubo behind a reverse proxy using hostname-based rules.

#### Commands Preserve Specified Hostname

When executing a [CLI command](https://docs.ipfs.tech/reference/kubo/cli/) over [Kubo RPC API](https://docs.ipfs.tech/reference/kubo/rpc/), if a hostname is specified by `--api=/dns4/<domain>/` the resulting HTTP request now contains the hostname, instead of the the IP address that the hostname resolved to, as was the previous behavior. This makes it easier for those trying to run Kubo behind a reverse proxy using hostname-based rules.

### 📝 Changelog

<details><summary>Full Changelog</summary>
Expand Down
6 changes: 3 additions & 3 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ Additional modes may be added in the future.

> [!IMPORTANT]
> We are in the progress of [rolling out AutoNAT V2](https://github.com/ipfs/kubo/issues/10091).
> Right now, by default, a publicly diallable Kubo provides both V1 and V2 service to other peers,
> Right now, by default, a publicly dialable Kubo provides both V1 and V2 service to other peers,
> but only V1 is used by Kubo as a client. In a future release we will remove V1 and switch client to use V2.
Default: `enabled`
Expand Down Expand Up @@ -1615,7 +1615,7 @@ is able to find the 20 final nodes by looking up the in-memory recorded network
This means sustained higher memory to store the routing table
and extra CPU and network bandwidth for each network scan.
However the latency of individual read/write operations should be ~10x faster
and the provide throughput up to 6 million times faster on larger datasets!
and provide throughput up to 6 million times faster on larger datasets!

This is not compatible with `Routing.Type` `custom`. If you are using composable routers
you can configure this individually on each router.
Expand Down Expand Up @@ -1918,7 +1918,7 @@ Type: `flag`

#### `Swarm.RelayService.Limit`

Limits applied to every relayed connection.
Limits are applied to every relayed connection.

Default: `{}`

Expand Down
2 changes: 1 addition & 1 deletion docs/datastores.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Uses a leveldb database to store key value pairs.
Uses [badger](https://github.com/dgraph-io/badger) as a key value store.

* `syncWrites`: Flush every write to disk before continuing. Setting this to false is safe as kubo will automatically flush writes to disk before and after performing critical operations like pinning. However, you can set this to true to be extra-safe (at the cost of a 2-3x slowdown when adding files).
* `truncate`: Truncate the DB if a partially written sector is found (defaults to true). There is no good reason to set this to false unless you want to manually recover partially written (and unpinned) blocks if kubo crashes half-way through a adding a file.
* `truncate`: Truncate the DB if a partially written sector is found (defaults to true). There is no good reason to set this to false unless you want to manually recover partially written (and unpinned) blocks if kubo crashes half-way through adding a file.

```json
{
Expand Down
4 changes: 2 additions & 2 deletions docs/libp2p-resource-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ These values trump anything else and are parsed directly by go-libp2p.
## FAQ

### What do these "Protected from exceeding resource limits" log messages mean?
"Protected from exceeding resource limits" log messages denote that the resource manager is working and that it prevented additional resources being used beyond the set limits. Per [libp2p code](https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/scope.go), these messages take the form of "$scope: cannot reserve $limitKey".
"Protected from exceeding resource limits" log messages denote that the resource manager is working and that it prevented additional resources from being used beyond the set limits. Per [libp2p code](https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/scope.go), these messages take the form of "$scope: cannot reserve $limitKey".

As an example:

Expand Down Expand Up @@ -133,7 +133,7 @@ Kubo performs sanity checks to ensure that some of the hard limits of the Resour
The soft limit of `Swarm.ConnMgr.HighWater` needs to be less than the resource manager hard limit `System.ConnsInbound` for the configuration to make sense.
This ensures the ConnMgr cleans up connections based on connection priorities before the hard limits of the ResourceMgr are applied.
If `Swarm.ConnMgr.HighWater` is greater than resource manager's `System.ConnsInbound`,
existing low priority idle connections can prevent new high priority connections from being established.
existing low-priority idle connections can prevent new high-priority connections from being established.
The ResourceMgr doesn't know that the new connection is high priority and simply blocks it because of the limit its enforcing.

To ensure the ConnMgr and ResourceMgr are congruent, the ResourceMgr [computed default limits](#computed-default-limits) are adjusted such that:
Expand Down
2 changes: 1 addition & 1 deletion docs/specifications/keystore.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ OPTIONS:
DESCRIPTION:
'ipfs crypt encrypt' is a command used to encypt data so that only holders of a certain
'ipfs crypt encrypt' is a command used to encrypt data so that only holders of a certain
key can read it.
```

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
var CurrentCommit string

// CurrentVersionNumber is the current application's version literal.
const CurrentVersionNumber = "0.30.0"
const CurrentVersionNumber = "0.31.0-dev"

const ApiVersion = "/kubo/" + CurrentVersionNumber + "/" //nolint

Expand Down

0 comments on commit 2b86fa8

Please sign in to comment.