Skip to content

Commit c72b2ed

Browse files
committed
Remove support for graphsync
1 parent cd1c19d commit c72b2ed

File tree

13 files changed

+19
-395
lines changed

13 files changed

+19
-395
lines changed

go.mod

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/ipfs/go-log/v2 v2.6.0
1010
github.com/ipld/go-car/v2 v2.14.2
1111
github.com/ipld/go-ipld-prime v0.21.0
12-
github.com/ipni/go-libipni v0.5.29
12+
github.com/ipni/go-libipni v0.6.15
1313
github.com/libp2p/go-libp2p v0.41.1
1414
github.com/mattn/go-isatty v0.0.20
1515
github.com/montanaflynn/stats v0.7.0
@@ -25,7 +25,6 @@ require (
2525
require (
2626
github.com/benbjohnson/clock v1.3.5 // indirect
2727
github.com/beorn7/perks v1.0.1 // indirect
28-
github.com/bep/debounce v1.2.1 // indirect
2928
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3029
github.com/containerd/cgroups v1.1.0 // indirect
3130
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
@@ -35,47 +34,29 @@ require (
3534
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
3635
github.com/docker/go-units v0.5.0 // indirect
3736
github.com/elastic/gosigar v0.14.3 // indirect
38-
github.com/filecoin-project/go-cbor-util v0.0.1 // indirect
39-
github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc8 // indirect
40-
github.com/filecoin-project/go-ds-versioning v0.1.2 // indirect
41-
github.com/filecoin-project/go-statemachine v1.0.2 // indirect
42-
github.com/filecoin-project/go-statestore v0.2.0 // indirect
4337
github.com/flynn/noise v1.1.0 // indirect
4438
github.com/francoispqt/gojay v1.2.13 // indirect
4539
github.com/gammazero/chanqueue v1.0.0 // indirect
4640
github.com/gammazero/deque v1.0.0 // indirect
47-
github.com/go-logr/logr v1.4.2 // indirect
48-
github.com/go-logr/stdr v1.2.2 // indirect
4941
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
5042
github.com/godbus/dbus/v5 v5.1.0 // indirect
5143
github.com/gogo/protobuf v1.3.2 // indirect
5244
github.com/google/gopacket v1.1.19 // indirect
5345
github.com/google/pprof v0.0.0-20250208200701-d0013a598941 // indirect
5446
github.com/google/uuid v1.6.0 // indirect
5547
github.com/gorilla/websocket v1.5.3 // indirect
56-
github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c // indirect
57-
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
5848
github.com/hashicorp/errwrap v1.1.0 // indirect
5949
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
6050
github.com/hashicorp/go-multierror v1.1.1 // indirect
6151
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
6252
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
6353
github.com/huin/goupnp v1.3.0 // indirect
6454
github.com/ipfs/go-block-format v0.2.0 // indirect
65-
github.com/ipfs/go-blockservice v0.5.1 // indirect
66-
github.com/ipfs/go-graphsync v0.17.0 // indirect
67-
github.com/ipfs/go-ipfs-pq v0.0.3 // indirect
6855
github.com/ipfs/go-ipfs-util v0.0.3 // indirect
6956
github.com/ipfs/go-ipld-cbor v0.1.0 // indirect
7057
github.com/ipfs/go-ipld-format v0.6.0 // indirect
71-
github.com/ipfs/go-ipld-legacy v0.2.1 // indirect
72-
github.com/ipfs/go-libipfs v0.6.2 // indirect
73-
github.com/ipfs/go-log v1.0.5 // indirect
74-
github.com/ipfs/go-peertaskqueue v0.8.1 // indirect
75-
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
7658
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
7759
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
78-
github.com/jpillora/backoff v1.0.0 // indirect
7960
github.com/klauspost/compress v1.18.0 // indirect
8061
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
8162
github.com/koron/go-ssdp v0.0.5 // indirect
@@ -104,7 +85,6 @@ require (
10485
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
10586
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
10687
github.com/opencontainers/runtime-spec v1.2.0 // indirect
107-
github.com/opentracing/opentracing-go v1.2.0 // indirect
10888
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
10989
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect
11090
github.com/pion/datachannel v1.5.10 // indirect
@@ -144,12 +124,6 @@ require (
144124
github.com/whyrusleeping/cbor-gen v0.2.0 // indirect
145125
github.com/wlynxg/anet v0.0.5 // indirect
146126
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
147-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
148-
go.opentelemetry.io/otel v1.34.0 // indirect
149-
go.opentelemetry.io/otel/metric v1.34.0 // indirect
150-
go.opentelemetry.io/otel/sdk v1.11.1 // indirect
151-
go.opentelemetry.io/otel/trace v1.34.0 // indirect
152-
go.uber.org/atomic v1.11.0 // indirect
153127
go.uber.org/dig v1.18.0 // indirect
154128
go.uber.org/fx v1.23.0 // indirect
155129
go.uber.org/mock v0.5.0 // indirect

go.sum

Lines changed: 9 additions & 295 deletions
Large diffs are not rendered by default.

pkg/adpub/client.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ type client struct {
3939
publisher peer.AddrInfo
4040
host host.Host
4141
ownsHost bool
42-
topic string
4342

4443
store *ClientStore
4544
sub *dagsync.Subscriber
@@ -73,12 +72,11 @@ func NewClient(addrInfo peer.AddrInfo, options ...Option) (Client, error) {
7372
publisher: addrInfo,
7473
host: opts.p2pHost,
7574
ownsHost: ownsHost,
76-
topic: opts.topic,
7775

7876
store: newClientStore(opts.delAfterRead),
7977
}
8078

81-
c.sub, err = dagsync.NewSubscriber(c.host, c.store.Batching, c.store.LinkSystem, c.topic, dagsync.HttpTimeout(opts.httpTimeout))
79+
c.sub, err = dagsync.NewSubscriber(c.host, c.store.LinkSystem, dagsync.HttpTimeout(opts.httpTimeout))
8280
if err != nil {
8381
return nil, err
8482
}

pkg/adpub/options.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ type config struct {
1919
maxSyncRetry uint64
2020
p2pHost host.Host
2121
syncRetryBackoff time.Duration
22-
topic string
2322
delAfterRead bool
2423
}
2524

@@ -32,7 +31,6 @@ func getOpts(opts []Option) (config, error) {
3231
entriesDepthLimit: defaultEntriesDepthLimit,
3332
httpTimeout: defaultHttpTimeout,
3433
syncRetryBackoff: 500 * time.Millisecond,
35-
topic: "/indexer/ingest/mainnet",
3634
}
3735

3836
for i, opt := range opts {
@@ -69,15 +67,6 @@ func WithLibp2pHost(h host.Host) Option {
6967
}
7068
}
7169

72-
// WithTopicName sets the topic name on which the provider announces advertised
73-
// content. Defaults to '/indexer/ingest/mainnet'.
74-
func WithTopicName(topic string) Option {
75-
return func(c *config) error {
76-
c.topic = topic
77-
return nil
78-
}
79-
}
80-
8170
// WithEntriesDepthLimit sets the depth limit when syncing an
8271
// advertisement entries chain. Setting to 0 means no limit.
8372
func WithEntriesDepthLimit(depthLimit int64) Option {

pkg/ads/dist.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var adsDistFlags = []cli.Flag{
4040
Aliases: []string{"dl"},
4141
Value: 5000,
4242
},
43-
topicFlag,
4443
}
4544

4645
func adsDistAction(ctx context.Context, cmd *cli.Command) error {
@@ -54,9 +53,7 @@ func adsDistAction(ctx context.Context, cmd *cli.Command) error {
5453
return fmt.Errorf("bad start cid: %w", err)
5554
}
5655

57-
adDist, err := dtrack.NewAdDistance(
58-
dtrack.WithTopic(cmd.String("topic")),
59-
dtrack.WithDepthLimit(cmd.Int64("dist-limit")))
56+
adDist, err := dtrack.NewAdDistance(dtrack.WithDepthLimit(cmd.Int64("dist-limit")))
6057
if err != nil {
6158
return err
6259
}

pkg/ads/flags.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,3 @@ var timeoutFlag = &cli.DurationFlag{
2323
Value: 10 * time.Second,
2424
DefaultText: "10s",
2525
}
26-
27-
var topicFlag = &cli.StringFlag{
28-
Name: "topic",
29-
Usage: "Topic on which index advertisements are published. Only needed if connecting via Graphsync with non-standard topic.",
30-
Value: "/indexer/ingest/mainnet",
31-
Aliases: []string{"t"},
32-
}

pkg/ads/get.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ var adsGetFlags = []cli.Flag{
6666
DefaultText: "100 (set to '0' for unlimited)",
6767
},
6868
timeoutFlag,
69-
topicFlag,
7069
}
7170

7271
func adsGetAction(ctx context.Context, cmd *cli.Command) error {
@@ -126,7 +125,6 @@ func adsGetAction(ctx context.Context, cmd *cli.Command) error {
126125
}
127126

128127
pubClient, err := adpub.NewClient(*addrInfo,
129-
adpub.WithTopicName(cmd.String("topic")),
130128
adpub.WithEntriesDepthLimit(cmd.Int64("entries-depth-limit")),
131129
adpub.WithHttpTimeout(cmd.Duration("timeout")))
132130
if err != nil {

pkg/ads/list.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var adsListFlags = []cli.Flag{
3636
Required: true,
3737
},
3838
timeoutFlag,
39-
topicFlag,
4039
}
4140

4241
func adsListAction(ctx context.Context, cmd *cli.Command) error {
@@ -47,7 +46,6 @@ func adsListAction(ctx context.Context, cmd *cli.Command) error {
4746

4847
provClient, err := adpub.NewClient(*addrInfo,
4948
adpub.WithDeleteAfterRead(true),
50-
adpub.WithTopicName(cmd.String("topic")),
5149
adpub.WithHttpTimeout(cmd.Duration("timeout")))
5250
if err != nil {
5351
return err

pkg/dtrack/ad_distance.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/ipfs/go-cid"
1111
"github.com/ipfs/go-datastore"
12-
dssync "github.com/ipfs/go-datastore/sync"
1312
"github.com/ipld/go-ipld-prime"
1413
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
1514
"github.com/ipni/go-libipni/dagsync"
@@ -48,8 +47,7 @@ func NewAdDistance(options ...Option) (*AdDistance, error) {
4847
}
4948

5049
store := newCountStore()
51-
gsds := dssync.MutexWrap(datastore.NewMapDatastore())
52-
sub, err := dagsync.NewSubscriber(p2pHost, gsds, store.LinkSystem, opts.topic)
50+
sub, err := dagsync.NewSubscriber(p2pHost, store.LinkSystem)
5351
if err != nil {
5452
return nil, err
5553
}

pkg/dtrack/option.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
type config struct {
88
depthLimit int64
99
p2pHost host.Host
10-
topic string
1110
}
1211

1312
type Option func(*config)
@@ -16,7 +15,6 @@ type Option func(*config)
1615
func getOpts(opts []Option) config {
1716
cfg := config{
1817
depthLimit: 5000,
19-
topic: "/indexer/ingest/mainnet",
2018
}
2119
for _, opt := range opts {
2220
opt(&cfg)
@@ -38,13 +36,3 @@ func WithP2pHost(p2pHost host.Host) Option {
3836
c.p2pHost = p2pHost
3937
}
4038
}
41-
42-
// WithTopic configures the topic name used to get the head advertisement when
43-
// using data-transfer/graphsync.
44-
func WithTopic(topic string) Option {
45-
return func(c *config) {
46-
if topic != "" {
47-
c.topic = topic
48-
}
49-
}
50-
}

0 commit comments

Comments
 (0)