graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.91k stars 968 forks source link

Feature: Expose networkClient query resolver #2740

Open goaaron opened 3 years ago

goaaron commented 3 years ago

What is the current behavior? There isn't a standardized way of determining the kind and version of the chain clients that indexers use: erigon, openethereum, etc. This is a compounding problem with the adoption of multiple blockchains.

What is the expected behavior? Have a standard means by which the web3 Transports can return their client versions.

e.g.

// Request curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}'

// Result { "id":67, "jsonrpc":"2.0", "result": "Mist/v0.9.3/darwin/go1.4.1" }

Why is this useful?

azf20 commented 3 years ago

Hey @goaaron - is the suggestion to add an easy way for indexers to share the result calling web3_clientVersion, or where do you see this data being surfaced?

goaaron commented 3 years ago

Hey @goaaron - is the suggestion to add an easy way for indexers to share the result calling web3_clientVersion, or where do you see this data being surfaced?

I'm thinking that there are a few places:

  1. When an allocation is closed, the indexer stores metadata about their client version (in the network subgraph perhaps)
  2. As an endpoint on the graph-node http server that can be probed during indexer selection.
  3. As a graph-node package api that can be used by the graph-node CLI tools for syncing data for the dispute arbitration service that is being built out. Client versions are an important data feature for determining patterns in POI mismatch.