Skip to content

Commit 839e185

Browse files
authored
feat: index provider (#182)
* basic mk12 scafolding * fix gen test * poller redesign * remove indexing table, add defaults * fix ingest, market tasks * incomplete basic UI code * finish libp2p init, fix tests * fix test-all * ipni provider * fix storeiface, publisher multiaddrs * close rows * apply suggestions * fix error * fix contextID type, move ipni in market * gen, remove old market sql
1 parent dbec7a0 commit 839e185

File tree

33 files changed

+1854
-160
lines changed

33 files changed

+1854
-160
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,9 @@ workflows:
283283
suite: test-all
284284
get-params: true
285285
resource_class: 2xlarge
286+
- test:
287+
name: test-idxStore
288+
requires:
289+
- build
290+
suite: test-all
291+
get-params: true

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ build/.update-modules:
6666
# end git modules
6767

6868
## CUDA Library Path
69-
CUDA_PATH := $(shell dirname $$(dirname $$(which nvcc)))
70-
CUDA_LIB_PATH := $(CUDA_PATH)/lib64
71-
LIBRARY_PATH ?= $(CUDA_LIB_PATH)
72-
export LIBRARY_PATH
69+
setup_cuda:
70+
$(eval CUDA_PATH := $(shell dirname $$(dirname $$(which nvcc))))
71+
$(eval CUDA_LIB_PATH := $(CUDA_PATH)/lib64)
72+
export LIBRARY_PATH=$(CUDA_LIB_PATH)
73+
.PHONY: setup_cuda
7374

7475
## MAIN BINARIES
7576

@@ -97,7 +98,7 @@ BINS+=sptool
9798

9899
ifeq ($(shell uname),Linux)
99100

100-
batchdep: build/.supraseal-install
101+
batchdep: setup_cuda build/.supraseal-install
101102
batchdep: $(BUILD_DEPS)
102103
.PHONY: batchdep
103104

cmd/curio/tasks/tasks.go

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

243243
indexingTask := indexing.NewIndexingTask(db, sc, iStore, pp, cfg)
244-
activeTasks = append(activeTasks, indexingTask)
244+
ipniTask := indexing.NewIPNITask(db, sc, iStore, pp, cfg)
245+
activeTasks = append(activeTasks, indexingTask, ipniTask)
245246

246247
}
247248

deps/config/doc_gen.go

