chenzhijie / go-web3

Ethereum Golang API, JSON-RPC client, Smart contract transaction API.
GNU Lesser General Public License v3.0
219 stars 74 forks source link

init web3 panic #3

Closed shaokun11 closed 2 years ago

shaokun11 commented 2 years ago

go1.17.5 windows when init like web31, err := web3.NewWeb3(infuraURL),the error is dial unix https://mainnet.infura.io/v3/xxx: connect: An invalid argument was supplied

shaokun11 commented 2 years ago

image

I found the error position is here

chenzhijie commented 2 years ago

You should provide a right provider url here. You can go to https://infura.io and register your api key, then replace your api key in the code.

shaokun11 commented 2 years ago

now it work, thanks your efffort