duality-labs / hapi-indexer

A Node.js based indexer for the Duality Cosmos chain
1 stars 0 forks source link

feat: abstract all responses through new continuous updates framework #50

Closed dib542 closed 10 months ago

dib542 commented 10 months ago

This PR attempts to pass all indexer requests through the same request-response mechanism logic so that all endpoints can be queried in either a HTTP/2 streaming mode or with a HTTP/1 long-polling mode to receive the continually updating data of an endpoint.

This abstraction should help build more and simpler endpoints in the future as all data endpoints of the indexer are of this nature: the data is live and the data always does eventually change, and the client should be interested to know what the new data is when it changes.

This implementation also corrects some inconsistencies across the data endpoints.