namecoin / ncprop279

Bridge between Tor Prop279 (Pluggable Naming) clients and Namecoin.
https://www.namecoin.org/
GNU General Public License v3.0
1 stars 5 forks source link

./nv0.0.4: ncprop279.go: cannot use connCfg: type mismatch btcsuite/btcd/rpcclient vs namecoin/btcd/rpcclient #39

Open radfish opened 1 year ago

radfish commented 1 year ago

go build fails with linking errors:

# github.com/namecoin/btcd/rpcclient
../_gopath/pkg/mod/github.com/namecoin/btcd@v0.22.0-beta/rpcclient/wallet.go:964:36: undefined: btcjson.CreateWalletCmd
../_gopath/pkg/mod/github.com/namecoin/btcd@v0.22.0-beta/rpcclient/chain.go:227:60: undefined: 
...
../_gopath/pkg/mod/github.com/namecoin/btcd@v0.22.0-beta/rpcclient/chain.go:545:79: too many errors
# github.com/namecoin/ncrpcclient
../_gopath/pkg/mod/github.com/namecoin/ncrpcclient@v0.1.0/names.go:24:43: undefined: rpcclient.Response
../_gopath/pkg/mod/github.com/namecoin/ncrpcclient@v0.1.0/names.go:29:24: undefined: rpcclient.ReceiveFuture
../_gopath/pkg/mod/github.com/namecoin/ncrpcclient@v0.1.0/names.go:79:11: c.SendCmd undefined (type *Client has no field or method SendCmd)
...

or, if I provide namecoin/btcd in two local directories, path-replaced from github.com/namecoin/btcd and from gitbub.com/btcsuite/btcd then I get this type mismatch error:

 # github.com/namecoin/ncprop279
./ncprop279.go:57:30: cannot use connCfg (variable of
 type *"github.com/namecoin/btcd/rpcclient".ConnConfig)
   as *"github.com/btcsuite/btcd/rpcclient".ConnConfig value
in argument to namecoin.New  

There seems to be a type mismatch, indeed:

ncprop279.go seems to be the one at fault. The usage of btcsuite/btcd/rpcclient and namecoin/ncrpcclient seem consistent throughout; only ncprop279.go is trying to use namecoin/btcd/rpcclient. Changing this import fixed the build (though I did not test functionality, just that ncprop279 -h executes) :

sed -i 's|"github.com/namecoin/btcd/rpcclient"|"github.com/btcsuite/btcd/rpcclient"|' ncprop279.go

Full working build script for Arch package (but relevant to any build) is here (there are a couple separate issues that may go into separate tickets): https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ncprop279