Skip to content

Commit

Permalink
Merge pull request #10190 from ipfs/release-v0.24.0
Browse files Browse the repository at this point in the history
Release: v0.24.0-1
  • Loading branch information
hacdias authored Nov 1, 2023
2 parents 3a1a041 + 3851311 commit 50160f7
Show file tree
Hide file tree
Showing 105 changed files with 1,652 additions and 1,882 deletions.
39 changes: 1 addition & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
shell: bash
strategy:
matrix:
repo-to-test-against: ["helia", "helia-ipns", "helia-unixfs"] # this needs to be manually kept in sync as new helia tests are written
repo-to-test-against: ["helia", "helia-ipns", "helia-unixfs", "helia-car", "helia-dag-json", "helia-dag-cbor", "helia-json", "helia-mfs"] # this needs to be manually kept in sync as new helia tests are written
steps:
- uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -94,43 +94,6 @@ jobs:
working-directory: interop/packages/interop
env:
KUBO_BINARY: ${{ github.workspace }}/cmd/ipfs/ipfs
go-ipfs-api:
needs: [interop-prep]
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TEST_DOCKER: 0
TEST_FUSE: 0
TEST_VERBOSE: 1
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/download-artifact@v3
with:
name: kubo
path: cmd/ipfs
- run: chmod +x cmd/ipfs/ipfs
- uses: actions/checkout@v4
with:
repository: ipfs/go-ipfs-api
path: go-ipfs-api
- run: cmd/ipfs/ipfs daemon --init --enable-namesys-pubsub &
- run: |
while ! cmd/ipfs/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do
sleep 1
done
timeout-minutes: 5
- run: go test -count=1 -v ./...
working-directory: go-ipfs-api
- run: cmd/ipfs/ipfs shutdown
if: always()
ipfs-webui:
needs: [interop-prep]
runs-on: ${{ fromJSON(github.repository == 'ipfs/kubo' && '["self-hosted", "linux", "x64", "2xlarge"]' || '"ubuntu-latest"') }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Kubo Changelogs

- [v0.24](docs/changelogs/v0.24.md)
- [v0.23](docs/changelogs/v0.23.md)
- [v0.22](docs/changelogs/v0.22.md)
- [v0.21](docs/changelogs/v0.21.md)
Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Featureset
- [HTTP Kubo RPC API](https://docs.ipfs.tech/reference/kubo/rpc/) (`/api/v0`) to access and control the daemon
- [Command Line Interface](https://docs.ipfs.tech/reference/kubo/cli/) based on (`/api/v0`) RPC API
- [WebUI](https://github.com/ipfs/ipfs-webui/#readme) to manage the Kubo node
- [Content blocking](/docs/content-blocking.md) support for operators of public nodes

### Other implementations

Expand Down Expand Up @@ -88,7 +89,6 @@ Before opening an issue, consider using one of the following locations to ensure
- [Install Go](#install-go)
- [Download and Compile IPFS](#download-and-compile-ipfs)
- [Cross Compiling](#cross-compiling)
- [OpenSSL](#openssl)
- [Troubleshooting](#troubleshooting)
- [Getting Started](#getting-started)
- [Usage](#usage)
Expand Down Expand Up @@ -327,15 +327,6 @@ Compiling for a different platform is as simple as running:
make build GOOS=myTargetOS GOARCH=myTargetArchitecture
```

##### OpenSSL

To build go-ipfs with OpenSSL support, append `GOTAGS=openssl` to your `make` invocation. Building with OpenSSL should significantly reduce the background CPU usage on nodes that frequently make or receive new connections.

Note: OpenSSL requires CGO support and, by default, CGO is disabled when cross-compiling. To cross-compile with OpenSSL support, you must:

1. Install a compiler toolchain for the target platform.
2. Set the `CGO_ENABLED=1` environment variable.

#### Troubleshooting

- Separate [instructions are available for building on Windows](docs/windows.md).
Expand Down
6 changes: 3 additions & 3 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/ipfs/kubo/core/coreapi"

options "github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/files"
"github.com/ipfs/boxo/path"
cid "github.com/ipfs/go-cid"
)

Expand Down Expand Up @@ -44,7 +44,7 @@ func addAssetList(nd *core.IpfsNode, l []string) (cid.Cid, error) {
return cid.Cid{}, err
}

basePath := path.IpfsPath(dirb.Cid())
basePath := path.FromCid(dirb.Cid())

for _, p := range l {
d, err := Asset.ReadFile(p)
Expand All @@ -69,5 +69,5 @@ func addAssetList(nd *core.IpfsNode, l []string) (cid.Cid, error) {
return cid.Cid{}, err
}

return basePath.Cid(), nil
return basePath.RootCid(), nil
}
14 changes: 11 additions & 3 deletions client/rpc/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"time"

iface "github.com/ipfs/boxo/coreiface"
"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/coreiface/tests"
"github.com/ipfs/boxo/path"
"github.com/ipfs/kubo/test/cli/harness"
ma "github.com/multiformats/go-multiaddr"
"go.uber.org/multierr"
Expand Down Expand Up @@ -70,7 +70,11 @@ func (np NodeProvider) MakeAPISwarm(t *testing.T, ctx context.Context, fullIdent
apis[i] = api

// empty node is pinned even with --empty-repo, we don't want that
emptyNode := path.New("/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn")
emptyNode, err := path.NewPath("/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn")
if err != nil {
return err
}

if err := api.Pin().Rm(ctx, emptyNode); err != nil {
return err
}
Expand Down Expand Up @@ -126,7 +130,11 @@ func Test_NewURLApiWithClient_With_Headers(t *testing.T) {
t.Fatal(err)
}
api.Headers.Set(headerToTest, expectedHeaderValue)
if err := api.Pin().Rm(context.Background(), path.New("/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv")); err != nil {
p, err := path.NewPath("/ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv")
if err != nil {
t.Fatal(err)
}
if err := api.Pin().Rm(context.Background(), p); err != nil {
t.Fatal(err)
}
}
Expand Down
8 changes: 4 additions & 4 deletions client/rpc/apifile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"fmt"
"io"

"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/files"
unixfs "github.com/ipfs/boxo/ipld/unixfs"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-cid"
)

Expand All @@ -17,7 +17,7 @@ const forwardSeekLimit = 1 << 14 // 16k
func (api *UnixfsAPI) Get(ctx context.Context, p path.Path) (files.Node, error) {
if p.Mutable() { // use resolved path in case we are dealing with IPNS / MFS
var err error
p, err = api.core().ResolvePath(ctx, p)
p, _, err = api.core().ResolvePath(ctx, p)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -195,13 +195,13 @@ func (it *apiIter) Next() bool {

switch it.cur.Type {
case unixfs.THAMTShard, unixfs.TMetadata, unixfs.TDirectory:
it.curFile, err = it.core.getDir(it.ctx, path.IpfsPath(c), int64(it.cur.Size))
it.curFile, err = it.core.getDir(it.ctx, path.FromCid(c), int64(it.cur.Size))
if err != nil {
it.err = err
return false
}
case unixfs.TFile:
it.curFile, err = it.core.getFile(it.ctx, path.IpfsPath(c), int64(it.cur.Size))
it.curFile, err = it.core.getFile(it.ctx, path.FromCid(c), int64(it.cur.Size))
if err != nil {
it.err = err
return false
Expand Down
6 changes: 3 additions & 3 deletions client/rpc/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

iface "github.com/ipfs/boxo/coreiface"
caopts "github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"
"github.com/ipfs/go-cid"
mc "github.com/multiformats/go-multicodec"
mh "github.com/multiformats/go-multihash"
Expand All @@ -27,8 +27,8 @@ func (s *blockStat) Size() int {
return s.BSize
}

func (s *blockStat) Path() path.Resolved {
return path.IpldPath(s.cid)
func (s *blockStat) Path() path.ImmutablePath {
return path.FromCid(s.cid)
}

func (api *BlockAPI) Put(ctx context.Context, r io.Reader, opts ...caopts.BlockPutOption) (iface.BlockStat, error) {
Expand Down
12 changes: 6 additions & 6 deletions client/rpc/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"io"

"github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/go-block-format"
"github.com/ipfs/boxo/path"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
format "github.com/ipfs/go-ipld-format"
multicodec "github.com/multiformats/go-multicodec"
Expand All @@ -21,7 +21,7 @@ type (
)

func (api *HttpDagServ) Get(ctx context.Context, c cid.Cid) (format.Node, error) {
r, err := api.core().Block().Get(ctx, path.IpldPath(c))
r, err := api.core().Block().Get(ctx, path.FromCid(c))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -79,8 +79,8 @@ func (api *httpNodeAdder) add(ctx context.Context, nd format.Node, pin bool) err
if err != nil {
return err
}
if !stat.Path().Cid().Equals(c) {
return fmt.Errorf("cids didn't match - local %s, remote %s", c.String(), stat.Path().Cid().String())
if !stat.Path().RootCid().Equals(c) {
return fmt.Errorf("cids didn't match - local %s, remote %s", c.String(), stat.Path().RootCid().String())
}
return nil
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func (api *HttpDagServ) Pinning() format.NodeAdder {
}

func (api *HttpDagServ) Remove(ctx context.Context, c cid.Cid) error {
return api.core().Block().Rm(ctx, path.IpldPath(c)) // TODO: should we force rm?
return api.core().Block().Rm(ctx, path.FromCid(c)) // TODO: should we force rm?
}

func (api *HttpDagServ) RemoveMany(ctx context.Context, cids []cid.Cid) error {
Expand Down
10 changes: 5 additions & 5 deletions client/rpc/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"

caopts "github.com/ipfs/boxo/coreiface/options"
"github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/path"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)
Expand Down Expand Up @@ -42,12 +42,12 @@ func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopt
return nil, err
}

rp, err := api.core().ResolvePath(ctx, p)
rp, _, err := api.core().ResolvePath(ctx, p)
if err != nil {
return nil, err
}

resp, err := api.core().Request("dht/findprovs", rp.Cid().String()).
resp, err := api.core().Request("dht/findprovs", rp.RootCid().String()).
Option("num-providers", options.NumProviders).
Send(ctx)
if err != nil {
Expand Down Expand Up @@ -98,12 +98,12 @@ func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtP
return err
}

rp, err := api.core().ResolvePath(ctx, p)
rp, _, err := api.core().ResolvePath(ctx, p)
if err != nil {
return err
}

return api.core().Request("dht/provide", rp.Cid().String()).
return api.core().Request("dht/provide", rp.RootCid().String()).
Option("recursive", options.Recursive).
Exec(ctx, nil)
}
Expand Down
Loading

0 comments on commit 50160f7

Please sign in to comment.