@helia/ipns 9.1.9-12fd8522 → 9.1.9-1a2ebead

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,16 @@ export interface IPNSPublishMetadata {
6
6
  }
7
7
  export declare namespace IPNSPublishMetadata {
8
8
  const codec: () => Codec<IPNSPublishMetadata>;
9
- const encode: (obj: Partial<IPNSPublishMetadata>) => Uint8Array;
10
- const decode: (buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<IPNSPublishMetadata>) => IPNSPublishMetadata;
9
+ interface IPNSPublishMetadataKeyNameFieldEvent {
10
+ field: '$.keyName';
11
+ value: string;
12
+ }
13
+ interface IPNSPublishMetadataLifetimeFieldEvent {
14
+ field: '$.lifetime';
15
+ value: number;
16
+ }
17
+ function encode(obj: Partial<IPNSPublishMetadata>): Uint8Array;
18
+ function decode(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<IPNSPublishMetadata>): IPNSPublishMetadata;
19
+ function stream(buf: Uint8Array | Uint8ArrayList, opts?: DecodeOptions<IPNSPublishMetadata>): Generator<IPNSPublishMetadataKeyNameFieldEvent | IPNSPublishMetadataLifetimeFieldEvent>;
11
20
  }
12
21
  //# sourceMappingURL=metadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/pb/metadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,mBAAmB,CAAC;IAG5B,MAAM,KAAK,QAAO,KAAK,CAAC,mBAAmB,CAoDjD,CAAA;IAEM,MAAM,MAAM,GAAI,KAAK,OAAO,CAAC,mBAAmB,CAAC,KAAG,UAE1D,CAAA;IAEM,MAAM,MAAM,GAAI,KAAK,UAAU,GAAG,cAAc,EAAE,OAAO,aAAa,CAAC,mBAAmB,CAAC,KAAG,mBAEpG,CAAA;CACF"}
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/pb/metadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,yBAAiB,mBAAmB,CAAC;IAG5B,MAAM,KAAK,QAAO,KAAK,CAAC,mBAAmB,CA+EjD,CAAA;IAED,UAAiB,oCAAoC;QACnD,KAAK,EAAE,WAAW,CAAA;QAClB,KAAK,EAAE,MAAM,CAAA;KACd;IAED,UAAiB,qCAAqC;QACpD,KAAK,EAAE,YAAY,CAAA;QACnB,KAAK,EAAE,MAAM,CAAA;KACd;IAED,SAAgB,MAAM,CAAE,GAAG,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,UAAU,CAErE;IAED,SAAgB,MAAM,CAAE,GAAG,EAAE,UAAU,GAAG,cAAc,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAExH;IAED,SAAgB,MAAM,CAAE,GAAG,EAAE,UAAU,GAAG,cAAc,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC,oCAAoC,GAAG,qCAAqC,CAAC,CAE5L;CACF"}
@@ -1,4 +1,4 @@
1
- import { decodeMessage, encodeMessage, message } from 'protons-runtime';
1
+ import { decodeMessage, encodeMessage, message, streamMessage } from 'protons-runtime';
2
2
  export var IPNSPublishMetadata;
3
3
  (function (IPNSPublishMetadata) {
4
4
  let _codec;
@@ -43,15 +43,46 @@ export var IPNSPublishMetadata;
43
43
  }
44
44
  }
45
45
  return obj;
46
+ }, function* (reader, length, prefix, opts = {}) {
47
+ const end = length == null ? reader.len : reader.pos + length;
48
+ while (reader.pos < end) {
49
+ const tag = reader.uint32();
50
+ switch (tag >>> 3) {
51
+ case 1: {
52
+ yield {
53
+ field: `${prefix}.keyName`,
54
+ value: reader.string()
55
+ };
56
+ break;
57
+ }
58
+ case 2: {
59
+ yield {
60
+ field: `${prefix}.lifetime`,
61
+ value: reader.uint32()
62
+ };
63
+ break;
64
+ }
65
+ default: {
66
+ reader.skipType(tag & 7);
67
+ break;
68
+ }
69
+ }
70
+ }
46
71
  });
47
72
  }
48
73
  return _codec;
49
74
  };
50
- IPNSPublishMetadata.encode = (obj) => {
75
+ function encode(obj) {
51
76
  return encodeMessage(obj, IPNSPublishMetadata.codec());
52
- };
53
- IPNSPublishMetadata.decode = (buf, opts) => {
77
+ }
78
+ IPNSPublishMetadata.encode = encode;
79
+ function decode(buf, opts) {
54
80
  return decodeMessage(buf, IPNSPublishMetadata.codec(), opts);
55
- };
81
+ }
82
+ IPNSPublishMetadata.decode = decode;
83
+ function stream(buf, opts) {
84
+ return streamMessage(buf, IPNSPublishMetadata.codec(), opts);
85
+ }
86
+ IPNSPublishMetadata.stream = stream;
56
87
  })(IPNSPublishMetadata || (IPNSPublishMetadata = {}));
57
88
  //# sourceMappingURL=metadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/pb/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AASvE,MAAM,KAAW,mBAAmB,CAgEnC;AAhED,WAAiB,mBAAmB;IAClC,IAAI,MAAkC,CAAA;IAEzB,yBAAK,GAAG,GAA+B,EAAE;QACpD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,GAAG,OA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gB,MAAM,CAAE,GAAiC;QACvD,OAAO,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAA;IACxD,CAAC;IAFe,0BAAM,SAErB,CAAA;IAED,SAAgB,MAAM,CAAE,GAAgC,EAAE,IAAyC;QACjG,OAAO,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAA;IAC9D,CAAC;IAFe,0BAAM,SAErB,CAAA;IAED,SAAgB,MAAM,CAAE,GAAgC,EAAE,IAAyC;QACjG,OAAO,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAA;IAC9D,CAAC;IAFe,0BAAM,SAErB,CAAA;AACH,CAAC,EAzGgB,mBAAmB,KAAnB,mBAAmB,QAyGnC"}
@@ -1,6 +1,8 @@
1
- import type { IPNSRouting } from './index.ts';
2
- import type { PeerId, TypedEventTarget, ComponentLogger } from '@libp2p/interface';
1
+ import type { GetOptions, IPNSRouting, PutOptions } from './index.ts';
2
+ import type { Fetch } from '@libp2p/fetch';
3
+ import type { PeerId, PublicKey, TypedEventTarget, ComponentLogger, Startable, Metrics, Libp2p } from '@libp2p/interface';
3
4
  import type { Datastore } from 'interface-datastore';
5
+ import type { MultihashDigest } from 'multiformats/hashes/interface';
4
6
  import type { ProgressEvent } from 'progress-events';
5
7
  export interface Message {
6
8
  type: 'signed' | 'unsigned';
@@ -8,7 +10,16 @@ export interface Message {
8
10
  topic: string;
9
11
  data: Uint8Array;
10
12
  }
13
+ export interface Subscription {
14
+ topic: string;
15
+ subscribe: boolean;
16
+ }
17
+ export interface SubscriptionChangeData {
18
+ peerId: PeerId;
19
+ subscriptions: Subscription[];
20
+ }
11
21
  export interface PubSubEvents {
22
+ 'subscription-change': CustomEvent<SubscriptionChangeData>;
12
23
  message: CustomEvent<Message>;
13
24
  }
14
25
  export interface PublishResult {
@@ -24,12 +35,31 @@ export interface PubSub extends TypedEventTarget<PubSubEvents> {
24
35
  export interface PubsubRoutingComponents {
25
36
  datastore: Datastore;
26
37
  logger: ComponentLogger;
27
- libp2p: {
28
- peerId: PeerId;
29
- services: {
30
- pubsub: PubSub;
31
- };
32
- };
38
+ metrics?: Metrics;
39
+ libp2p: Pick<Libp2p<{
40
+ pubsub: PubSub;
41
+ fetch?: Fetch;
42
+ }>, 'peerId' | 'register' | 'unregister' | 'services'>;
43
+ }
44
+ export interface PubsubRoutingInit {
45
+ /**
46
+ * How many fetch requests to run concurrently
47
+ *
48
+ * @default 8
49
+ */
50
+ fetchConcurrency?: number;
51
+ /**
52
+ * How long to allow a fetch request to run for in ms
53
+ *
54
+ * @default 2_500
55
+ */
56
+ fetchTimeout?: number;
57
+ /**
58
+ * How many ms to wait before sending a fetch request to a topic peer
59
+ *
60
+ * @default 0
61
+ */
62
+ fetchDelay?: number;
33
63
  }
34
64
  export type PubSubProgressEvents = ProgressEvent<'ipns:pubsub:publish', {
35
65
  topic: string;
@@ -37,6 +67,41 @@ export type PubSubProgressEvents = ProgressEvent<'ipns:pubsub:publish', {
37
67
  }> | ProgressEvent<'ipns:pubsub:subscribe', {
38
68
  topic: string;
39
69
  }> | ProgressEvent<'ipns:pubsub:error', Error>;
70
+ export declare class PubSubRouting implements IPNSRouting, Startable {
71
+ #private;
72
+ private readonly subscriptions;
73
+ private readonly localStore;
74
+ private readonly libp2p;
75
+ private readonly fetchConcurrency;
76
+ private readonly fetchTimeout;
77
+ private readonly fetchDelay;
78
+ private readonly fetchQueue;
79
+ private readonly fetchPeers;
80
+ private shutdownController;
81
+ private fetchTopologyId?;
82
+ constructor(components: PubsubRoutingComponents, init?: PubsubRoutingInit);
83
+ /**
84
+ * Put a value to the pubsub datastore indexed by the received key properly encoded
85
+ */
86
+ put(routingKey: Uint8Array, marshaledRecord: Uint8Array, options?: PutOptions): Promise<void>;
87
+ /**
88
+ * Get a value from the pubsub datastore indexed by the received key properly encoded.
89
+ * Also, the identifier topic is subscribed to and the pubsub datastore records will be
90
+ * updated once new publishes occur
91
+ */
92
+ get(routingKey: Uint8Array, options?: GetOptions): Promise<Uint8Array>;
93
+ /**
94
+ * Get pubsub subscriptions related to ipns
95
+ */
96
+ getSubscriptions(): string[];
97
+ /**
98
+ * Cancel pubsub subscriptions related to ipns
99
+ */
100
+ cancel(key: PublicKey | MultihashDigest<0x00 | 0x12>): void;
101
+ toString(): string;
102
+ start(): Promise<void>;
103
+ stop(): void;
104
+ }
40
105
  /**
41
106
  * This IPNS routing receives IPNS record updates via dedicated
42
107
  * pubsub topic.
@@ -45,5 +110,5 @@ export type PubSubProgressEvents = ProgressEvent<'ipns:pubsub:publish', {
45
110
  * updated records, so the first call to `.get` should be expected
46
111
  * to fail!
47
112
  */
48
- export declare function pubsub(components: PubsubRoutingComponents): IPNSRouting;
113
+ export declare function pubsub(components: PubsubRoutingComponents, init?: PubsubRoutingInit): IPNSRouting;
49
114
  //# sourceMappingURL=pubsub.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pubsub.d.ts","sourceRoot":"","sources":["../../../src/routing/pubsub.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAc,WAAW,EAAc,MAAM,YAAY,CAAA;AAErE,OAAO,KAAK,EAAE,MAAM,EAAa,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC7F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAIpD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,UAAU,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,M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,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBxG;;;;OAIG;IACG,GAAG,CAAE,UAAU,EAAE,UAAU,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAuDjF;;OAEG;IACH,gBAAgB,IAAK,MAAM,EAAE;IAI7B;;OAEG;IACH,MAAM,CAAE,GAAG,EAAE,SAAS,GAAG,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,IAAI;IAc5D,QAAQ,IAAK,MAAM;IAIb,KAAK,IAAK,OAAO,CAAC,IAAI,CAAC;IAkB7B,IAAI,IAAK,IAAI;CAQd;AA0BD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAE,UAAU,EAAE,uBAAuB,EAAE,IAAI,GAAE,iBAAsB,GAAG,WAAW,CAEtG"}
@@ -1,61 +1,172 @@
1
- import { isPublicKey } from '@libp2p/interface';
1
+ import { isPublicKey, NotFoundError, setMaxListeners } from '@libp2p/interface';
2
2
  import { logger } from '@libp2p/logger';
3
+ import { PeerSet } from '@libp2p/peer-collections';
4
+ import { Queue } from '@libp2p/utils';
5
+ import { anySignal } from 'any-signal';
6
+ import delay from 'delay';
3
7
  import { multihashToIPNSRoutingKey } from 'ipns';
4
8
  import { ipnsSelector } from 'ipns/selector';
5
9
  import { ipnsValidator } from 'ipns/validator';
6
10
  import { CustomProgressEvent } from 'progress-events';
11
+ import { raceSignal } from 'race-signal';
7
12
  import { equals as uint8ArrayEquals } from 'uint8arrays/equals';
8
13
  import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
9
14
  import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
10
15
  import { InvalidTopicError } from "../errors.js";
11
16
  import { localStore } from "../local-store.js";
17
+ import { IPNS_STRING_PREFIX } from "../utils.js";
12
18
  const log = logger('helia:ipns:routing:pubsub');
13
- class PubSubRouting {
19
+ export class PubSubRouting {
14
20
  subscriptions;
15
21
  localStore;
16
- peerId;
17
- pubsub;
18
- constructor(components) {
19
- this.subscriptions = [];
22
+ libp2p;
23
+ fetchConcurrency;
24
+ fetchTimeout;
25
+ fetchDelay;
26
+ fetchQueue;
27
+ fetchPeers;
28
+ shutdownController;
29
+ fetchTopologyId;
30
+ constructor(components, init = {}) {
31
+ this.subscriptions = new Set();
32
+ this.shutdownController = new AbortController();
33
+ setMaxListeners(Infinity, this.shutdownController.signal);
34
+ this.fetchPeers = new PeerSet();
20
35
  this.localStore = localStore(components.datastore, components.logger.forComponent('helia:ipns:local-store'));
21
- this.peerId = components.libp2p.peerId;
22
- this.pubsub = components.libp2p.services.pubsub;
23
- this.pubsub.addEventListener('message', (evt) => {
36
+ this.libp2p = components.libp2p;
37
+ this.fetchConcurrency = init.fetchConcurrency ?? 8;
38
+ this.fetchDelay = init.fetchDelay ?? 0;
39
+ // default libp2p-fetch timeout is 10 seconds - we should have an existing
40
+ // connection to the peer so this can be shortened
41
+ this.fetchTimeout = init.fetchTimeout ?? 2_500;
42
+ this.fetchQueue = new Queue({
43
+ concurrency: this.fetchConcurrency,
44
+ metrics: components.metrics,
45
+ metricName: 'helia_ipns_pubsub_fetch_queue'
46
+ });
47
+ this.libp2p.services.pubsub.addEventListener('message', (evt) => {
24
48
  const message = evt.detail;
25
- if (!this.subscriptions.includes(message.topic)) {
49
+ if (!this.subscriptions.has(message.topic)) {
26
50
  return;
27
51
  }
28
- this.#processPubSubMessage(message).catch(err => {
52
+ this.#processPubSubMessage(message, {
53
+ signal: this.shutdownController.signal
54
+ }).catch(err => {
29
55
  log.error('Error processing message - %e', err);
30
56
  });
31
57
  });
58
+ // ipns over libp2p-fetch feature
59
+ if (this.libp2p.services.fetch != null) {
60
+ try {
61
+ this.libp2p.services.pubsub.addEventListener('subscription-change', (evt) => {
62
+ const { peerId, subscriptions } = evt.detail;
63
+ if (!this.fetchPeers.has(peerId)) {
64
+ return;
65
+ }
66
+ for (const sub of subscriptions) {
67
+ if (!this.subscriptions.has(sub.topic)) {
68
+ continue;
69
+ }
70
+ if (sub.subscribe === false) {
71
+ continue;
72
+ }
73
+ log('peer %s joined topic %s', peerId, sub.topic);
74
+ const routingKey = topicToKey(sub.topic);
75
+ this.#fetchFromPeer(sub.topic, routingKey, peerId, {
76
+ signal: this.shutdownController.signal
77
+ })
78
+ .catch(err => {
79
+ log.error('failed to fetch IPNS record for %m from peer %s - %e', routingKey, peerId, err);
80
+ });
81
+ }
82
+ });
83
+ this.libp2p.services.fetch.registerLookupFunction(IPNS_STRING_PREFIX, async (key) => {
84
+ try {
85
+ const { record } = await this.localStore.get(key, {
86
+ signal: this.shutdownController.signal
87
+ });
88
+ return record;
89
+ }
90
+ catch (err) {
91
+ if (err.name !== 'NotFoundError') {
92
+ throw err;
93
+ }
94
+ }
95
+ });
96
+ log('registered lookup function for IPNS with libp2p/fetch service');
97
+ }
98
+ catch (e) {
99
+ log('unable to register lookup function for IPNS with libp2p/fetch service - %e', e);
100
+ }
101
+ }
102
+ else {
103
+ log('no libp2p/fetch service found. Skipping registration of lookup function for IPNS.');
104
+ }
32
105
  }
33
- async #processPubSubMessage(message) {
106
+ async #processPubSubMessage(message, options) {
34
107
  log('message received for topic', message.topic);
35
108
  if (message.type !== 'signed') {
36
109
  log.error('unsigned message received, this module can only work with signed messages');
37
110
  return;
38
111
  }
39
- if (message.from.equals(this.peerId)) {
112
+ if (message.from.equals(this.libp2p.peerId)) {
40
113
  log('not storing record from self');
41
114
  return;
42
115
  }
43
- const routingKey = topicToKey(message.topic);
44
- await ipnsValidator(routingKey, message.data);
116
+ await this.#handleRecord(message.topic, topicToKey(message.topic), message.data, false, options);
117
+ }
118
+ async #fetchFromPeer(topic, routingKey, peerId, options) {
119
+ const marshalledRecord = await this.fetchQueue.add(async ({ signal }) => {
120
+ log('fetching ipns record for %m from peer %s', routingKey, peerId);
121
+ const sig = anySignal([
122
+ signal,
123
+ AbortSignal.timeout(this.fetchTimeout)
124
+ ]);
125
+ try {
126
+ return await this.libp2p.services.fetch?.fetch(peerId, routingKey, {
127
+ signal: sig
128
+ });
129
+ }
130
+ finally {
131
+ sig.clear();
132
+ }
133
+ }, options);
134
+ if (marshalledRecord == null) {
135
+ throw new NotFoundError(`Peer ${peerId} did not have record for routing key ${uint8ArrayToString(routingKey, 'base64')}`);
136
+ }
137
+ log('fetched ipns record for %m from peer %s', routingKey, peerId);
138
+ return this.#handleRecord(topic, routingKey, marshalledRecord, true, options);
139
+ }
140
+ async #handleRecord(topic, routingKey, marshalledRecord, publish, options) {
141
+ await ipnsValidator(routingKey, marshalledRecord);
142
+ this.shutdownController.signal.throwIfAborted();
45
143
  if (await this.localStore.has(routingKey)) {
46
- const { record: currentRecord } = await this.localStore.get(routingKey);
47
- if (uint8ArrayEquals(currentRecord, message.data)) {
48
- log('not storing record as we already have it');
49
- return;
144
+ const { record: currentRecord } = await this.localStore.get(routingKey, options);
145
+ if (uint8ArrayEquals(currentRecord, marshalledRecord)) {
146
+ log.trace('found identical record for %m', routingKey);
147
+ return currentRecord;
50
148
  }
51
- const records = [currentRecord, message.data];
149
+ const records = [currentRecord, marshalledRecord];
52
150
  const index = ipnsSelector(routingKey, records);
53
151
  if (index === 0) {
54
- log('not storing record as the one we have is better');
55
- return;
152
+ log.trace('found old record for %m', routingKey);
153
+ return currentRecord;
154
+ }
155
+ }
156
+ log('found new record for %m', routingKey);
157
+ await this.localStore.put(routingKey, marshalledRecord, options);
158
+ // if the record was received via fetch, republish it
159
+ if (publish) {
160
+ log('publish value for topic %s', topic);
161
+ try {
162
+ const result = await this.libp2p.services.pubsub.publish(topic, marshalledRecord);
163
+ log('published record on topic %s to %d recipients', topic, result.recipients);
164
+ }
165
+ catch (err) {
166
+ log.error('could not publish record on topic %s - %e', err);
56
167
  }
57
168
  }
58
- await this.localStore.put(routingKey, message.data);
169
+ return marshalledRecord;
59
170
  }
60
171
  /**
61
172
  * Put a value to the pubsub datastore indexed by the received key properly encoded
@@ -64,7 +175,8 @@ class PubSubRouting {
64
175
  try {
65
176
  const topic = keyToTopic(routingKey);
66
177
  log('publish value for topic %s', topic);
67
- const result = await this.pubsub.publish(topic, marshaledRecord);
178
+ const result = await this.libp2p.services.pubsub.publish(topic, marshaledRecord);
179
+ options?.signal?.throwIfAborted();
68
180
  log('published record on topic %s to %d recipients', topic, result.recipients);
69
181
  options.onProgress?.(new CustomProgressEvent('ipns:pubsub:publish', { topic, result }));
70
182
  }
@@ -79,29 +191,53 @@ class PubSubRouting {
79
191
  * updated once new publishes occur
80
192
  */
81
193
  async get(routingKey, options = {}) {
194
+ const topic = keyToTopic(routingKey);
82
195
  try {
83
- const topic = keyToTopic(routingKey);
84
196
  // ensure we are subscribed to topic
85
- if (!this.pubsub.getTopics().includes(topic)) {
197
+ if (!this.libp2p.services.pubsub.getTopics().includes(topic)) {
86
198
  log('add subscription for topic', topic);
87
- this.pubsub.subscribe(topic);
88
- this.subscriptions.push(topic);
199
+ this.libp2p.services.pubsub.subscribe(topic);
200
+ this.subscriptions.add(topic);
89
201
  options.onProgress?.(new CustomProgressEvent('ipns:pubsub:subscribe', { topic }));
90
202
  }
91
- // chain through to local store
92
- const { record } = await this.localStore.get(routingKey, options);
93
- return record;
94
203
  }
95
204
  catch (err) {
96
205
  options.onProgress?.(new CustomProgressEvent('ipns:pubsub:error', err));
97
206
  throw err;
98
207
  }
208
+ // delay before fetch to allow pubsub to resolve
209
+ await raceSignal(delay(this.fetchDelay), this.shutdownController.signal);
210
+ const fetchController = new AbortController();
211
+ const promises = [];
212
+ for (const peerId of this.libp2p.services.pubsub.getSubscribers(topic)) {
213
+ const signal = anySignal([
214
+ options?.signal,
215
+ fetchController.signal
216
+ ]);
217
+ promises.push(this.#fetchFromPeer(topic, routingKey, peerId, {
218
+ ...options,
219
+ signal
220
+ })
221
+ .finally(() => {
222
+ signal.clear();
223
+ }));
224
+ }
225
+ if (promises.length > 0) {
226
+ // fetch record from topic peers
227
+ const record = await Promise.any(promises);
228
+ // cancel any in-flight requests
229
+ fetchController.abort();
230
+ if (record != null) {
231
+ return record;
232
+ }
233
+ }
234
+ throw new NotFoundError('Pubsub routing does not actively query peers');
99
235
  }
100
236
  /**
101
237
  * Get pubsub subscriptions related to ipns
102
238
  */
103
239
  getSubscriptions() {
104
- return this.subscriptions;
240
+ return [...this.subscriptions];
105
241
  }
106
242
  /**
107
243
  * Cancel pubsub subscriptions related to ipns
@@ -111,15 +247,38 @@ class PubSubRouting {
111
247
  const routingKey = multihashToIPNSRoutingKey(digest);
112
248
  const topic = keyToTopic(routingKey);
113
249
  // Not found topic
114
- if (!this.subscriptions.includes(topic)) {
250
+ if (!this.subscriptions.has(topic)) {
115
251
  return;
116
252
  }
117
- this.pubsub.unsubscribe(topic);
118
- this.subscriptions = this.subscriptions.filter(t => t !== topic);
253
+ this.libp2p.services.pubsub.unsubscribe(topic);
254
+ this.subscriptions.delete(topic);
119
255
  }
120
256
  toString() {
121
257
  return 'PubSubRouting()';
122
258
  }
259
+ async start() {
260
+ this.shutdownController = new AbortController();
261
+ setMaxListeners(Infinity, this.shutdownController.signal);
262
+ if (this.libp2p.services.fetch != null) {
263
+ this.fetchTopologyId = await this.libp2p.register(this.libp2p.services.fetch.protocol, {
264
+ onConnect: (peerId) => {
265
+ this.fetchPeers.add(peerId);
266
+ },
267
+ onDisconnect: (peerId) => {
268
+ this.fetchPeers.delete(peerId);
269
+ }
270
+ }, {
271
+ signal: this.shutdownController.signal
272
+ });
273
+ }
274
+ }
275
+ stop() {
276
+ this.fetchQueue.abort();
277
+ this.shutdownController.abort();
278
+ if (this.fetchTopologyId != null) {
279
+ this.libp2p.unregister(this.fetchTopologyId);
280
+ }
281
+ }
123
282
  }
124
283
  const PUBSUB_NAMESPACE = '/record/';
125
284
  /**
@@ -147,7 +306,7 @@ function topicToKey(topic) {
147
306
  * updated records, so the first call to `.get` should be expected
148
307
  * to fail!
149
308
  */
150
- export function pubsub(components) {
151
- return new PubSubRouting(components);
309
+ export function pubsub(components, init = {}) {
310
+ return new PubSubRouting(components, init);
152
311
  }
153
312
  //# sourceMappingURL=pubsub.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../../../src/routing/pubsub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAQ9C,MAAM,GAAG,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAA;AAyC/C,MAAM,aAAa;IACT,aAAa,CAAU;IACd,UAAU,CAAY;IACtB,MAAM,CAAQ;IACd,MAAM,CAAQ;IAE/B,YAAa,UAAmC;QAC9C,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC,CAAA;QAC5G,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAA;QACtC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAA;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gBACD,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM;aACvC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;QACvB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAA;QAE/B,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC;CACF;AAED,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAEnC;;GAEG;AACH,SAAS,UAAU,CAAE,GAAe;IAClC,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;IAEnD,OAAO,GAAG,gBAAgB,GAAG,MAAM,EAAE,CAAA;AACvC,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAE,KAAa;IAChC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,gBAAgB,EAAE,CAAC;QACrE,MAAM,IAAI,iBAAiB,CAAC,qCAAqC,CAAC,CAAA;IACpE,CAAC;IAED,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAEpD,OAAO,oBAAoB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;AAC/C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAE,UAAmC,EAAE,OAA0B,EAAE;IACvF,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AAC5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helia/ipns",
3
- "version": "9.1.9-12fd8522",
3
+ "version": "9.1.9-1a2ebead",
4
4
  "description": "An implementation of IPNS for Helia",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/ipfs/helia/tree/main/packages/ipns#readme",
@@ -73,28 +73,33 @@
73
73
  "test:electron-main": "aegir test -t electron-main"
74
74
  },
75
75
  "dependencies": {
76
- "@helia/interface": "6.1.1-12fd8522",
76
+ "@helia/interface": "6.1.1-1a2ebead",
77
77
  "@libp2p/crypto": "^5.1.7",
78
- "@libp2p/interface": "^3.1.0",
78
+ "@libp2p/fetch": "^4.1.0",
79
+ "@libp2p/interface": "^3.2.0",
79
80
  "@libp2p/kad-dht": "^16.1.0",
80
81
  "@libp2p/keychain": "^6.0.5",
81
82
  "@libp2p/logger": "^6.0.5",
83
+ "@libp2p/peer-collections": "^7.0.14",
82
84
  "@libp2p/utils": "^7.0.5",
85
+ "any-signal": "^4.2.0",
86
+ "delay": "^7.0.0",
83
87
  "interface-datastore": "^9.0.2",
84
88
  "ipns": "^10.1.2",
85
89
  "multiformats": "^13.4.1",
86
90
  "progress-events": "^1.0.1",
87
- "protons-runtime": "^5.5.0",
91
+ "protons-runtime": "^6.0.1",
92
+ "race-signal": "^2.0.0",
88
93
  "uint8arraylist": "^2.4.8",
89
94
  "uint8arrays": "^5.1.0"
90
95
  },
91
96
  "devDependencies": {
92
97
  "@libp2p/crypto": "^5.1.12",
93
- "@libp2p/peer-id": "^6.0.3",
98
+ "@libp2p/peer-id": "^6.0.6",
94
99
  "aegir": "^47.0.22",
95
100
  "datastore-core": "^11.0.2",
96
101
  "it-drain": "^3.0.10",
97
- "protons": "^7.6.1",
102
+ "protons": "^8.1.1",
98
103
  "sinon": "^21.0.0",
99
104
  "sinon-ts": "^2.0.0"
100
105
  },