Skip to content

Commit 563f95c

Browse files
committed
ipni provider
1 parent 5a4eda5 commit 563f95c

File tree

19 files changed

+1642
-274
lines changed

19 files changed

+1642
-274
lines changed

cmd/curio/tasks/tasks.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps) (*harmonytask.Task
229229
}
230230

231231
indexingTask := indexing.NewIndexingTask(db, sc, iStore, pp, cfg)
232-
activeTasks = append(activeTasks, indexingTask)
232+
ipniTask := indexing.NewIPNITask(db, sc, iStore, pp, cfg)
233+
activeTasks = append(activeTasks, indexingTask, ipniTask)
233234

234235
}
235236

deps/config/doc_gen.go

Lines changed: 58 additions & 6 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: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ func DefaultCurioConfig() *CurioConfig {
7171
},
7272
},
7373
Market: MarketConfig{
74+
HTTP: HTTPConfig{
75+
ListenAddress: "0.0.0.0:8888",
76+
AnnounceAddresses: []string{},
77+
},
7478
StorageMarketConfig: StorageMarketConfig{
7579
PieceLocator: []PieceLocatorConfig{},
7680
Indexing: IndexingConfig{
@@ -85,6 +89,12 @@ func DefaultCurioConfig() *CurioConfig {
8589
ExpectedPoRepSealDuration: Duration(8 * time.Hour),
8690
ExpectedSnapSealDuration: Duration(2 * time.Hour),
8791
},
92+
IPNI: IPNIConfig{
93+
Enable: true,
94+
TopicName: "",
95+
WebHost: "https://cid.contact",
96+
DirectAnnounceURLs: []string{"https://cid.contact/ingest/announce"},
97+
},
8898
},
8999
},
90100
}
@@ -270,9 +280,6 @@ type CurioSubsystemsConfig struct {
270280
// Batch Seal
271281
EnableBatchSeal bool
272282

273-
// EnableDealMarket
274-
EnableDealMarket bool
275-
276283
// EnableCommP enabled the commP task on te node. CommP is calculated before sending PublishDealMessage for a Mk12 deal
277284
EnableCommP bool
278285
}
@@ -557,6 +564,9 @@ type ApisConfig struct {
557564
type MarketConfig struct {
558565
// StorageMarketConfig houses all the deal related market configuration
559566
StorageMarketConfig StorageMarketConfig
567+
568+
// HTTP configuration for market HTTP server
569+
HTTP HTTPConfig
560570
}
561571

562572
type StorageMarketConfig struct {
@@ -570,6 +580,9 @@ type StorageMarketConfig struct {
570580
// Indexing configuration for deal indexing
571581
Indexing IndexingConfig
572582

583+
// IPNI configuration for ipni-provider
584+
IPNI IPNIConfig
585+
573586
// MK12 encompasses all configuration related to deal protocol mk1.2.0 and mk1.2.1 (i.e. Boost deals)
574587
MK12 MK12Config
575588
}
@@ -633,3 +646,31 @@ type Libp2pConfig struct {
633646
// Format: multiaddress
634647
NoAnnounceAddresses []string
635648
}
649+
650+
type IPNIConfig struct {
651+
// Enable set whether to enable indexing announcement to the network and expose endpoints that
652+
// allow indexer nodes to process announcements. Enabled by default.
653+
Enable bool
654+
655+
// TopicName sets the topic name on which the changes to the advertised content are announced.
656+
// If not explicitly specified, the topic name is automatically inferred from the network name
657+
// in following format: '/indexer/ingest/<network-name>'
658+
// Defaults to empty, which implies the topic name is inferred from network name.
659+
TopicName string
660+
661+
// The network indexer host that the web UI should link to for published announcements
662+
WebHost string
663+
664+
// The list of URLs of indexing nodes to announce to.
665+
DirectAnnounceURLs []string
666+
}
667+
668+
type HTTPConfig struct {
669+
// ListenAddress is where HTTP server will be listening on
670+
ListenAddress string
671+
672+
// AnnounceAddresses is a list of addresses clients can use to reach to the HTTP market node.
673+
// Curio allows running more than one node for HTTP server and thus all addressed can be announced
674+
// simultaneously to the client
675+
AnnounceAddresses []string
676+
}

deps/deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
"github.com/filecoin-project/curio/deps/config"
3636
"github.com/filecoin-project/curio/harmony/harmonydb"
3737
"github.com/filecoin-project/curio/lib/curiochain"
38-
"github.com/filecoin-project/curio/lib/indexing/indexstore"
38+
"github.com/filecoin-project/curio/lib/indexstore"
3939
"github.com/filecoin-project/curio/lib/multictladdr"
4040
"github.com/filecoin-project/curio/lib/paths"
4141
"github.com/filecoin-project/curio/lib/pieceprovider"

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

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ description: The default curio configuration
222222
# type: bool
223223
#EnableBatchSeal = false
224224

225-
# EnableDealMarket
226-
#
227-
# type: bool
228-
#EnableDealMarket = false
229-
230225
# EnableCommP enabled the commP task on te node. CommP is calculated before sending PublishDealMessage for a Mk12 deal
231226
#
232227
# type: bool
@@ -411,6 +406,31 @@ description: The default curio configuration
411406
# type: int
412407
#InsertConcurrency = 8
413408

409+
[Market.StorageMarketConfig.IPNI]
410+
# Enable set whether to enable indexing announcement to the network and expose endpoints that
411+
# allow indexer nodes to process announcements. Enabled by default.
412+
#
413+
# type: bool
414+
#Enable = true
415+
416+
# TopicName sets the topic name on which the changes to the advertised content are announced.
417+
# If not explicitly specified, the topic name is automatically inferred from the network name
418+
# in following format: '/indexer/ingest/<network-name>'
419+
# Defaults to empty, which implies the topic name is inferred from network name.
420+
#
421+
# type: string
422+
#TopicName = ""
423+
424+
# The network indexer host that the web UI should link to for published announcements
425+
#
426+
# type: string
427+
#WebHost = "https://cid.contact"
428+
429+
# The list of URLs of indexing nodes to announce to.
430+
#
431+
# type: []string
432+
#DirectAnnounceURLs = ["https://cid.contact/ingest/announce"]
433+
414434
[Market.StorageMarketConfig.MK12]
415435
# Libp2p is a list of libp2p config for each miner ID. These values must be set explicitly
416436
# for each miner ID.
@@ -456,6 +476,19 @@ description: The default curio configuration
456476
# type: bool
457477
#SkipCommP = false
458478

479+
[Market.HTTP]
480+
# ListenAddress is where HTTP server will be listening on
481+
#
482+
# type: string
483+
#ListenAddress = "0.0.0.0:8888"
484+
485+
# AnnounceAddresses is a list of addresses clients can use to reach to the HTTP market node.
486+
# Curio allows running more than one node for HTTP server and thus all addressed can be announced
487+
# simultaneously to the client
488+
#
489+
# type: []string
490+
#AnnounceAddresses = []
491+
459492

460493
[Ingest]
461494
# Maximum number of sectors that can be queued waiting for deals to start processing.

0 commit comments

Comments
 (0)