I'm aware that I can do this using CURL like so:
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' https://the-node-ip-address:8545
Which return the following output:
{"jsonrpc":"2.0","id":67,"result":"Geth/v1.8.22-omnibus-260f7fbd/linux-amd64/go1.11.1"}
OR
{"jsonrpc":"2.0","result":"Parity-Ethereum//v2.2.11-stable-8e31051-20190220/x86_64-linux-gnu/rustc1.32.0","id":67}
Is there a way to do this using any package from go-ethereum project? All I have with me is a node RPC URL i.e. http://123.45.678.912:8545
and I want to check if it's a Geth node or Parity node using Golang without needing to convert the CURL above to Go code.
I'm looking for something like this:
import "github.com/ethereum/go-ethereum/ethclient"
...
client := ethclient.Dial("http://123.45.678.912:8545")
clientType := client.Xxx() // <-- I need this method and it should return "Geth" or "Parity"
What is the method for Xxx()
above?