Danish Arora 5ce36c8f18
feat!: deprecate named pubsub topics and use static/auto sharding (#2097)
* feat: deprecate named sharding & protocols adhere
simplify network config type, all protocols use pubsub topic internally

* chore: update tests

* tests: rm application info

* chore: use static sharding and auto sharding terminologies

* chore: update docs for network config

* chore: update interfaces

* tests: update tests error message

* chore: remove `ShardingParams` type and fix test
2024-08-13 05:23:20 +05:30

46 lines
1.0 KiB
TypeScript

import type { PeerId } from "@libp2p/interface";
import type { PeerInfo } from "@libp2p/interface";
import type { Multiaddr } from "@multiformats/multiaddr";
import { ShardInfo } from "./sharding";
export type ENRKey = string;
export type ENRValue = Uint8Array;
/**
* We represent NodeId as a hex string, since node equality is used very heavily
* and it is convenient to index data by NodeId
*/
export type NodeId = string;
export type SequenceNumber = bigint;
export interface Waku2 {
relay: boolean;
store: boolean;
filter: boolean;
lightPush: boolean;
}
export interface IEnr extends Map<ENRKey, ENRValue> {
nodeId?: NodeId;
peerId?: PeerId;
id: string;
seq: SequenceNumber;
publicKey?: Uint8Array;
signature?: Uint8Array;
ip?: string;
tcp?: number;
udp?: number;
ip6?: string;
tcp6?: number;
udp6?: number;
multiaddrs?: Multiaddr[];
waku2?: Waku2;
peerInfo: PeerInfo | undefined;
shardInfo?: ShardInfo;
/**
* @deprecated: use { @link IEnr.peerInfo } instead.
*/
getFullMultiaddrs(): Multiaddr[];
}