libp2p / go-libp2p-examples

Example libp2p applications
MIT License
339 stars 145 forks source link

types error when build mdns #67

Closed JackBekket closed 5 years ago

JackBekket commented 5 years ago
cannot use peerhost (type "github.com/libp2p/go-libp2p-core/host".Host) as type "github.com/libp2p/go-libp2p-host".Host in argument to discovery.NewMdnsService:
    "github.com/libp2p/go-libp2p-core/host".Host does not implement "github.com/libp2p/go-libp2p-host".Host (wrong type for ConnManager method)
        have ConnManager() connmgr.ConnManager
        want ConnManager() ifconnmgr.ConnManager
JackBekket commented 5 years ago

when I try go get -v -d ./... and then go build it's says

# github.com/libp2p/go-libp2p/p2p/host/routed
../../github.com/libp2p/go-libp2p/p2p/host/routed/routed.go:190:5: cannot use (*RoutedHost)(nil) (type *RoutedHost) as type host.Host in assignment:
    *RoutedHost does not implement host.Host (missing EventBus method)
# github.com/libp2p/go-libp2p/p2p/host/basic
../../github.com/libp2p/go-libp2p/p2p/host/basic/basic_host.go:83:5: cannot use (*BasicHost)(nil) (type *BasicHost) as type host.Host in assignment:
    *BasicHost does not implement host.Host (missing EventBus method)
../../github.com/libp2p/go-libp2p/p2p/host/basic/basic_host.go:148:64: cannot use h (type *BasicHost) as type host.Host in argument to identify.NewIDService:
    *BasicHost does not implement host.Host (missing EventBus method)
../../github.com/libp2p/go-libp2p/p2p/host/basic/basic_host.go:175:32: cannot use h (type *BasicHost) as type host.Host in argument to ping.NewPingService:
    *BasicHost does not implement host.Host (missing EventBus method)
JackBekket commented 5 years ago

I'm working on this https://github.com/MoonSHRD/p2chat/tree/refactor/pubsub

Kubuxu commented 5 years ago

Hi, downgrade to go-libp2p-core@v0.0.3 by adding:

replace github.com/libp2p/go-libp2p-core => github.com/libp2p/go-libp2p-core@v0.0.3

To your main gomod file.

JackBekket commented 5 years ago

thanks!

Also I've noticed, that new modules worked with 1.12 go version, I has 1.11