Skip to content

Commit 854ad9f

Browse files
committed
CID gravity connector
1 parent e1aa353 commit 854ad9f

File tree

7 files changed

+597
-27
lines changed

7 files changed

+597
-27
lines changed

cmd/curio/tasks/tasks.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,10 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
218218

219219
{
220220
// Market tasks
221-
sc, err := slrLazy.Val()
222-
if err != nil {
223-
return nil, err
224-
}
225-
226221
if cfg.Subsystems.EnableDealMarket {
227222
// Main market poller should run on all nodes
228-
dm := storage_market.NewCurioStorageDealMarket(miners, db, cfg, sc, full)
229-
err = dm.StartMarket(ctx)
223+
dm := storage_market.NewCurioStorageDealMarket(miners, db, cfg, si, full, as)
224+
err := dm.StartMarket(ctx)
230225
if err != nil {
231226
return nil, err
232227
}
@@ -249,6 +244,11 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
249244
go libp2p.NewDealProvider(ctx, db, cfg, dm.MK12Handler, full, sender, miners, machine, shutdownChan)
250245
}
251246

247+
sc, err := slrLazy.Val()
248+
if err != nil {
249+
return nil, err
250+
}
251+
252252
idxMax := taskhelp.Max(cfg.Subsystems.IndexingMaxTasks)
253253

254254
indexingTask := indexing.NewIndexingTask(db, sc, iStore, pp, cfg, idxMax)

deps/config/doc_gen.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/config/types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,14 @@ type MK12Config struct {
693693

694694
// DenyOfflineDeals determines if the storage provider will accept offline deals
695695
DenyOfflineDeals bool
696+
697+
// CIDGravityToken is the authorization token to use for CIDGravity filters.
698+
// If empty then CIDGravity filters are not called.
699+
CIDGravityToken string
700+
701+
// DefaultCIDGravityAccept when set to true till accept deals when CIDGravity service is not available.
702+
// Default behaviors is to reject the deals
703+
DefaultCIDGravityAccept bool
696704
}
697705

698706
type PieceLocatorConfig struct {

documentation/en/configuration/default-curio-configuration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,18 @@ description: The default curio configuration
482482
# type: bool
483483
#DenyOfflineDeals = false
484484

485+
# CIDGravityToken is the authorization token to use for CIDGravity filters.
486+
# If empty then CIDGravity filters are not called.
487+
#
488+
# type: string
489+
#CIDGravityToken = ""
490+
491+
# DefaultCIDGravityAccept when set to true till accept deals when CIDGravity service is not available.
492+
# Default behaviors is to reject the deals
493+
#
494+
# type: bool
495+
#DefaultCIDGravityAccept = false
496+
485497
[Market.StorageMarketConfig.IPNI]
486498
# Disable set whether to disable indexing announcement to the network and expose endpoints that
487499
# allow indexer nodes to process announcements. Default: False

0 commit comments

Comments
 (0)