Skip to content

Commit

Permalink
update boxo (#1492)
Browse files Browse the repository at this point in the history
* feat: update boxo

* refactor: depend on repo:Jorropo/lotus branch:boxo2

* chore: temporarily update go-fil-markets with replace directive

* feat: switch itests framework ExtractFileFromCAR to use non-global IPLD registry

* feat: switch booster-bitswap client fetch to use the go-ipld-prime globals via go-ipld-legacy

* go fmt

* chore: update dependencies and migrate to boxo

* fix: update boost-gfm

* fix: stop itests framework from prematurely setting listenaddrs via go-libp2p defaults that conflict with lotus

* fix: docs gen

* chore(deps): update deps for boxo v0.10.0

* chore(deps): update boost-gfm

* fix(booster-http): update for boxo v0.10.0

* chore(deps): update to remove kubo dependency

* fix(gen): update docs gen

* feat: update boost-gfm to v1.26.6

* chore(deps): update lotus to master

---------

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Co-authored-by: hannahhoward <hannah@hannahhoward.net>
  • Loading branch information
3 people committed Jun 23, 2023
1 parent be51f82 commit 254188b
Show file tree
Hide file tree
Showing 25 changed files with 278 additions and 264 deletions.
8 changes: 4 additions & 4 deletions car/car_offset_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"fmt"
"io"

"github.com/ipfs/go-blockservice"
"github.com/ipfs/boxo/blockservice"
blockstore "github.com/ipfs/boxo/blockstore"
offline "github.com/ipfs/boxo/exchange/offline"
"github.com/ipfs/boxo/ipld/merkledag"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
offline "github.com/ipfs/go-ipfs-exchange-offline"
format "github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-merkledag"
"github.com/ipld/go-car"
"github.com/ipld/go-car/util"
)
Expand Down
14 changes: 7 additions & 7 deletions car/car_offset_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import (
"math/rand"
"testing"

"github.com/ipfs/boxo/blockservice"
bstore "github.com/ipfs/boxo/blockstore"
chunk "github.com/ipfs/boxo/chunker"
"github.com/ipfs/boxo/ipld/merkledag"
merkledagpb "github.com/ipfs/boxo/ipld/merkledag/pb"
"github.com/ipfs/boxo/ipld/unixfs/importer/balanced"
"github.com/ipfs/boxo/ipld/unixfs/importer/helpers"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-cidutil"
"github.com/ipfs/go-datastore"
dss "github.com/ipfs/go-datastore/sync"
bstore "github.com/ipfs/go-ipfs-blockstore"
chunk "github.com/ipfs/go-ipfs-chunker"
format "github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-merkledag"
merkledagpb "github.com/ipfs/go-merkledag/pb"
"github.com/ipfs/go-unixfs/importer/balanced"
"github.com/ipfs/go-unixfs/importer/helpers"
"github.com/ipld/go-car"
mh "github.com/multiformats/go-multihash"
"github.com/stretchr/testify/require"
Expand Down
6 changes: 3 additions & 3 deletions car/car_reader_seeker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"math/rand"
"testing"

"github.com/ipfs/go-blockservice"
"github.com/ipfs/boxo/blockservice"
bstore "github.com/ipfs/boxo/blockstore"
"github.com/ipfs/boxo/ipld/merkledag"
"github.com/ipfs/go-datastore"
dss "github.com/ipfs/go-datastore/sync"
bstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/ipfs/go-merkledag"
"github.com/stretchr/testify/require"
)

Expand Down
10 changes: 5 additions & 5 deletions cmd/boost/retrieve_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"time"

blockstore "github.com/ipfs/boxo/blockstore"
flatfs "github.com/ipfs/go-ds-flatfs"
levelds "github.com/ipfs/go-ds-leveldb"
blockstore "github.com/ipfs/go-ipfs-blockstore"
"github.com/mitchellh/go-homedir"

