-
Notifications
You must be signed in to change notification settings - Fork 12
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
Listener: Define the interfaces for all the functions in Listener #4
Comments
📶 😃! Still, some questions (more about implementation, but here in case the answers impact the interfaces):
Will this scanner make use of https://github.com/ostdotcom/ost-block-scanner? If yes, I note that the OST scanner also takes an optional Will the scan function look at both origin and auxiliary chains when called or should the caller identify which chain?
Is the scanner meant to also be available for general purpose use? (This question applies to both functions, but more to the transactions getter than the events getter.) Will the scanner store more information than what is required for facilitating stake requests?
To confirm, the above functions are private? |
We can take the code for our reference. It has many dependencies of other projects/packages, which may not be needed for our implementation.
The
The scanner can be available for general purpose use, the functions can be implemented in the seperate class where it becomes generic and can be used at places other than scanner as well The scanner will just scan for the
This will be private functions. (Implementer can decide) |
The
scannerlistener reads each and every block from the chain and looks forStakeRequested
event for the given composer contract.Once the event is found it callbacks the facilitator with event data.scannerlistener keeps a record of the last block scanned so that it can resume thescannerlistener from the same block height. For more details check the epic #1The
scannerlistener can be for the origin and auxiliary chain.The
scannerlistener should update the database tables.This ticket is about defining the interfaces of all the functions in the
scannerlistener.The proposed functions are provided for reference.
The implementer can think this in detail and can add/remove functions
We can call this as EventListner.
constructor.
- Acceptsmosaic-config
andfacilitator-config
.{contractAddresss: [Event topics]}
.function to scan the blocks in batches. (Start scan)
blockNumber
as a parameter.blockNumber
is an optional param, if this is provided then thescannerlistener will start scanning from that block, else it will start from the latest block.- [ ] function to update the last scanned block number.- [ ] function to get transactions for the given block.- [ ] function to get events from the given transaction.- [ ] function to emit an event when StakeRequested event is found.scannerlistener (SIGTERM). (Update the ticket)- [ ] function to updatesstake_request
table status. (create a new ticket for this.)The text was updated successfully, but these errors were encountered: