Skip to content

Commit

Permalink
go mod tidy ipfs library example
Browse files Browse the repository at this point in the history
The code example for using IPFS as a library doesn't run unless indirect dependencies are updated:

```
$ go version
go version go1.17 linux/amd64
$ uname -a
Linux home 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
$ go run main.go
go: github.com/ipfs/go-ipfs@v0.9.1 requires
	github.com/ipfs/go-bitswap@v0.4.0: missing go.sum entry; to add it:
	go mod download github.com/ipfs/go-bitswap
go: github.com/ipfs/go-ipfs@v0.9.1 requires
	github.com/ipfs/go-bitswap@v0.4.0: missing go.sum entry; to add it:
	go mod download github.com/ipfs/go-bitswap
```

Remedied by:

```
$ go mod tidy
$ go run main.go
-- Getting an IPFS node running --
Spawning node on a temporary repo
    ...
```

Also, require go version 1.16, otherwise, example can fail under go
1.15 with errors like:

```
go build github.com/lucas-clemente/quic-go/internal/qtls:
    build constraints exclude all Go files in
    /home/jbouwman/go/pkg/mod/github.com/lucas-clemente/quic-go@v0.23.0/internal/qtls
```

(cherry picked from commit cb189c7)
  • Loading branch information
jbouwman authored and aschmahmann committed Sep 27, 2021
1 parent f00f7d2 commit 3906e6f
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 76 deletions.
10 changes: 5 additions & 5 deletions docs/examples/go-ipfs-as-a-library/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/ipfs/go-ipfs/examples/go-ipfs-as-a-library

go 1.15
go 1.16

require (
github.com/ipfs/go-ipfs v0.9.1
github.com/ipfs/go-ipfs-config v0.14.0
github.com/ipfs/go-ipfs-config v0.16.0
github.com/ipfs/go-ipfs-files v0.0.8
github.com/ipfs/interface-go-ipfs-core v0.4.0
github.com/libp2p/go-libp2p-core v0.8.6
github.com/multiformats/go-multiaddr v0.3.3
github.com/ipfs/interface-go-ipfs-core v0.5.1
github.com/libp2p/go-libp2p-core v0.9.0
github.com/multiformats/go-multiaddr v0.4.0
)

replace github.com/ipfs/go-ipfs => ./../../..
Loading

0 comments on commit 3906e6f

Please sign in to comment.