chore: update dogfooding to the latest (#137)

This commit is contained in:
Sasha 2025-07-17 17:10:58 +02:00 committed by GitHub
parent a1b991b1ed
commit 9d0eb5dea3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1037 additions and 870 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
"dependencies": {
"@libp2p/crypto": "^5.0.5",
"@multiformats/multiaddr": "^12.3.1",
"@waku/sdk": "0.0.32-4997440.0",
"@waku/sdk": "0.0.33-c24842a.0",
"libp2p": "^2.1.10",
"protobufjs": "^7.3.0",
"uint8arrays": "^5.1.0"

View File

@ -156,8 +156,15 @@ async function initializeApp() {
const subscribeToMessages = async () => {
const decoder = createWakuDecoder();
(window as any)["storeQuery"] = () => {
node.store.queryWithOrderedCallback([decoder], (msg) => {
console.log("DEBUG", msg);
});
};
console.log("Subscribing to messages...");
await node.nextFilter.subscribe(decoder, (wakuMessage: DecodedMessage) => {
await node.filter.subscribe(decoder, (wakuMessage: DecodedMessage) => {
console.log("Raw Waku message received, payload length:", wakuMessage.payload.length);
const chatMessage = decodeMessage(wakuMessage.payload);

View File

@ -21,32 +21,24 @@ export async function getWakuNode(): Promise<LightNode> {
const privateKey = await generateKeyPairFromSeed("Ed25519", fromString(seed));
const node = await createLightNode({
defaultBootstrap: false,
networkConfig: {
clusterId: 42,
shards: [0]
},
defaultBootstrap: true,
discovery: {
dns: false,
dns: true,
peerExchange: true,
localPeerCache: false,
},
numPeersToUse: 2,
libp2p: {
privateKey,
},
}
});
await Promise.allSettled([
node.dial("/dns4/waku-test.bloxy.one/tcp/8095/wss/p2p/16Uiu2HAmSZbDB7CusdRhgkD81VssRjQV5ZH13FbzCGcdnbbh6VwZ"),
node.dial("/dns4/vps-aaa00d52.vps.ovh.ca/tcp/8000/wss/p2p/16Uiu2HAm9PftGgHZwWE3wzdMde4m3kT2eYJFXLZfGoSED3gysofk")
]);
(window as any).waku = node;
await node.start();
await node.waitForPeers();
wakuNodeInstance = node;
(window as any).waku = node;
return node;
}
@ -57,13 +49,9 @@ export function getPeerId(): string | undefined {
export function createWakuEncoder() {
return createEncoder({
contentTopic: DEFAULT_CONTENT_TOPIC,
pubsubTopicShardInfo: {
clusterId: 42,
shard: 0,
}
});
}
export function createWakuDecoder() {
return createDecoder(DEFAULT_CONTENT_TOPIC, { clusterId: 42, shard: 0 });
return createDecoder(DEFAULT_CONTENT_TOPIC);
}