"github.com/dustin/go-humanize"
Expand All @@ -21,12 +21,12 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/ipfs/boxo/blockservice"
offline "github.com/ipfs/boxo/exchange/offline"
"github.com/ipfs/boxo/files"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/boxo/ipld/merkledag"
unixfile "github.com/ipfs/boxo/ipld/unixfs/file"
"github.com/ipfs/go-cid"
offline "github.com/ipfs/go-ipfs-exchange-offline"
"github.com/ipfs/go-merkledag"
unixfile "github.com/ipfs/go-unixfs/file"
"github.com/ipld/go-car"
"github.com/ipld/go-ipld-prime"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
Expand Down
5 changes: 3 additions & 2 deletions cmd/booster-bitswap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
lcli "github.com/filecoin-project/lotus/cli"
"github.com/ipfs/boxo/bitswap/client"
bsnetwork "github.com/ipfs/boxo/bitswap/network"
nilrouting "github.com/ipfs/boxo/routing/none"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
nilrouting "github.com/ipfs/go-ipfs-routing/none"
ipldlegacy "github.com/ipfs/go-ipld-legacy"
"github.com/ipld/go-car/v2/blockstore"
"github.com/libp2p/go-libp2p"
Expand Down Expand Up @@ -181,7 +181,8 @@ func getBlocks(ctx context.Context, bsClient *client.Client, c cid.Cid, throttle

// Read the links from the block to child nodes in the DAG
var count = uint64(1)
nd, err := ipldlegacy.DecodeNode(ctx, blk)
ipldDecoder := ipldlegacy.NewDecoder()
nd, err := ipldDecoder.DecodeNode(ctx, blk)
if err != nil {
return 0, 0, fmt.Errorf("decoding node %s: %w", c, err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/booster-bitswap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/filecoin-project/boost/protocolproxy"
bsnetwork "github.com/ipfs/boxo/bitswap/network"
"github.com/ipfs/boxo/bitswap/server"
blockstore "github.com/ipfs/boxo/blockstore"
nilrouting "github.com/ipfs/boxo/routing/none"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
nilrouting "github.com/ipfs/go-ipfs-routing/none"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
)
Expand Down
10 changes: 7 additions & 3 deletions cmd/booster-http/gateway_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ package main

import (
"fmt"
"github.com/ipfs/boxo/gateway"
"mime"
"net/http"
"strings"

"github.com/ipfs/boxo/gateway"
)

type gatewayHandler struct {
gwh http.Handler
supportedFormats map[string]struct{}
}

func newGatewayHandler(gw *gateway.BlocksGateway, supportedFormats []string) http.Handler {
func newGatewayHandler(gw *gateway.BlocksBackend, supportedFormats []string) http.Handler {
headers := map[string][]string{}
gateway.AddAccessControlHeaders(headers)

Expand All @@ -23,7 +24,10 @@ func newGatewayHandler(gw *gateway.BlocksGateway, supportedFormats []string) htt
}

return &gatewayHandler{
gwh: gateway.NewHandler(gateway.Config{Headers: headers}, gw),
gwh: gateway.NewHandler(gateway.Config{
Headers: headers,
DeserializedResponses: true,
}, gw),
supportedFormats: fmtsMap,
}
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/booster-http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/hashicorp/go-multierror"
"github.com/ipfs/boxo/blockservice"
blockstore "github.com/ipfs/boxo/blockstore"
offline "github.com/ipfs/boxo/exchange/offline"
"github.com/ipfs/boxo/gateway"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
offline "github.com/ipfs/go-ipfs-exchange-offline"
"go.opencensus.io/stats"
)

Expand Down Expand Up @@ -92,7 +92,7 @@ func (s *HttpServer) Start(ctx context.Context) error {

if s.opts.Blockstore != nil {
blockService := blockservice.New(s.opts.Blockstore, offline.Exchange(s.opts.Blockstore))
gw, err := gateway.NewBlocksGateway(blockService)
gw, err := gateway.NewBlocksBackend(blockService)
if err != nil {
return fmt.Errorf("creating blocks gateway: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cmd
import "github.com/urfave/cli/v2"

var FlagRepo = &cli.StringFlag{
Name: "repo",
Usage: "repo directory for Boost client",
Value: "~/.boost-client",
Name: "repo",
Usage: "repo directory for Boost client",
Value: "~/.boost-client",
EnvVars: []string{"BOOST_CLIENT_REPO"},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/lib/filters/filteredblockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package filters
import (
"context"
"fmt"
blockstore "github.com/ipfs/boxo/blockstore"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
ipld "github.com/ipfs/go-ipld-format"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/lib/remoteblockstore/remoteblockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"

"github.com/filecoin-project/boostd-data/shared/tracing"
blockstore "github.com/ipfs/boxo/blockstore"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
format "github.com/ipfs/go-ipld-format"
logging "github.com/ipfs/go-log/v2"
"go.opencensus.io/stats"
Expand Down
Loading

0 comments on commit 254188b

Please sign in to comment.