Does anyone know of any Web3 queries that can be used to determine whether the underlying node is running for example, Ethereum vs Ethereum Classic?

Would eth_protocolVersion be a suitable query for determining this?


Ask using eth_getBlockByNumber for the block 1,920,000 (0x1D4C00 in hex)

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1D4C00", true],"id":1}' https://mainnet.infura.io | python -m "json.tool" | grep "\"hash\"" | head -n1

It will give you in ethereum 0x4985f5ca3d2afbec36529aa96f74de3cc10a2a4a6c44f2157a57d2c6059a11bb

In ethereum classic it'll be 0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f

(Source for ETC: http://gastracker.io/block/1920000)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.