0

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.

1 Answer 1

0

On closer inspection, the issue is caused by breaking changes to github.com/deckarep/golang-set v2.1.0 module dependency, works fine on previous v1.7.1.

To fix, simply download the source code for github.com/deckarep/golang-set v1.7.1, and copy to your GOPATH. Works until support for golang-set v2.1.0 is added to go-ethereum.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.