cosmos / chain-registry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add transaction indexing flag to rpc

dimiandre opened this issue · comments

It's very annoying when RPC doesn't have transaction indexing enabled, would be useful to know which RPC endpoints provide it and which not

Would also be cool to have a proxy only for indexing-enabled ones with cosmos.directory

(node:20819) UnhandledPromiseRejectionWarning: Error: {"code":-32603,"message":"Internal error","data":"transaction indexing is disabled"}

I'm going to add a feature to cosmos.directory very soon that will monitor whether nodes have indexing enabled, and provide this data via the status.cosmos.directory endpoints.

I also plan to accept a header for the proxies to ensure the request is sent to an indexed node, something like x-cosmos-index-enabled so it's inline with the similar x-cosmos-block-height header that the SDK REST API already accepts. Any suggestions for naming this header would be helpful, like if we should avoid the x-cosmos namespace for example.

I plan to have this implemented in January if at all possible, will post here with any updates.

Would a simple "indexing" boolean be clear and sufficient?:


...
"endpoint": {
      "type": "object",
      "required": [
        "address"
      ],
      "properties": {
        "address": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "archive": {
          "type": "boolean",
          "default": false
        },
        "indexing": {
          "type": "boolean",
          "default": false
        }
      }
    },
...

or do we need more, like transaction_indexing ?