IPFS DOCS: Custom IPFS Service - Dependency revision

As there was no github repo for this docs article (https://ipfs.io/docs/examples/example-viewer/example#../api/service/readme.md) I am writing here…

This cool article by @whyrusleeping explains about how to create a custom IPFS Service using GoLang.

However, the corenet "github.com/ipfs/go-ipfs/core/corenet"
dependency seems to have some issue. It is no longer part of the core IPFS.

Some suggested the corenet has been replaced by the p2p component (cc @Magik6k ). But p2p component doesn’t have the method “Listen” used in the code…

Maybe revise the code and dependencies?
Much awaited to create my custom IPFS Service!!!

1 Like

@whyrusleeping and @Magik6k, any help pls?

Hey, @0zAND1z

Is this https://github.com/whyrusleeping/ipfs-examples/tree/master/api/service you are looking for?

The old Listen method is more-or-less equal to https://github.com/ipfs/go-ipfs/blob/master/p2p/p2p.go#L146, it’s not public though, it’s accessible from ipfs p2p command. The interface is not great, if you have ideas on how to improve it, go ahead and write them down in https://github.com/ipfs/go-ipfs/issues/3994

yes, and it seems to miss “corenet” package.

Here’s the error I keep getting when I go run host.go:

host.go:10:2: cannot find package "code.google.com/p/go.net/context" in any of:
        /usr/local/Cellar/go/1.10/libexec/src/code.google.com/p/go.net/context (from $GOROOT)
        /Users/username/go/src/code.google.com/p/go.net/context (from $GOPATH)
host.go:6:2: cannot find package "github.com/jbenet/go-ipfs/core" in any of:
        /usr/local/Cellar/go/1.10/libexec/src/github.com/jbenet/go-ipfs/core (from $GOROOT)
        /Users/username/go/src/github.com/jbenet/go-ipfs/core (from $GOPATH)
host.go:7:2: cannot find package "github.com/jbenet/go-ipfs/core/corenet" in any of:
        /usr/local/Cellar/go/1.10/libexec/src/github.com/jbenet/go-ipfs/core/corenet (from $GOROOT)
        /Users/username/go/src/github.com/jbenet/go-ipfs/core/corenet (from $GOPATH)
host.go:8:2: cannot find package "github.com/jbenet/go-ipfs/repo/fsrepo" in any of:
        /usr/local/Cellar/go/1.10/libexec/src/github.com/jbenet/go-ipfs/repo/fsrepo (from $GOROOT)
        /Users/username/go/src/github.com/jbenet/go-ipfs/repo/fsrepo (from $GOPATH)