Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
felicio committed Mar 13, 2024
1 parent 97aff5b commit b0c6b67
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 26 deletions.
7 changes: 6 additions & 1 deletion packages/status-js/src/client/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ export class Chat {
}

await this.client.waku.store.queryWithOrderedCallback(
[createDecoder(this.contentTopic, this.symmetricKey)],
[
createDecoder(this.contentTopic, this.symmetricKey, {
clusterId: 16,
shard: 32,
}),
],
wakuMessage => {
this.#fetchingMessages = true
this.client.handleWakuMessage(wakuMessage)
Expand Down
8 changes: 8 additions & 0 deletions packages/status-js/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ class Client {
}),
],
},
shardInfo: {
clusterId: 16,
shards: [32],
},
})
await waku.start()
await waitForRemotePeer(
Expand Down Expand Up @@ -269,6 +273,10 @@ class Client {
contentTopic,
symKey,
sigPrivKey: hexToBytes(this.#account.privateKey),
pubsubTopicShardInfo: {
clusterId: 16,
shard: 32,
},
}),
{ payload: message }
)
Expand Down
21 changes: 18 additions & 3 deletions packages/status-js/src/client/community/community.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ export class Community {
public fetch = async () => {
// most recent page first
await this.client.waku.store.queryWithOrderedCallback(
[createDecoder(this.contentTopic, this.symmetricKey)],
[
createDecoder(this.contentTopic, this.symmetricKey, {
clusterId: 16,
shard: 32,
}),
],
wakuMessage => {
this.client.handleWakuMessage(wakuMessage)

Expand All @@ -109,7 +114,12 @@ export class Community {

private observe = async () => {
await this.client.waku.filter.subscribe(
[createDecoder(this.contentTopic, this.symmetricKey)],
[
createDecoder(this.contentTopic, this.symmetricKey, {
clusterId: 16,
shard: 32,
}),
],
this.client.handleWakuMessage
)
}
Expand All @@ -130,7 +140,12 @@ export class Community {
this.chats.set(chatUuid, chat)

const unobserveFn = await this.client.waku.filter.subscribe(
[createDecoder(chat.contentTopic, chat.symmetricKey)],
[
createDecoder(chat.contentTopic, chat.symmetricKey, {
clusterId: 16,
shard: 32,
}),
],
this.client.handleWakuMessage
)

Expand Down
30 changes: 8 additions & 22 deletions packages/status-js/src/request-client/request-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ class RequestClient {
}),
],
},
// pubsubTopics: [
// '/waku/2/rs/16/32',
// // '/waku/2/default-waku/proto'
// ],
shardInfo: {
clusterId: 16,
shards: [32],
Expand Down Expand Up @@ -159,15 +155,10 @@ class RequestClient {
let communityDescription: CommunityDescription | undefined = undefined
await this.waku.store.queryWithOrderedCallback(
[
createDecoder(
contentTopic,
symmetricKey,
// '/waku/2/rs/16/32'
{
clusterId: 16,
shard: 32,
}
),
createDecoder(contentTopic, symmetricKey, {
clusterId: 16,
shard: 32,
}),
],
wakuMessage => {
// handle
Expand Down Expand Up @@ -226,15 +217,10 @@ class RequestClient {
undefined
await this.waku.store.queryWithOrderedCallback(
[
createDecoder(
contentTopic,
symmetricKey,
// '/waku/2/rs/16/32'
{
clusterId: 16,
shard: 32,
}
),
createDecoder(contentTopic, symmetricKey, {
clusterId: 16,
shard: 32,
}),
],
wakuMessage => {
// handle
Expand Down

0 comments on commit b0c6b67

Please sign in to comment.