Web3js

檢查正在訪問哪個乙太坊網路的最簡單方法?

  • February 28, 2017

有誰知道任何可用於確定底層節點是否正在執行的 Web3 查詢,例如乙太坊與乙太坊經典?

eth_protocolVersion 是否適合確定這一點?

詢問使用eth_getBlockByNumber1,920,0000x1D4C00十六進制)

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

它會給你乙太坊0x4985f5ca3d2afbec36529aa96f74de3cc10a2a4a6c44f2157a57d2c6059a11bb

在乙太坊經典中,它將是0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f

(ETC 來源:http: //gastracker.io/block/1920000

引用自:https://ethereum.stackexchange.com/questions/12217