I have been trying to follow the goethereumbook.org/en/client at the section "Setting Up the Client" for hours.
Here is my version of golang:
~/g/gwal (main) [2]> go version
go version go1.18.2 linux/amd64
I did the following steps to install go-ethereum:
[I] tsalim@meerkat ~/g/gwal (main) [1]> go get github.com/ethereum/go-ethereum
And then I wrote a program to establish a connection with Dial
. Here is the program below:
package main
import
(
"fmt"
"log"
"github.com/ethereum/go-ethereum/ethclient"
)
func main() {
client, err := ethclient.Dial("https://mainnet.infura.io")
if err != nil {
log.Fatal(err);
}
fmt.Println("we have a connection")
}
And then I try to build the package but I always get:
[I] tsalim@meerkat ~/g/gwal (main)> go build -o wal.og wal.go
# github.com/ethereum/go-ethereum/rpc
../../go/src/github.com/ethereum/go-ethereum/rpc/server.go:49:11: cannot use generic type mapset.Set[T comparable] without instantiation
../../go/src/github.com/ethereum/go-ethereum/rpc/server.go:54:69: cannot infer T (/home/tsalim/go/src/github.com/deckarep/golang-set/set.go:180:13)
../../go/src/github.com/ethereum/go-ethereum/rpc/websocket.go:72:26: cannot infer T (/home/tsalim/go/src/github.com/deckarep/golang-set/set.go:180:13)
../../go/src/github.com/ethereum/go-ethereum/rpc/websocket.go:125:37: cannot use generic type mapset.Set[T comparable] without instantiation
What faults are there in how I install the go-ethereum package? I must be installing
something the wrong way. I am new to Golang modules after all.
I thank anyone for any responses.