Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 84 additions & 90 deletions go.mod

Large diffs are not rendered by default.

602 changes: 397 additions & 205 deletions go.sum

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
go 1.24.0

toolchain go1.24.2
go 1.25.7

use (
.
Expand Down
345 changes: 228 additions & 117 deletions go.work.sum

Large diffs are not rendered by default.

250 changes: 125 additions & 125 deletions integrations/kuri/go.mod

Large diffs are not rendered by default.

781 changes: 428 additions & 353 deletions integrations/kuri/go.sum

Large diffs are not rendered by default.

48 changes: 27 additions & 21 deletions integrations/kuri/ribsplugin/kuboribs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package kuboribs
import (
"context"
"fmt"
"github.com/ipfs/boxo/blockservice"
"github.com/ipfs/boxo/exchange/offline"
"github.com/ipfs/boxo/blockservice"
"github.com/ipfs/boxo/exchange/offline"
"github.com/multiformats/go-multihash"
"os"

lotusbstore "github.com/filecoin-project/lotus/blockstore"
Expand All @@ -26,10 +27,10 @@ import (
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p/core/host"
"github.com/lotus-web3/ribs"
"github.com/lotus-web3/ribs/configuration"
ribsbstore "github.com/lotus-web3/ribs/integrations/blockstore"
"github.com/lotus-web3/ribs/integrations/web"
"github.com/lotus-web3/ribs/rbdeal"
"github.com/lotus-web3/ribs/configuration"
"github.com/mitchellh/go-homedir"
"go.uber.org/fx"
"golang.org/x/xerrors"
Expand Down Expand Up @@ -152,11 +153,11 @@ func ribsMetadata(r ribs.RIBS /*, lc fx.Lifecycle */) ribs.MetadataDB {
rbmeta := r.MetaDB()

/*
lc.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
return ribs.Close()
},
})*/
lc.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
return ribs.Close()
},
})*/

return rbmeta
}
Expand Down Expand Up @@ -199,18 +200,18 @@ var _ blockstore.GCLocker = (*flushingGCLocker)(nil)
// MFS Durability

func RibsFiles(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, rbs *ribsbstore.Blockstore, mdb ribs.MetadataDB) (*mfs.Root, error) {
bsv := blockservice.New(rbs, offline.Exchange(rbs))
dag := merkledag.NewDAGService(bsv)

dsk := datastore.NewKey("/local/filesroot")
pf := func(ctx context.Context, c cid.Cid) error {
rootDS := repo.Datastore()
/*if err := rootDS.Sync(ctx, blockstore.BlockPrefix); err != nil {
return err
}
if err := rootDS.Sync(ctx, filestore.FilestorePrefix); err != nil {
return err
}*/
bsv := blockservice.New(rbs, offline.Exchange(rbs))
dag := merkledag.NewDAGService(bsv)

dsk := datastore.NewKey("/local/filesroot")
pf := func(ctx context.Context, c cid.Cid) error {
rootDS := repo.Datastore()
/*if err := rootDS.Sync(ctx, blockstore.BlockPrefix); err != nil {
return err
}
if err := rootDS.Sync(ctx, filestore.FilestorePrefix); err != nil {
return err
}*/
log.Infow("new files root", "cid", c.String())

if err := rbs.Flush(ctx); err != nil {
Expand Down Expand Up @@ -259,7 +260,7 @@ func RibsFiles(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, rbs *ri
return nil, err
}

root, err := mfs.NewRoot(ctx, dag, nd, pf)
root, err := mfs.NewRoot(ctx, dag, nd, pf, noopProvider{})

lc.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
Expand All @@ -277,3 +278,8 @@ func RibsFiles(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, rbs *ri

return root, err
}

// noopProvider is a no-op MultihashProvider for mfs.NewRoot.
type noopProvider struct{}

func (noopProvider) StartProviding(_ bool, _ ...multihash.Multihash) error { return nil }
2 changes: 1 addition & 1 deletion integrations/ritool/claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var claimsExtendCmd = &cli.Command{

fmt.Printf("Getting claims for %d providers\n", len(provs))

chain, closer, err := cliutil.GetGatewayAPI(c)
chain, closer, err := cliutil.GetGatewayAPIV1(c)
if err != nil {
return xerrors.Errorf("getting gateway api: %w", err)
}
Expand Down
Loading