Skip to content

Use Chaingraph for Subscriptions #1

@mr-zwets

Description

@mr-zwets

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions