Skip to content

Commit

Permalink
Update lotus and boxo versions (#1466) (#1537)
Browse files Browse the repository at this point in the history
* Update to use packages in go-libipni

* feat: update lotus version

* update boxo (#1492)

* 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: gammazero <gammazero@users.noreply.github.com>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Co-authored-by: hannahhoward <hannah@hannahhoward.net>
  • Loading branch information
4 people authored and LexLuthr committed Jul 20, 2023
1 parent c31a640 commit a4321cf
Show file tree
Hide file tree
Showing 22 changed files with 231 additions and 489 deletions.
2 changes: 0 additions & 2 deletions cmd/boost/provider_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"github.com/filecoin-project/boost/retrievalmarket/lp2pimpl"
"github.com/filecoin-project/boostd-data/shared/cliutil"
"github.com/filecoin-project/go-address"
// TODO: This multiaddr util library should probably live in its own repo
multiaddrutil "github.com/filecoin-project/go-legs/httpsync/multiaddr"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/ipfs/go-cid"
Expand Down
9 changes: 2 additions & 7 deletions cmd/boost/retrieve_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,14 @@ import (
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/ipfs/boxo/blockservice"
"github.com/ipfs/boxo/blockstore"
"github.com/ipfs/boxo/exchange/offline"
blockstore "github.com/ipfs/boxo/blockstore"
offline "github.com/ipfs/boxo/exchange/offline"
"github.com/ipfs/boxo/files"
"github.com/ipfs/boxo/ipld/merkledag"
unixfile "github.com/ipfs/boxo/ipld/unixfs/file"
"github.com/ipfs/go-cid"
flatfs "github.com/ipfs/go-ds-flatfs"
levelds "github.com/ipfs/go-ds-leveldb"
blockstore "github.com/ipfs/go-ipfs-blockstore"
offline "github.com/ipfs/go-ipfs-exchange-offline"
"github.com/ipfs/go-libipfs/files"
"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
237 changes: 0 additions & 237 deletions cmd/booster-http/blocks.go

This file was deleted.

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/go-libipfs/gateway"
"mime"
"net/http"
"strings"

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

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

func newGatewayHandler(gw *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 *BlocksGateway, supportedFormats []string) http.Handle
}

return &gatewayHandler{
gwh: gateway.NewHandler(gateway.Config{Headers: headers}, gw),
gwh: gateway.NewHandler(gateway.Config{
Headers: headers,
DeserializedResponses: true,
}, gw),
supportedFormats: fmtsMap,
}
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/booster-http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"github.com/filecoin-project/dagstore/mount"
"github.com/filecoin-project/go-state-types/abi"
"github.com/hashicorp/go-multierror"
"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/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 @@ -91,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 := NewBlocksGateway(blockService, nil)
gw, err := gateway.NewBlocksBackend(blockService)
if err != nil {
return fmt.Errorf("creating blocks gateway: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/lib/filters/filteredblockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ 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"
"github.com/ipfs/go-libipfs/blocks"
)

type FilteredBlockstore struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/lib/filters/filteredblockstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestFilteredBlockstore(t *testing.T) {
filter.EXPECT().FulfillRequest(gomock.Any(), blk.Cid()).Return(true, nil)
gotBlk, err := fbs.Get(ctx, blk.Cid())
require.NoError(t, err)
require.Equal(t, blk, gotBlk)
require.Equal(t, blk.RawData(), gotBlk.RawData())

// Filter rejects cid
filter.EXPECT().FulfillRequest(gomock.Any(), blk.Cid()).Return(false, nil)
Expand Down
Loading

0 comments on commit a4321cf

Please sign in to comment.