Lines changed: 61 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: 47 additions & 0 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:12400",
76+
AnnounceAddresses: []string{},
77+
},
7478
StorageMarketConfig: StorageMarketConfig{
7579
PieceLocator: []PieceLocatorConfig{},
7680
Indexing: IndexingConfig{
@@ -90,6 +94,11 @@ func DefaultCurioConfig() *CurioConfig {
9094
ExpectedPoRepSealDuration: Duration(8 * time.Hour),
9195
ExpectedSnapSealDuration: Duration(2 * time.Hour),
9296
},
97+
IPNI: IPNIConfig{
98+
EntriesCacheCapacity: 4096,
99+
WebHost: "https://cid.contact",
100+
DirectAnnounceURLs: []string{"https://cid.contact/ingest/announce"},
101+
},
93102
},
94103
},
95104
}
@@ -576,6 +585,9 @@ type ApisConfig struct {
576585
type MarketConfig struct {
577586
// StorageMarketConfig houses all the deal related market configuration
578587
StorageMarketConfig StorageMarketConfig
588+
589+
// HTTP configuration for market HTTP server
590+
HTTP HTTPConfig
579591
}
580592

581593
type StorageMarketConfig struct {
@@ -589,6 +601,9 @@ type StorageMarketConfig struct {
589601
// Indexing configuration for deal indexing
590602
Indexing IndexingConfig
591603

604+
// IPNI configuration for ipni-provider
605+
IPNI IPNIConfig
606+
592607
// MK12 encompasses all configuration related to deal protocol mk1.2.0 and mk1.2.1 (i.e. Boost deals)
593608
MK12 MK12Config
594609
}
@@ -638,6 +653,7 @@ type IndexingConfig struct {
638653
type Libp2pConfig struct {
639654
// Miners ID for which MK12 deals (boosts) should be disabled
640655
DisabledMiners []string
656+
641657
// Binding address for the libp2p host - 0 means random port.
642658
// Format: multiaddress; see https://multiformats.io/multiaddr/
643659
ListenAddresses []string
@@ -649,3 +665,34 @@ type Libp2pConfig struct {
649665
// Format: multiaddress
650666
NoAnnounceAddresses []string
651667
}
668+
669+
type IPNIConfig struct {
670+
// Disable set whether to disable indexing announcement to the network and expose endpoints that
671+
// allow indexer nodes to process announcements. Default: False
672+
Disable bool
673+
674+
// EntriesCacheCapacity sets the maximum capacity to use for caching the indexing advertisement
675+
// entries. Defaults to 4096 if not specified. The cache is evicted using LRU policy. The
676+
// maximum storage used by the cache is a factor of EntriesCacheCapacity, EntriesChunkSize(16384) and
677+
// the length of multihashes being advertised. For example, advertising 128-bit long multihashes
678+
// with the default EntriesCacheCapacity, and EntriesChunkSize(16384) means the cache size can grow to
679+
// 1GiB when full.
680+
EntriesCacheCapacity int
681+
682+
// The network indexer host that the web UI should link to for published announcements
683+
// TODO: should we use this for checking published heas before publishing? Later commit
684+
WebHost string
685+
686+
// The list of URLs of indexing nodes to announce to.
687+
DirectAnnounceURLs []string
688+
}
689+
690+
type HTTPConfig struct {
691+
// ListenAddress is where HTTP server will be listening on. Default is "0.0.0.0:12400"
692+
ListenAddress string
693+
694+
// AnnounceAddresses is a list of addresses clients can use to reach to the HTTP market node.
695+
// Curio allows running more than one node for HTTP server and thus all addressed can be announced
696+
// simultaneously to the client. Example: ["https://mycurio.com", "http://myNewCurio:433/XYZ", "http://1.2.3.4:433"]
697+
AnnounceAddresses []string
698+
}

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,34 @@ description: The default curio configuration
431431
# type: int
432432
#InsertConcurrency = 8
433433

434+
[Market.StorageMarketConfig.IPNI]
435+
# Disable set whether to disable indexing announcement to the network and expose endpoints that
436+
# allow indexer nodes to process announcements. Default: False
437+
#
438+
# type: bool
439+
#Disable = false
440+
441+
# EntriesCacheCapacity sets the maximum capacity to use for caching the indexing advertisement
442+
# entries. Defaults to 4096 if not specified. The cache is evicted using LRU policy. The
443+
# maximum storage used by the cache is a factor of EntriesCacheCapacity, EntriesChunkSize(16384) and
444+
# the length of multihashes being advertised. For example, advertising 128-bit long multihashes
445+
# with the default EntriesCacheCapacity, and EntriesChunkSize(16384) means the cache size can grow to
446+
# 1GiB when full.
447+
#
448+
# type: int
449+
#EntriesCacheCapacity = 4096
450+
451+
# The network indexer host that the web UI should link to for published announcements
452+
# TODO: should we use this for checking published heas before publishing? Later commit
453+
#
454+
# type: string
455+
#WebHost = "https://cid.contact"
456+
457+
# The list of URLs of indexing nodes to announce to.
458+
#
459+
# type: []string
460+
#DirectAnnounceURLs = ["https://cid.contact/ingest/announce"]
461+
434462
[Market.StorageMarketConfig.MK12]
435463
# When a deal is ready to publish, the amount of time to wait for more
436464
# deals to be ready to publish before publishing them all as a batch
@@ -493,6 +521,19 @@ description: The default curio configuration
493521
# type: []string
494522
#NoAnnounceAddresses = []
495523

524+
[Market.HTTP]
525+
# ListenAddress is where HTTP server will be listening on. Default is "0.0.0.0:12400"
526+
#
527+
# type: string
528+
#ListenAddress = "0.0.0.0:12400"
529+
530+
# AnnounceAddresses is a list of addresses clients can use to reach to the HTTP market node.
531+
# Curio allows running more than one node for HTTP server and thus all addressed can be announced
532+
# simultaneously to the client. Example: ["https://mycurio.com", "http://myNewCurio:433/XYZ", "http://1.2.3.4:433"]
533+
#
534+
# type: []string
535+
#AnnounceAddresses = []
536+
496537

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

0 commit comments

Comments
 (0)