-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: subscribe to bbn websocket new block events #32
Conversation
var result model.LastProcessedHeight | ||
err := db.client.Database(db.dbName). | ||
Collection(model.LastProcessedHeightCollection). | ||
FindOne(ctx, bson.M{}).Decode(&result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to make the collection generic for storing pointers so that this collection can be used for both BTC and BBN heights. (even for any other pointer values)
So it probably make sense to have a hardcoded primary key for the BBN height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, is it ok if we change in later pr when the requirement arises?
btw in what case would we store btc pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial plan for syncing withdrawal transactions was to perform the same block scan as BBN blocks by storing the BTC height as a pointer to track the last processed height, avoiding the need to sync historical data. However, since the decision has been made to use this library to subscribe to BTC transaction events, this approach is no longer necessary.
That said, I would still argue for keeping this table generic, allowing us to store any pointer in this collection for future use.
Yes, of course. feel free to raise a ticket and we can track it in later PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see sg, have made a ticket to track
#35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with some comments
This PR