Skip to content

Commit 6db560e

Browse files
committed
ipni provider
1 parent bb22754 commit 6db560e

File tree

19 files changed

+1645
-280
lines changed

19 files changed

+1645
-280
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
@@ -67,6 +67,10 @@ func DefaultCurioConfig() *CurioConfig {
6767
},
6868
},
6969
Market: MarketConfig{
70+
HTTP: HTTPConfig{
71+
ListenAddress: "0.0.0.0:8888",
72+
AnnounceAddresses: []string{},
73+
},
7074
StorageMarketConfig: StorageMarketConfig{
7175
PieceLocator: []PieceLocatorConfig{},
7276
Indexing: IndexingConfig{
@@ -81,6 +85,12 @@ func DefaultCurioConfig() *CurioConfig {
8185
ExpectedPoRepSealDuration: Duration(8 * time.Hour),
8286
ExpectedSnapSealDuration: Duration(2 * time.Hour),
8387
},
88+
IPNI: IPNIConfig{
89+
Enable: true,
90+
TopicName: "",
91+
WebHost: "https://cid.contact",
92+
DirectAnnounceURLs: []string{"https://cid.contact/ingest/announce"},
93+
},
8494
},
8595
},
8696
}
@@ -266,9 +276,6 @@ type CurioSubsystemsConfig struct {
266276
// Batch Seal
267277
EnableBatchSeal bool
268278

269-
// EnableDealMarket
270-
EnableDealMarket bool
271-
272279
// EnableCommP enabled the commP task on te node. CommP is calculated before sending PublishDealMessage for a Mk12 deal
273280
EnableCommP bool
274281
}
@@ -538,6 +545,9 @@ type ApisConfig struct {
538545
type MarketConfig struct {
539546
// StorageMarketConfig houses all the deal related market configuration
540547
StorageMarketConfig StorageMarketConfig
548+
549+
// HTTP configuration for market HTTP server
550+
HTTP HTTPConfig
541551
}
542552

543553
type StorageMarketConfig struct {
@@ -551,6 +561,9 @@ type StorageMarketConfig struct {
551561
// Indexing configuration for deal indexing
552562
Indexing IndexingConfig
553563

564+
// IPNI configuration for ipni-provider
565+
IPNI IPNIConfig
566+
554567
// MK12 encompasses all configuration related to deal protocol mk1.2.0 and mk1.2.1 (i.e. Boost deals)
555568
MK12 MK12Config
556569
}
@@ -614,3 +627,31 @@ type Libp2pConfig struct {
614627
// Format: multiaddress
615628
NoAnnounceAddresses []string
616629
}
630+
631+
type IPNIConfig struct {
632+
// Enable set whether to enable indexing announcement to the network and expose endpoints that
633+
// allow indexer nodes to process announcements. Enabled by default.
634+
Enable bool
635+
636+
// TopicName sets the topic name on which the changes to the advertised content are announced.
637+
// If not explicitly specified, the topic name is automatically inferred from the network name
638+
// in following format: '/indexer/ingest/<network-name>'
639+
// Defaults to empty, which implies the topic name is inferred from network name.
640+
TopicName string
641+
642+
// The network indexer host that the web UI should link to for published announcements
643+
WebHost string
644+
645+
// The list of URLs of indexing nodes to announce to.
646+
DirectAnnounceURLs []string
647+
}
648+
649+
type HTTPConfig struct {
650+
// ListenAddress is where HTTP server will be listening on
651+
ListenAddress string
652+
653+
// AnnounceAddresses is a list of addresses clients can use to reach to the HTTP market node.
654+
// Curio allows running more than one node for HTTP server and thus all addressed can be announced
655+
// simultaneously to the client
656+
AnnounceAddresses []string
657+
}

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)