Skip to content

Instantly share code, notes, and snippets.

@NeoTeo
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save NeoTeo/be215ea2005c0c946b6b to your computer and use it in GitHub Desktop.

Select an option

Save NeoTeo/be215ea2005c0c946b6b to your computer and use it in GitHub Desktop.

Notes on "Making your own ipfs service"

Update (HT Cryptix): If we make sure we have the net/context package from github by running

go get golang.org/x/net/context

and then change the import statements in the server and client source from

import ( "code.google.com/p/go.net/context" )

to

import ( "golang.org/x/net/context" )

we can avoid the Mercurial install

To build the examples from a fresh system you have to make sure you have the Google go.net repo separately from

https://code.google.com/p/go/source/checkout?repo=net

Since it wants Mercurial to clone, you have to make sure you have that. Eg. with the Brew on OS X it's a matter of running

brew install mercurial

With Mercurial installed you can get the repo by running

hg clone https://code.google.com/p/go.net/

from inside the directory $GOPATH/src/code.google.com/p/ (from a fresh system you'll need to mkdir the code.google.com/p/ path first)

Another issue is that you need to use the full id as an argument to the client side example.

To output the full id use :

fmt.Printf("I am peer: %s\n", nd.Identity.Pretty())

That is, add a .Pretty() to the existing Printf.

Also, it may seem obvious, but you can only run one node per machine so to test both the server and the client you need two machines or a separate VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment