Infura in Golang

Let’s use Go for Infura.

package main

import (


 func main(){
 _, err := ethclient.Dial("")

 if err != nil {
	log.Fatalf("Oops! There was a problem", err)
 } else {
	fmt.Println("Success! you are connected to Ropsten Network")

I began to use the infura API for a startup project in 2017. At that time, the ethclient golang package had not been released by the go-ethereum team yet, so I looked around in github. In the end, I decided to develop my own package to interface the JSON RPC API and I released the “” package.

One of the issues I encountered with other public clients, was that they would not support Basic Authentication in the RPC calls, so they would not be useful for Infura’s v3 API when you need a secret passphrase. I think this is the case for ethclient, unless I am missing something.

My ethcli package was tailored to my specific needs, however, it provides an easy to use functionality for most needs. Feel free to provide feedback and/or pull requests.


Thank you for sharing @santiman625