Skip to content
The go interface to ipfs's HTTP API
Go
Branch: master
Clone or download

Latest commit

Stebalien Merge pull request #214 from andrew/patch-1
Update project description in readme
Latest commit 1c7f5d0 Jun 2, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add autocomment configuration May 4, 2020
.gx gx publish 1.4.8 Feb 27, 2019
options options: add hash function selection for dagput Apr 13, 2019
testdata Fix AddDir() by switching to up-to-date MultiFileReader Nov 22, 2017
tests Update go-ipfs-util May 10, 2016
.travis.yml fix(ci): Bump minimum go version to go 1.13 Jan 7, 2020
LICENSE license Mar 22, 2016
README.md Update project description in readme May 21, 2020
add.go fix: add cid-version option to add (#186) Jun 4, 2019
bootstrap.go switch to using Request internally Jul 16, 2018
dag.go dag: properly pass hash option Apr 14, 2019
go.mod build(deps): bump github.com/multiformats/go-multiaddr-net Feb 6, 2020
go.sum build(deps): bump github.com/multiformats/go-multiaddr-net Feb 6, 2020
ipns.go switch to using Request internally Jul 16, 2018
ipns_test.go Add additional publish function for more fine grained control of IPNS… Jul 6, 2018
logger.go logger: change logger test name, bug fix with error return, misc fixes May 4, 2019
logger_test.go logger: change logger test name, bug fix with error return, misc fixes May 4, 2019
pubsub.go fix decoding json streams (#180) Jun 4, 2019
request.go remove req0 Apr 4, 2019
requestbuilder.go handle late errors when ignoring the response value Feb 14, 2019
requestbuilder_test.go use a request builder Jul 16, 2018
shell.go fix: pass a context to PinsStream May 5, 2020
shell_test.go fix: pass a context to PinsStream May 5, 2020
unixfs.go switch to using Request internally Jul 16, 2018

README.md

go-ipfs-api

standard-readme compliant GoDoc Build Status

The go interface to ipfs's HTTP API

Install

go get -u github.com/ipfs/go-ipfs-api

This will download the source into $GOPATH/src/github.com/ipfs/go-ipfs-api.

Usage

See the godocs for details on available methods. This should match the specs at ipfs/specs; however, there are still some methods which are not accounted for. If you would like to add any of them, see the contribute section below.

Example

Add a file with the contents "hello world!":

package main

import (
	"fmt"
	"strings"
    	"os"

    	shell "github.com/ipfs/go-ipfs-api"
)

func main() {
	// Where your local node is running on localhost:5001
	sh := shell.NewShell("localhost:5001")
	cid, err := sh.Add(strings.NewReader("hello world!"))
	if err != nil {
        fmt.Fprintf(os.Stderr, "error: %s", err)
        os.Exit(1)
	}
    fmt.Printf("added %s", cid)
}

For a more complete example, please see: https://github.com/ipfs/go-ipfs-api/blob/master/tests/main.go

Contribute

Contributions are welcome! Please check out the issues.

Want to hack on IPFS?

License

MIT

You can’t perform that action at this time.