You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue with the createLightNode() function while using @waku/sdk version 0.0.26. It appears that the contentTopics option must be specified during the node's initiation. Without this, both queryWithOrderedCallback() and subscribe() fail to function as expected.
Observed Behavior:
When I omit the contentTopics option, the queryWithOrderedCallback() and subscribe() methods do not return any results.
Example Code:
constContentTopic='/portrait_test/1/updates-79/proto';constPubsubTopic='/waku/2/rs/1/4';constwakuNode=awaitcreateLightNode({pubsubTopics: [PubsubTopic],contentTopics: [ContentTopic],// Removing or commenting this line results in no response from queryWithOrderedCallback or subscribe.defaultBootstrap: true,});awaitwakuNode.start();awaitwaitForRemotePeer(wakuNode,[Protocols.Store]);constdecoder=createDecoder(ContentTopic,PubsubTopic);constcallback=(msg)=>{console.log('Message received:',msg);};const{ error, subscription }=awaitwakuNode.filter.createSubscription({contentTopics: [ContentTopic],pubsubTopics: [PubsubTopic],});if(error){console.error('Subscription error:',error);return;}awaitsubscription.subscribe([decoder],callback);console.log('Subscribed to content topic');constqueryResult=awaitwakuNode.store.queryWithOrderedCallback([decoder],callback);console.log('queryWithOrderedCallback result:',queryResult);
No specific error messages are thrown; the callbacks simply do not execute.
Hi, there were some updates and per some feedback we changed API so that it fails if too many network configurations were passed.
Now you need to select if you want to pass content topics(all those you going to use during lifetime of the node), pub sub topics or shard information manually.
In case you specify pub sub topic then you need to configure all your decoder/encoders with it so that they are aware of what network is in use (otherwise it defaults to autosharding and will be computed based on content topic that was passed into decoder/encoder).
Second issue
When I attempt to initiate a light node without a pub sub topic (see convo above), I receive the following error:
It seems like when the pubsubTopics option is omitted in createLightNode() the default value clashes with the expected value.
@weboko confirmed this might be a bug and requested it be reported for further investigation.
SDK:
@waku/sdk version 0.0.26
The text was updated successfully, but these errors were encountered:
ryanshahine
changed the title
createLightNode() Function in @waku/sdk v0.0.26: Content/PubSub Topics Requirement Bug
bug: createLightNode() Function in @waku/sdk v0.0.26: Content/PubSub Topics Requirement
Jul 23, 2024
Released next version with the fix, can be unstable before I complete PR fully but with the example and works fine.
Please, try out these packages:
Successfully published packages/interfaces with version 0.0.26-1887f4f.0.Successfully published packages/relay with version 0.0.14-1887f4f.0.Successfully published packages/message-encryption with version 0.0.29-1887f4f.0.Successfully published packages/utils with version 0.0.19-1887f4f.0.Successfully published packages/enr with version 0.0.25-1887f4f.0.Successfully published packages/discovery with version 0.0.4-1887f4f.0.Successfully published packages/sdk with version 0.0.27-1887f4f.0.Successfully published packages/core with version 0.0.31-1887f4f.0.
Description
I am encountering an issue with the createLightNode() function while using
@waku/sdk
version0.0.26
. It appears that the contentTopics option must be specified during the node's initiation. Without this, bothqueryWithOrderedCallback()
andsubscribe()
fail to function as expected.Observed Behavior:
When I omit the contentTopics option, the
queryWithOrderedCallback()
andsubscribe()
methods do not return any results.Example Code:
No specific error messages are thrown; the callbacks simply do not execute.
Discussion:
I consulted with @weboko over tg:
Second issue
When I attempt to initiate a light node without a pub sub topic (see convo above), I receive the following error:
It seems like when the
pubsubTopics
option is omitted increateLightNode()
the default value clashes with the expected value.@weboko confirmed this might be a bug and requested it be reported for further investigation.
SDK:
@waku/sdk version 0.0.26
The text was updated successfully, but these errors were encountered: