Skip to content

Commit

Permalink
CID gravity connector
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Feb 10, 2025
1 parent e1aa353 commit 854ad9f
Show file tree
Hide file tree
Showing 7 changed files with 597 additions and 27 deletions.
14 changes: 7 additions & 7 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,10 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan

{
// Market tasks
sc, err := slrLazy.Val()
if err != nil {
return nil, err
}

if cfg.Subsystems.EnableDealMarket {
// Main market poller should run on all nodes
dm := storage_market.NewCurioStorageDealMarket(miners, db, cfg, sc, full)
err = dm.StartMarket(ctx)
dm := storage_market.NewCurioStorageDealMarket(miners, db, cfg, si, full, as)
err := dm.StartMarket(ctx)
if err != nil {
return nil, err
}
Expand All @@ -249,6 +244,11 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
go libp2p.NewDealProvider(ctx, db, cfg, dm.MK12Handler, full, sender, miners, machine, shutdownChan)
}

sc, err := slrLazy.Val()
if err != nil {
return nil, err
}

idxMax := taskhelp.Max(cfg.Subsystems.IndexingMaxTasks)

indexingTask := indexing.NewIndexingTask(db, sc, iStore, pp, cfg, idxMax)
Expand Down
14 changes: 14 additions & 0 deletions deps/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions deps/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,14 @@ type MK12Config struct {

// DenyOfflineDeals determines if the storage provider will accept offline deals
DenyOfflineDeals bool

// CIDGravityToken is the authorization token to use for CIDGravity filters.
// If empty then CIDGravity filters are not called.
CIDGravityToken string

// DefaultCIDGravityAccept when set to true till accept deals when CIDGravity service is not available.
// Default behaviors is to reject the deals
DefaultCIDGravityAccept bool
}

type PieceLocatorConfig struct {
Expand Down
12 changes: 12 additions & 0 deletions documentation/en/configuration/default-curio-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,18 @@ description: The default curio configuration
# type: bool
#DenyOfflineDeals = false

# CIDGravityToken is the authorization token to use for CIDGravity filters.
# If empty then CIDGravity filters are not called.
#
# type: string
#CIDGravityToken = ""

# DefaultCIDGravityAccept when set to true till accept deals when CIDGravity service is not available.
# Default behaviors is to reject the deals
#
# type: bool
#DefaultCIDGravityAccept = false

[Market.StorageMarketConfig.IPNI]
# Disable set whether to disable indexing announcement to the network and expose endpoints that
# allow indexer nodes to process announcements. Default: False
Expand Down
Loading

0 comments on commit 854ad9f

Please sign in to comment.