Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 2.48 KB

README.md

File metadata and controls

62 lines (46 loc) · 2.48 KB

Example of Go-IPFS As A Library

This repo is a spin-off of the official tutorial sample of go-ipfs (from Go-IPFS v0.7.0).

It aims to be the working example for various Golang version.

  • Example: main.go
  • Tests of the example: main_test.go
  • Results of weekly testing
    • Go 1.14 go1_14
    • Go 1.15 go1_15
    • Go 1.16 go1_16

How To Run

$ git clone https://github.com/KEINOS/go-ipfs-as-a-library.git
...(** snip **)...

$ cd ./go-ipfs-as-a-library

$ go mod download
...(** snip **)...

$ go run main.go
...(** snip **)...
All done! You just finalized your first tutorial on how to use go-ipfs as a library

How To Test

$ go test .
ok      github.com/ipfs/go-ipfs/examples/go-ipfs-as-a-library   2.362s

If you have Docker installed, you can run the test with docker-compose.

# It runs the tests on Go v1.14, 1.15, 1.16 over Alpine Linux
$ docker-compose up
...(** snip **)...
v1_14_1  | ok  	github.com/ipfs/go-ipfs/examples/go-ipfs-as-a-library	2.973s
v1_14_1 exited with code 0
v1_15_1  | ok  	github.com/ipfs/go-ipfs/examples/go-ipfs-as-a-library	2.205s
v1_15_1 exited with code 0
v1_16_1  | ok  	github.com/ipfs/go-ipfs/examples/go-ipfs-as-a-library	1.696s
v1_16_1 exited with code 0

References for Go-IPFS

License