libp2p / go-libp2p

libp2p implementation in Go
MIT License
6.08k stars 1.07k forks source link

trying to make and run libp2p-host example results in error #219

Closed ssikdar1 closed 7 years ago

ssikdar1 commented 7 years ago

Hey I was trying to run the libp2p-host example and have hit an issue. I haven't had time to look into it, but creating an issue.

Using go 1.8: $ /usr/local/go/bin/go version go version go1.8.1 linux/amd64

~/go-libp2p/examples/libp2p-host$ /usr/local/go/bin/go run host.go 
# github.com/whyrusleeping/go-smux-spdystream
../../../go/src/github.com/whyrusleeping/go-smux-spdystream/spdystream.go:94: cannot use (*stream)(s) (type *stream) as type streammux.Stream in return argument:
    *stream does not implement streammux.Stream (missing Reset method)
../../../go/src/github.com/whyrusleeping/go-smux-spdystream/spdystream.go:126: cannot use (*stream)(s) (type *stream) as type streammux.Stream in argument to handler:
    *stream does not implement streammux.Stream (missing Reset method)

It seems this issue is related: https://github.com/whyrusleeping/go-smux-spdystream/issues/4

Thanks!


~ Kubuxu: reformatted it a bit

Stebalien commented 7 years ago

Yep, we're fixing that (we're in the middle of piping a bunch of interface changes through). In the mean-time, please consider using gx, our dependency management (wrangler) tool, by calling make deps.

daviddias commented 7 years ago

@ssikdar1 thanks for reporting. Please refer to the README as the right solution to install dependencies for this package https://github.com/libp2p/go-libp2p#install. As @Stebalien suggests, we use gx as our dep manager and we recommend to use it always as there is no guarantee that it will work without it :)

pedronasser commented 7 years ago

Good info, but looks like make deps is not installing all required deps correctly.

Stebalien commented 7 years ago

How so? Could you post any errors you're seeing?

ssikdar1 commented 7 years ago

Trying to follow the steps for using gx and running into an issue. Does my gopath need to be set to something specific?

shan@shan-ThinkPad-T530:~/go-libp2p$ echo $GOPATH
/home/shan/go

shan@shan-ThinkPad-T530:~$ git clone https://github.com/libp2p/go-libp2p.git
Cloning into 'go-libp2p'...
remote: Counting objects: 8022, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 8022 (delta 9), reused 19 (delta 4), pack-reused 7994
Receiving objects: 100% (8022/8022), 7.71 MiB | 5.42 MiB/s, done.
Resolving deltas: 100% (4145/4145), done.
Checking connectivity... done.

shan@shan-ThinkPad-T530:~$ cd go-libp2p
shan@shan-ThinkPad-T530:~/go-libp2p$ go get -d github.com/libp2p/go-libp2p
can't load package: package github.com/libp2p/go-libp2p: no buildable Go source files in /home/shan/go/src/github.com/libp2p/go-libp2p
Stebalien commented 7 years ago

That's a bug in the README. You need to run go get -d github.com/libp2p/go-libp2p/.... Go is complaining because there are no packages in the root of the repo.