go-hdwallet
go-hdwallet copied to clipboard
Installation failed.
Im getting an error when installing on MacBook:
robert@Roberts-MacBook-Air gocourse % sudo go get -v -u github.com/foxnut/go-hdwallet github.com/foxnut/go-hdwallet (download) github.com/btcsuite/btcd (download) github.com/btcsuite/btclog (download) github.com/btcsuite/btcutil (download) get "golang.org/x/crypto/ripemd160": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/ripemd160?go-get=1 get "golang.org/x/crypto/ripemd160": verifying non-authoritative meta tag golang.org/x/crypto (download) github.com/cpacia/bchutil (download) github.com/ethereum/go-ethereum (download) get "golang.org/x/crypto/sha3": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/sha3?go-get=1 get "golang.org/x/crypto/sha3": verifying non-authoritative meta tag github.com/tyler-smith/go-bip39 (download) get "golang.org/x/crypto/pbkdf2": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/pbkdf2?go-get=1 get "golang.org/x/crypto/pbkdf2": verifying non-authoritative meta tag github.com/foxnut/go-hdwallet github.com/foxnut/go-hdwallet ../src/github.com/foxnut/go-hdwallet/key.go:96:27: extended.Child undefined (type *hdkeychain.ExtendedKey has no field or method Child)
Just for the record, I finally figured out what the issue was. We had a newer version of btcutil
installed because we were previously using a different HD wallet package (versions after v1.0.2 phased out the *hdkeychain.ExtendedKey.Child function, and for whatever reason this package was just using that one instead of v1.0.2). Getting rid of the conflicting wallet packge solved the problem.
At the end of the day, I think it just comes down to Go just not having sufficient support for proper package version management.
I can't install the go-hdwallet too.
tunca@DESKTOP-6K19996:~/go/src/github.com/tuncatunc/hdwallet-api$ go get -v -u github.com/foxnut/go-hdwallet
github.com/foxnut/go-hdwallet
# github.com/foxnut/go-hdwallet
../../../../pkg/mod/github.com/foxnut/[email protected]/key.go:96:27: extended.Child undefined (type *hdkeychain.ExtendedKey has no field or method Child)
The go-hdwallet specifies the the btcsuite/btcutil version properly.
go-hdwallet
go.mod
file specifies github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
go.sub
file specifies
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng=
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
So go-hdwallet uses correct version, why it tries to download
go: downloading github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
Just for the record.
The problem is the -u
flag
You are using go get -u, which instructs go to try and fetch the latest version of github.com/foxnut/go-hdwallet and all it's dependencies. If you want the version specified, don't use -u.
At the time of writing the README, 1.0.3-0 version of the btcsuite/btcutil
was not around.
go get -v github.com/foxnut/go-hdwallet
should be used to install.