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
The event handler is a part of the server application, which we want to be developed in NodeJS. The event handler should be a process that subscribes to the play Lottery contract event via CSPR.cloud Streaming API. The CSPR.cloud keys should be passed to the process via an env variable, and the actual value should not be present in the repository. The lottery contract package hash should be provided via the env variable as well.
The play event should be stored as a Play entity, with extra fields:
deploy_hash (hash of the deploy)
round_id
play_id
player_account_hash
prize_amount
is_jackpot
timestamp (deploy timestamp)
The event handler should MySQL or PostreSQL as the data storage and interact with it using the https://sequelize.org/ library.
Taking into account that we want developers to be able to use this example on hackathons we should start with the directory structure that allows expansion. It could be something like that:
The event handler is a part of the server application, which we want to be developed in NodeJS. The event handler should be a process that subscribes to the
play
Lottery contract event via CSPR.cloud Streaming API. The CSPR.cloud keys should be passed to the process via an env variable, and the actual value should not be present in the repository. The lottery contract package hash should be provided via the env variable as well.Here’s an example of WebSocket subscription to CSPR.cloud https://github.com/mssteuer/rekt-server/blob/master/rekt-server.js#L25. Note, that the WebSocket connection should automatically reconnect when closed.
The
play
event should be stored as aPlay
entity, with extra fields:deploy_hash
(hash of the deploy)round_id
play_id
player_account_hash
prize_amount
is_jackpot
timestamp
(deploy timestamp)The event handler should MySQL or PostreSQL as the data storage and interact with it using the https://sequelize.org/ library.
Taking into account that we want developers to be able to use this example on hackathons we should start with the directory structure that allows expansion. It could be something like that:
The text was updated successfully, but these errors were encountered: