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

Use Chaingraph for Subscriptions #1

Open
mr-zwets opened this issue Nov 14, 2023 · 0 comments
Open

Use Chaingraph for Subscriptions #1

mr-zwets opened this issue Nov 14, 2023 · 0 comments

Comments

@mr-zwets
Copy link
Member

Currently the server uses subscriptions to an electrum server, ideally this would use subscriptions to the chaingraph server so only one indexer is used to get the state of the blockchain.

// Listen for notifications and set up a subscription with callback function.
electrum.on('notification', () => updateMintingUtxos());
await electrum.subscribe('blockchain.address.subscribe', contractAddressMint);

Streaming subscriptions are only available using chaingraph with an updated Hasura dependency >v2.7.
This way updateMintingUtxos could be removed as we can only change the minting utxo which changed.

more info: https://hasura.io/docs/latest/subscriptions/postgres/index/

possible graphql subscription library to use: https://github.com/nearform/graphql-hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant