diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c70b859f53..979fbe345f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `multicodec` property from protocol interfaces. + +### Removed + +- Dependency on `@waku/peer-exchange`. + ## [@waku/core@0.0.10] - 2023-01-25 ### Changed diff --git a/packages/core/src/lib/filter/index.ts b/packages/core/src/lib/filter/index.ts index 1497ef0a52..51a0b34de7 100644 --- a/packages/core/src/lib/filter/index.ts +++ b/packages/core/src/lib/filter/index.ts @@ -65,6 +65,7 @@ export type UnsubscribeFunction = () => Promise; * - https://github.com/status-im/nwaku/issues/948 */ class Filter implements IFilter { + multicodec: string; pubSubTopic: string; private subscriptions: Map>; private decoders: Map< @@ -73,6 +74,7 @@ class Filter implements IFilter { >; constructor(public components: FilterComponents, options?: CreateOptions) { + this.multicodec = FilterCodec; this.subscriptions = new Map(); this.decoders = new Map(); this.pubSubTopic = options?.pubSubTopic ?? DefaultPubSubTopic; diff --git a/packages/core/src/lib/light_push/index.ts b/packages/core/src/lib/light_push/index.ts index d3517c9a90..6e89cb302c 100644 --- a/packages/core/src/lib/light_push/index.ts +++ b/packages/core/src/lib/light_push/index.ts @@ -52,9 +52,11 @@ export interface CreateOptions { * Implements the [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/). */ class LightPush implements ILightPush { + multicodec: string; pubSubTopic: string; constructor(public components: LightPushComponents, options?: CreateOptions) { + this.multicodec = LightPushCodec; this.pubSubTopic = options?.pubSubTopic ?? DefaultPubSubTopic; } diff --git a/packages/core/src/lib/store/index.ts b/packages/core/src/lib/store/index.ts index ac3897490a..22faca1c33 100644 --- a/packages/core/src/lib/store/index.ts +++ b/packages/core/src/lib/store/index.ts @@ -105,9 +105,11 @@ export interface QueryOptions { * The Waku Store protocol can be used to retrieved historical messages. */ class Store implements IStore { + multicodec: string; pubSubTopic: string; constructor(public components: StoreComponents, options?: CreateOptions) { + this.multicodec = StoreCodec; this.pubSubTopic = options?.pubSubTopic ?? DefaultPubSubTopic; } diff --git a/packages/interfaces/CHANGELOG.md b/packages/interfaces/CHANGELOG.md index d938fae808..46514a094c 100644 --- a/packages/interfaces/CHANGELOG.md +++ b/packages/interfaces/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `multicodec` property on protocol interfaces. + ## [0.0.7] - 2023-01-18 ### Added diff --git a/packages/interfaces/src/protocols.ts b/packages/interfaces/src/protocols.ts index 685c6de1a7..2c3e670fc6 100644 --- a/packages/interfaces/src/protocols.ts +++ b/packages/interfaces/src/protocols.ts @@ -12,6 +12,7 @@ export enum Protocols { } export interface PointToPointProtocol { + multicodec: string; peerStore: PeerStore; peers: () => Promise; } diff --git a/packages/peer-exchange/src/waku_peer_exchange.ts b/packages/peer-exchange/src/waku_peer_exchange.ts index 3f4c014744..49a2f1103a 100644 --- a/packages/peer-exchange/src/waku_peer_exchange.ts +++ b/packages/peer-exchange/src/waku_peer_exchange.ts @@ -30,6 +30,7 @@ const log = debug("waku:peer-exchange"); * Implementation of the Peer Exchange protocol (https://rfc.vac.dev/spec/34/) */ export class WakuPeerExchange implements IPeerExchange { + multicodec: string; private callback: | ((response: PeerExchangeResponse) => Promise) | undefined; @@ -42,6 +43,7 @@ export class WakuPeerExchange implements IPeerExchange { public components: PeerExchangeComponents, public createOptions?: ProtocolOptions ) { + this.multicodec = PeerExchangeCodec; this.components.registrar .handle(PeerExchangeCodec, this.handler.bind(this)) .catch((e) => log("Failed to register peer exchange protocol", e));