Skip to content

Commit 36a9abb

Browse files
committed
ipni provider
1 parent bcd0c20 commit 36a9abb

File tree

17 files changed

+1628
-557
lines changed

17 files changed

+1628
-557
lines changed

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: 58 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: 44 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:8888",
76+
AnnounceAddresses: []string{},
77+
},
7478
StorageMarketConfig: StorageMarketConfig{
7579
PieceLocator: []PieceLocatorConfig{},
7680
Indexing: IndexingConfig{
@@ -90,6 +94,12 @@ func DefaultCurioConfig() *CurioConfig {
9094
ExpectedPoRepSealDuration: Duration(8 * time.Hour),
9195
ExpectedSnapSealDuration: Duration(2 * time.Hour),
9296
},
97+
IPNI: IPNIConfig{
98+
Enable: true,
99+
TopicName: "",
100+
WebHost: "https://cid.contact",
101+
DirectAnnounceURLs: []string{"https://cid.contact/ingest/announce"},
102+
},
93103
},
94104
},
95105
}
@@ -576,6 +586,9 @@ type ApisConfig struct {
576586
type MarketConfig struct {
577587
// StorageMarketConfig houses all the deal related market configuration
578588
StorageMarketConfig StorageMarketConfig
589+
590+
// HTTP configuration for market HTTP server
591+
HTTP HTTPConfig
579592
}
580593

581594
type StorageMarketConfig struct {
@@ -589,6 +602,9 @@ type StorageMarketConfig struct {
589602
// Indexing configuration for deal indexing
590603
Indexing IndexingConfig
591604

605+
// IPNI configuration for ipni-provider
606+
IPNI IPNIConfig
607+
592608
// MK12 encompasses all configuration related to deal protocol mk1.2.0 and mk1.2.1 (i.e. Boost deals)
593609
MK12 MK12Config
594610
}
@@ -650,3 +666,31 @@ type Libp2pConfig struct {
650666
// Format: multiaddress
651667
NoAnnounceAddresses []string
652668
}
669+
670+
type IPNIConfig struct {
671+
// Enable set whether to enable indexing announcement to the network and expose endpoints that
672+
// allow indexer nodes to process announcements. Enabled by default.
673+
Enable bool
674+
675+
// TopicName sets the topic name on which the changes to the advertised content are announced.
676+
// If not explicitly specified, the topic name is automatically inferred from the network name
677+
// in following format: '/indexer/ingest/<network-name>'
678+
// Defaults to empty, which implies the topic name is inferred from network name.
679+
TopicName string
680+
681+
// The network indexer host that the web UI should link to for published announcements
682+
WebHost string
683+
684+
// The list of URLs of indexing nodes to announce to.
685+
DirectAnnounceURLs []string
686+
}
687+
688+
type HTTPConfig struct {
689+
// ListenAddress is where HTTP server will be listening on
690+
ListenAddress string
691+
692+
// AnnounceAddresses is a list of addresses clients can use to reach to the HTTP market node.
693+
// Curio allows running more than one node for HTTP server and thus all addressed can be announced
694+
// simultaneously to the client
695+
AnnounceAddresses []string
696+
}

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,17 @@ description: The default curio configuration
229229
# type: bool
230230
#EnableBatchSeal = false
231231

232+
<<<<<<< HEAD
232233
# EnableDealMarket enabled the deal market on the node. This would also enable libp2p on the node, if configured.
233234
#
234235
# type: bool
235236
#EnableDealMarket = false
236237

237238
# EnableCommP enables the commP task on te node. CommP is calculated before sending PublishDealMessage for a Mk12 deal
238239
# Must have EnableDealMarket = True
240+
=======
241+
# EnableCommP enabled the commP task on te node. CommP is calculated before sending PublishDealMessage for a Mk12 deal
242+
>>>>>>> 563f95c (ipni provider)
239243
#
240244
# type: bool
241245
#EnableCommP = false
@@ -431,6 +435,31 @@ description: The default curio configuration
431435
# type: int
432436
#InsertConcurrency = 8
433437

438+
[Market.StorageMarketConfig.IPNI]
439+
# Enable set whether to enable indexing announcement to the network and expose endpoints that
440+
# allow indexer nodes to process announcements. Enabled by default.
441+
#
442+
# type: bool
443+
#Enable = true
444+
445+
# TopicName sets the topic name on which the changes to the advertised content are announced.
446+
# If not explicitly specified, the topic name is automatically inferred from the network name
447+
# in following format: '/indexer/ingest/<network-name>'
448+
# Defaults to empty, which implies the topic name is inferred from network name.
449+
#
450+
# type: string
451+
#TopicName = ""
452+
453+
# The network indexer host that the web UI should link to for published announcements
454+
#
455+
# type: string
456+
#WebHost = "https://cid.contact"
457+
458+
# The list of URLs of indexing nodes to announce to.
459+
#
460+
# type: []string
461+
#DirectAnnounceURLs = ["https://cid.contact/ingest/announce"]
462+
434463
[Market.StorageMarketConfig.MK12]
435464
# When a deal is ready to publish, the amount of time to wait for more
436465
# deals to be ready to publish before publishing them all as a batch

go.mod

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,21 @@ require (
5656
github.com/ipfs/go-ipld-format v0.6.0
5757
github.com/ipfs/go-log/v2 v2.5.1
5858
github.com/ipld/go-car/v2 v2.13.1
59-
github.com/ipni/go-libipni v0.0.8
59+
github.com/ipld/go-ipld-prime v0.21.0
60+
github.com/ipni/go-libipni v0.6.11
6061
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
6162
github.com/kelseyhightower/envconfig v1.4.0
6263
github.com/libp2p/go-buffer-pool v0.1.0
63-
github.com/libp2p/go-libp2p v0.35.4
64+
github.com/libp2p/go-libp2p v0.36.2
6465
github.com/manifoldco/promptui v0.9.0
6566
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
6667
github.com/minio/sha256-simd v1.0.1
6768
github.com/mitchellh/go-homedir v1.1.0
68-
github.com/multiformats/go-multiaddr v0.12.4
69+
github.com/multiformats/go-multiaddr v0.13.0
6970
github.com/multiformats/go-multihash v0.2.3
7071
github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333
7172
github.com/pkg/errors v0.9.1
72-
github.com/prometheus/client_golang v1.19.1
73+
github.com/prometheus/client_golang v1.20.0
7374
github.com/puzpuzpuz/xsync/v2 v2.4.0
7475
github.com/raulk/clock v1.1.0
7576
github.com/samber/lo v1.39.0
@@ -85,12 +86,12 @@ require (
8586
go.opencensus.io v0.24.0
8687
go.uber.org/multierr v1.11.0
8788
go.uber.org/zap v1.27.0
88-
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
89-
golang.org/x/net v0.26.0
90-
golang.org/x/sync v0.7.0
91-
golang.org/x/sys v0.23.0
92-
golang.org/x/text v0.16.0
93-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
89+
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
90+
golang.org/x/net v0.28.0
91+
golang.org/x/sync v0.8.0
92+
golang.org/x/sys v0.24.0
93+
golang.org/x/text v0.17.0
94+
golang.org/x/tools v0.24.0
9495
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9
9596
)
9697

@@ -134,7 +135,7 @@ require (
134135
github.com/drand/kyber-bls12381 v0.3.1 // indirect
135136
github.com/elastic/go-elasticsearch/v7 v7.14.0 // indirect
136137
github.com/elastic/go-windows v1.0.0 // indirect
137-
github.com/elastic/gosigar v0.14.2 // indirect
138+
github.com/elastic/gosigar v0.14.3 // indirect
138139
github.com/etclabscore/go-jsonschema-walk v0.0.6 // indirect
139140
github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 // indirect
140141
github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect
@@ -174,7 +175,7 @@ require (
174175
github.com/golang/protobuf v1.5.4 // indirect
175176
github.com/golang/snappy v0.0.4 // indirect
176177
github.com/google/gopacket v1.1.19 // indirect
177-
github.com/google/pprof v0.0.0-20240509144519-723abb6459b7 // indirect
178+
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
178179
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
179180
github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 // indirect
180181
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
@@ -202,7 +203,6 @@ require (
202203
github.com/ipfs/go-verifcid v0.0.3 // indirect
203204
github.com/ipld/go-car v0.6.2 // indirect
204205
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
205-
github.com/ipld/go-ipld-prime v0.21.0 // indirect
206206
github.com/jackc/pgpassfile v1.0.0 // indirect
207207
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
208208
github.com/jackc/puddle/v2 v2.2.1 // indirect
@@ -222,7 +222,7 @@ require (
222222
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
223223
github.com/libp2p/go-libp2p-kad-dht v0.25.2 // indirect
224224
github.com/libp2p/go-libp2p-kbucket v0.6.3 // indirect
225-
github.com/libp2p/go-libp2p-pubsub v0.11.0 // indirect
225+
github.com/libp2p/go-libp2p-pubsub v0.12.0 // indirect
226226
github.com/libp2p/go-libp2p-record v0.2.0 // indirect
227227
github.com/libp2p/go-libp2p-routing-helpers v0.7.3 // indirect
228228
github.com/libp2p/go-maddr-filter v0.1.0 // indirect
@@ -239,7 +239,7 @@ require (
239239
github.com/mattn/go-isatty v0.0.20 // indirect
240240
github.com/mattn/go-runewidth v0.0.15 // indirect
241241
github.com/mattn/go-sqlite3 v1.14.16 // indirect
242-
github.com/miekg/dns v1.1.59 // indirect
242+
github.com/miekg/dns v1.1.62 // indirect
243243
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
244244
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
245245
github.com/mr-tron/base58 v1.2.0 // indirect
@@ -256,35 +256,35 @@ require (
256256
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
257257
github.com/nikkolasg/hexjson v0.1.0 // indirect
258258
github.com/nkovacs/streamquote v1.0.0 // indirect
259-
github.com/onsi/ginkgo/v2 v2.17.3 // indirect
259+
github.com/onsi/ginkgo/v2 v2.20.0 // indirect
260260
github.com/opencontainers/runtime-spec v1.2.0 // indirect
261261
github.com/opentracing/opentracing-go v1.2.0 // indirect
262262
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
263263
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect
264-
github.com/pion/datachannel v1.5.6 // indirect
265-
github.com/pion/dtls/v2 v2.2.11 // indirect
266-
github.com/pion/ice/v2 v2.3.25 // indirect
267-
github.com/pion/interceptor v0.1.29 // indirect
264+
github.com/pion/datachannel v1.5.8 // indirect
265+
github.com/pion/dtls/v2 v2.2.12 // indirect
266+
github.com/pion/ice/v2 v2.3.34 // indirect
267+
github.com/pion/interceptor v0.1.30 // indirect
268268
github.com/pion/logging v0.2.2 // indirect
269269
github.com/pion/mdns v0.0.12 // indirect
270270
github.com/pion/randutil v0.1.0 // indirect
271271
github.com/pion/rtcp v1.2.14 // indirect
272-
github.com/pion/rtp v1.8.6 // indirect
273-
github.com/pion/sctp v1.8.16 // indirect
272+
github.com/pion/rtp v1.8.9 // indirect
273+
github.com/pion/sctp v1.8.33 // indirect
274274
github.com/pion/sdp/v3 v3.0.9 // indirect
275-
github.com/pion/srtp/v2 v2.0.18 // indirect
275+
github.com/pion/srtp/v2 v2.0.20 // indirect
276276
github.com/pion/stun v0.6.1 // indirect
277-
github.com/pion/transport/v2 v2.2.5 // indirect
277+
github.com/pion/transport/v2 v2.2.10 // indirect
278278
github.com/pion/turn/v2 v2.1.6 // indirect
279-
github.com/pion/webrtc/v3 v3.2.40 // indirect
279+
github.com/pion/webrtc/v3 v3.3.0 // indirect
280280
github.com/pmezard/go-difflib v1.0.0 // indirect
281281
github.com/polydawn/refmt v0.89.0 // indirect
282282
github.com/prometheus/client_model v0.6.1 // indirect
283283
github.com/prometheus/common v0.55.0 // indirect
284284
github.com/prometheus/procfs v0.15.1 // indirect
285285
github.com/prometheus/statsd_exporter v0.22.7 // indirect
286286
github.com/quic-go/qpack v0.4.0 // indirect
287-
github.com/quic-go/quic-go v0.44.0 // indirect
287+
github.com/quic-go/quic-go v0.46.0 // indirect
288288
github.com/quic-go/webtransport-go v0.8.0 // indirect
289289
github.com/raulk/go-watchdog v1.3.0 // indirect
290290
github.com/rivo/uniseg v0.4.7 // indirect
@@ -299,6 +299,7 @@ require (
299299
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
300300
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
301301
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
302+
github.com/wlynxg/anet v0.0.4 // indirect
302303
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
303304
github.com/zondax/hid v0.9.2 // indirect
304305
github.com/zondax/ledger-filecoin-go v0.11.1 // indirect
@@ -315,13 +316,13 @@ require (
315316
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
316317
go.opentelemetry.io/otel/trace v1.28.0 // indirect
317318
go.uber.org/atomic v1.11.0 // indirect
318-
go.uber.org/dig v1.17.1 // indirect
319-
go.uber.org/fx v1.22.1 // indirect
319+
go.uber.org/dig v1.18.0 // indirect
320+
go.uber.org/fx v1.22.2 // indirect
320321
go.uber.org/mock v0.4.0 // indirect
321322
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
322-
golang.org/x/crypto v0.25.0 // indirect
323-
golang.org/x/mod v0.17.0 // indirect
324-
golang.org/x/term v0.22.0 // indirect
323+
golang.org/x/crypto v0.26.0 // indirect
324+
golang.org/x/mod v0.20.0 // indirect
325+
golang.org/x/term v0.23.0 // indirect
325326
golang.org/x/time v0.5.0 // indirect
326327
gonum.org/v1/gonum v0.15.0 // indirect
327328
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect

0 commit comments

Comments
 (0)