cpacia / go-onion-transport

MIT License
9 stars 1 forks source link

Is there a full example somewhere? #1

Open remon-nashid opened 3 years ago

remon-nashid commented 3 years ago

Thank you for extracting this out of the go-bazaar repo!

The example in the README file is helpful, but I can't figure out the correct dependency versions. The example spits many error when running with latest dependencies, or with older IPFS versions (0.5). Could you please share a reasonable go.mod file that's compatible with the readme example?

Thank you!

remon-nashid commented 3 years ago

This is my test repo https://github.com/remon-nashid/go-onion-transport-test

Following are the errors printed by go run node.go:

→ go run node.go 
# github.com/libp2p/go-eventbus
../../go/pkg/mod/github.com/libp2p/go-eventbus@v0.1.0/basic.go:22:5: cannot use (*basicBus)(nil) (type *basicBus) as type event.Bus in assignment:
        *basicBus does not implement event.Bus (missing GetAllEventTypes method)
../../go/pkg/mod/github.com/libp2p/go-eventbus@v0.1.0/basic.go:50:9: cannot use &basicBus literal (type *basicBus) as type event.Bus in return argument:
        *basicBus does not implement event.Bus (missing GetAllEventTypes method)
# github.com/libp2p/go-libp2p-swarm
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:243:14: cannot use c (type *Conn) as type network.Conn in argument to f.Connected:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:253:7: cannot use c (type *Conn) as type network.Conn in argument to h:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:355:13: cannot use c (type *Conn) as type network.Conn in assignment:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:407:18: cannot use c (type *Conn) as type network.Conn in append:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:76:20: cannot use c (type *Conn) as type network.Conn in argument to f.Disconnected:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:116:7: cannot use s (type *Stream) as type network.Stream in argument to h:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:175:2: cannot use *Stream value as type network.Stream in return argument:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:207:19: cannot use s (type *Stream) as type network.Stream in argument to f.OpenedStream:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:220:19: cannot use s (type *Stream) as type network.Stream in append:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_stream.go:26:5: cannot use &Stream literal (type *Stream) as type network.Stream in assignment:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:220:19: too many errors
# github.com/libp2p/go-libp2p-connmgr
../../go/pkg/mod/github.com/libp2p/go-libp2p-connmgr@v0.2.1/connmgr.go:50:5: cannot use (*BasicConnMgr)(nil) (type *BasicConnMgr) as type connmgr.ConnManager in assignment:
        *BasicConnMgr does not implement connmgr.ConnManager (missing IsProtected method)
# github.com/libp2p/go-libp2p-peerstore/pstoremem
../../go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.3/pstoremem/protobook.go:29:5: cannot use (*memoryProtoBook)(nil) (type *memoryProtoBook) as type "github.com/libp2p/go-libp2p-core/peerstore".ProtoBook in assignment:
        *memoryProtoBook does not implement "github.com/libp2p/go-libp2p-core/peerstore".ProtoBook (missing FirstSupportedProtocol method)
Type-IIx commented 3 years ago

This transport needs some love! I would love to see Tor support in IPFS.

Type-IIx commented 3 years ago

This is my test repo https://github.com/remon-nashid/go-onion-transport-test

Following are the errors printed by go run node.go:

→ go run node.go 
# github.com/libp2p/go-eventbus
../../go/pkg/mod/github.com/libp2p/go-eventbus@v0.1.0/basic.go:22:5: cannot use (*basicBus)(nil) (type *basicBus) as type event.Bus in assignment:
        *basicBus does not implement event.Bus (missing GetAllEventTypes method)
../../go/pkg/mod/github.com/libp2p/go-eventbus@v0.1.0/basic.go:50:9: cannot use &basicBus literal (type *basicBus) as type event.Bus in return argument:
        *basicBus does not implement event.Bus (missing GetAllEventTypes method)
# github.com/libp2p/go-libp2p-swarm
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:243:14: cannot use c (type *Conn) as type network.Conn in argument to f.Connected:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:253:7: cannot use c (type *Conn) as type network.Conn in argument to h:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:355:13: cannot use c (type *Conn) as type network.Conn in assignment:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm.go:407:18: cannot use c (type *Conn) as type network.Conn in append:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:76:20: cannot use c (type *Conn) as type network.Conn in argument to f.Disconnected:
        *Conn does not implement network.Conn (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:116:7: cannot use s (type *Stream) as type network.Stream in argument to h:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:175:2: cannot use *Stream value as type network.Stream in return argument:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:207:19: cannot use s (type *Stream) as type network.Stream in argument to f.OpenedStream:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:220:19: cannot use s (type *Stream) as type network.Stream in append:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_stream.go:26:5: cannot use &Stream literal (type *Stream) as type network.Stream in assignment:
        *Stream does not implement network.Stream (missing ID method)
../../go/pkg/mod/github.com/libp2p/go-libp2p-swarm@v0.2.3/swarm_conn.go:220:19: too many errors
# github.com/libp2p/go-libp2p-connmgr
../../go/pkg/mod/github.com/libp2p/go-libp2p-connmgr@v0.2.1/connmgr.go:50:5: cannot use (*BasicConnMgr)(nil) (type *BasicConnMgr) as type connmgr.ConnManager in assignment:
        *BasicConnMgr does not implement connmgr.ConnManager (missing IsProtected method)
# github.com/libp2p/go-libp2p-peerstore/pstoremem
../../go/pkg/mod/github.com/libp2p/go-libp2p-peerstore@v0.2.3/pstoremem/protobook.go:29:5: cannot use (*memoryProtoBook)(nil) (type *memoryProtoBook) as type "github.com/libp2p/go-libp2p-core/peerstore".ProtoBook in assignment:
        *memoryProtoBook does not implement "github.com/libp2p/go-libp2p-core/peerstore".ProtoBook (missing FirstSupportedProtocol method)

Thank you for working on this. It's in dire need of some work.

Does this post referring to the old code on OpenBazaar's issues help you at all?

https://github.com/OpenBazaar/go-onion-transport/issues/1#issuecomment-304538757