Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace default await periods with a try/catch #7

Open
Cooper-Kunz opened this issue Apr 21, 2020 · 1 comment
Open

Replace default await periods with a try/catch #7

Cooper-Kunz opened this issue Apr 21, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Cooper-Kunz
Copy link
Contributor

Currently, we're waiting ~9 seconds for our new topic to be persisted to a mirror node, allowing us to successfully create a subscription to that topic. We should replace this with a try/catch block on an interval (2-3 seconds could make sense?), with a maximum # of retries.

@Cooper-Kunz Cooper-Kunz added enhancement New feature or request good first issue Good for newcomers labels Apr 21, 2020
@Cooper-Kunz Cooper-Kunz added the help wanted Extra attention is needed label Apr 27, 2020
@helenamerk
Copy link

helenamerk commented Nov 24, 2022

Hey @Cooper-Kunz -- looks like this is not an issue with socketio anymore with the version that's running 2.4.0. I removed the 9 second await and socketio handles the reconnection; you can modify the default socketio reconnection logic but imo this works fine when just removing the 9 second await.

init() using default .env config
init() creating new topic
TopicCreateTransaction() submitted tx
TopicCreateTransaction() success! new topic 0.0.48965465
ConsensusTopicCreateTransaction() waiting for new HCS Topic & mirror node (it may take a few seconds)
not awaiting here
MirrorConsensusTopicQuery() 0.0.48965465
Error subscribing to topic 0.0.48965465 during attempt 0. Waiting 250 ms before next attempt: Topic 0.0.48965465 does not exist
Error subscribing to topic 0.0.48965465 during attempt 1. Waiting 500 ms before next attempt: Topic 0.0.48965465 does not exist
Error subscribing to topic 0.0.48965465 during attempt 2. Waiting 1000 ms before next attempt: Topic 0.0.48965465 does not exist
Error subscribing to topic 0.0.48965465 during attempt 3. Waiting 2000 ms before next attempt: Topic 0.0.48965465 does not exist
TopicMessageSubmitTransaction() {"operatorAccount":"0.0.48965332","client":"0sxy2gR6ixm_IQpJAAAA","message":"test"}
Response from TopicMessageQuery() [object Object]
Parsed mirror message default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants