From 07aa00dfa69e81a7dd5623d82ed130a46dd9c188 Mon Sep 17 00:00:00 2001 From: gammazero Date: Wed, 27 Jan 2021 10:17:53 -0800 Subject: [PATCH 001/161] Do not fetch recursive pins from pinner unnecessarily When fetching all pins, the recursive pins are fetched from the pinner two times. The second fetch is unnecessary and copies all recursive pins into a slice again. Additionally, the output channel is now buffered. This allows the goroutine to exit in the case the pinner returns an error and there is no reader for the output channel. This might be possible if a canceled context causes the caller to abandon waiting to read the output of Ls(). --- core/coreapi/pin.go | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 3b6ae2d9395..160db2c047c 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -220,7 +220,7 @@ func (p *pinInfo) Err() error { // pinLsAll is an internal function for returning a list of pins func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreiface.Pin { - out := make(chan coreiface.Pin) + out := make(chan coreiface.Pin, 1) keys := cid.NewSet() @@ -249,37 +249,34 @@ func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreifac go func() { defer close(out) + var dkeys, rkeys []cid.Cid + var err error if typeStr == "recursive" || typeStr == "all" { - rkeys, err := api.pinning.RecursiveKeys(ctx) + rkeys, err = api.pinning.RecursiveKeys(ctx) if err != nil { out <- &pinInfo{err: err} return } - if err := AddToResultKeys(rkeys, "recursive"); err != nil { + if err = AddToResultKeys(rkeys, "recursive"); err != nil { out <- &pinInfo{err: err} return } } if typeStr == "direct" || typeStr == "all" { - dkeys, err := api.pinning.DirectKeys(ctx) + dkeys, err = api.pinning.DirectKeys(ctx) if err != nil { out <- &pinInfo{err: err} return } - if err := AddToResultKeys(dkeys, "direct"); err != nil { + if err = AddToResultKeys(dkeys, "direct"); err != nil { out <- &pinInfo{err: err} return } } if typeStr == "all" { set := cid.NewSet() - rkeys, err := api.pinning.RecursiveKeys(ctx) - if err != nil { - out <- &pinInfo{err: err} - return - } for _, k := range rkeys { - err := merkledag.Walk( + err = merkledag.Walk( ctx, merkledag.GetLinksWithDAG(api.dag), k, set.Visit, merkledag.SkipRoot(), merkledag.Concurrent(), @@ -289,7 +286,7 @@ func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreifac return } } - if err := AddToResultKeys(set.Keys(), "indirect"); err != nil { + if err = AddToResultKeys(set.Keys(), "indirect"); err != nil { out <- &pinInfo{err: err} return } @@ -298,14 +295,14 @@ func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreifac // We need to first visit the direct pins that have priority // without emitting them - dkeys, err := api.pinning.DirectKeys(ctx) + dkeys, err = api.pinning.DirectKeys(ctx) if err != nil { out <- &pinInfo{err: err} return } VisitKeys(dkeys) - rkeys, err := api.pinning.RecursiveKeys(ctx) + rkeys, err = api.pinning.RecursiveKeys(ctx) if err != nil { out <- &pinInfo{err: err} return @@ -314,7 +311,7 @@ func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreifac set := cid.NewSet() for _, k := range rkeys { - err := merkledag.Walk( + err = merkledag.Walk( ctx, merkledag.GetLinksWithDAG(api.dag), k, set.Visit, merkledag.SkipRoot(), merkledag.Concurrent(), @@ -324,7 +321,7 @@ func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreifac return } } - if err := AddToResultKeys(set.Keys(), "indirect"); err != nil { + if err = AddToResultKeys(set.Keys(), "indirect"); err != nil { out <- &pinInfo{err: err} return } From d61ae2bcb48be6067acaaa9c0d1c51483f891b0b Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 29 Jan 2021 22:08:16 +0100 Subject: [PATCH 002/161] fix: remove use of Clear-Site-Data We used Clear-Site-Data to cushion transition period for local gateway exposed at http://localhost while we were still figuring out security-related details. In the final implementation subdomain gateways are not tied to a hostname explicitly, which removes the risk of cookies leaking, removing the need for the header. Turns out it causes issues for Firefox users, so let's just remove it. Closes https://github.com/ipfs-shipyard/ipfs-companion/issues/977 --- core/corehttp/hostname.go | 9 --------- docs/config.md | 1 - test/sharness/t0114-gateway-subdomains.sh | 7 ------- 3 files changed, 17 deletions(-) diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index da133f7abe1..d4006cb8432 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -97,15 +97,6 @@ func HostnameOption() ServeOption { return } if newURL != "" { - // Just to be sure single Origin can't be abused in - // web browsers that ignored the redirect for some - // reason, Clear-Site-Data header clears browsing - // data (cookies, storage etc) associated with - // hostname's root Origin - // Note: we can't use "*" due to bug in Chromium: - // https://bugs.chromium.org/p/chromium/issues/detail?id=898503 - w.Header().Set("Clear-Site-Data", "\"cookies\", \"storage\"") - // Set "Location" header with redirect destination. // It is ignored by curl in default mode, but will // be respected by user agents that follow diff --git a/docs/config.md b/docs/config.md index d2806a8a7d0..521c7df1f2e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -653,7 +653,6 @@ between content roots. } } ``` - Default: `false` diff --git a/test/sharness/t0114-gateway-subdomains.sh b/test/sharness/t0114-gateway-subdomains.sh index b9af0805e57..0cf4d57ae92 100755 --- a/test/sharness/t0114-gateway-subdomains.sh +++ b/test/sharness/t0114-gateway-subdomains.sh @@ -181,13 +181,6 @@ test_localhost_gateway_response_should_contain \ "http://localhost:$GWAY_PORT/ipfs/$DIR_CID/" \ "Location: http://$DIR_CID.ipfs.localhost:$GWAY_PORT/" -# Responses to the root domain of subdomain gateway hostname should Clear-Site-Data -# https://github.com/ipfs/go-ipfs/issues/6975#issuecomment-597472477 -test_localhost_gateway_response_should_contain \ - "request for localhost/ipfs/{CIDv1} returns Clear-Site-Data header to purge Origin cookies and storage" \ - "http://localhost:$GWAY_PORT/ipfs/$CIDv1" \ - 'Clear-Site-Data: \"cookies\", \"storage\"' - # We return body with HTTP 301 so existing cli scripts that use path-based # gateway do not break (curl doesn't auto-redirect without passing -L; wget # does not span across hostnames by default) From e37d08f2104cbf5d5c639a791404b31570a27a7d Mon Sep 17 00:00:00 2001 From: gammazero Date: Wed, 16 Dec 2020 18:47:16 -0800 Subject: [PATCH 003/161] Migration downloads individual migration binaries The code in this PR finds the necessary mirgations, downloads the latest version of them from the distribution site, unpacks the executables, and runs the migrations in order. This code is also used to build the ipfs-update tool and the fs-repo-migrations tool. Note: the fs-repo-migrations tool is only used to run stand-alone migrations now and is not used by either go-ipfs or ipfs-update. Additional utility is provided by this PR, that is not specific to migrations: - Find local ipfs directory - Get current repo version - Check for ipfs daemon availability - Get version information about any distribution on distribution site - Fetch and unpack any binary executable over ipfs or http --- cmd/ipfs/daemon.go | 4 +- go.mod | 1 + go.sum | 2 + repo/fsrepo/fsrepo.go | 6 +- repo/fsrepo/migrations/fetch.go | 268 ++++++++++++++++ repo/fsrepo/migrations/fetch_test.go | 129 ++++++++ repo/fsrepo/migrations/ipfsdir.go | 198 ++++++++++++ repo/fsrepo/migrations/ipfsdir_test.go | 156 ++++++++++ repo/fsrepo/migrations/mfsr.go | 55 ---- repo/fsrepo/migrations/mfsr_test.go | 43 --- repo/fsrepo/migrations/migrations.go | 363 +++++++++------------- repo/fsrepo/migrations/migrations_test.go | 93 ++++++ repo/fsrepo/migrations/unpack.go | 80 ++--- repo/fsrepo/migrations/versions.go | 90 ++++++ repo/fsrepo/migrations/versions_test.go | 63 ++++ 15 files changed, 1189 insertions(+), 362 deletions(-) create mode 100644 repo/fsrepo/migrations/fetch.go create mode 100644 repo/fsrepo/migrations/fetch_test.go create mode 100644 repo/fsrepo/migrations/ipfsdir.go create mode 100644 repo/fsrepo/migrations/ipfsdir_test.go delete mode 100644 repo/fsrepo/migrations/mfsr.go delete mode 100644 repo/fsrepo/migrations/mfsr_test.go create mode 100644 repo/fsrepo/migrations/migrations_test.go create mode 100644 repo/fsrepo/migrations/versions.go create mode 100644 repo/fsrepo/migrations/versions_test.go diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 329a29c4cf4..698b6c8c4e0 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -26,7 +26,7 @@ import ( libp2p "github.com/ipfs/go-ipfs/core/node/libp2p" nodeMount "github.com/ipfs/go-ipfs/fuse/node" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - migrate "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" sockets "github.com/libp2p/go-socket-activation" cmds "github.com/ipfs/go-ipfs-cmds" @@ -288,7 +288,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment return fmt.Errorf("fs-repo requires migration") } - err = migrate.RunMigration(fsrepo.RepoVersion) + err = migrations.RunMigration(cctx.Context(), fsrepo.RepoVersion, "") if err != nil { fmt.Println("The migrations of fs-repo failed:") fmt.Printf(" %s\n", err) diff --git a/go.mod b/go.mod index 25e25fcd3d5..190ed2675c0 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d github.com/cheggaaa/pb v1.0.29 + github.com/coreos/go-semver v0.3.0 github.com/coreos/go-systemd/v22 v22.1.0 github.com/dustin/go-humanize v1.0.0 github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 diff --git a/go.sum b/go.sum index dcb0966c873..2a8ce4f4bdc 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,7 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -1029,6 +1030,7 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= +github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c/go.mod h1:xxcJeBb7SIUl/Wzkz1eVKJE/CB34YNrqX2TQI6jY9zs= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 011c47a1d7c..fbe131dc148 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -14,7 +14,7 @@ import ( keystore "github.com/ipfs/go-ipfs/keystore" repo "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-ipfs/repo/common" - mfsr "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" dir "github.com/ipfs/go-ipfs/thirdparty/dir" ds "github.com/ipfs/go-datastore" @@ -142,7 +142,7 @@ func open(repoPath string) (repo.Repo, error) { }() // Check version, and error out if not matching - ver, err := mfsr.RepoPath(r.path).Version() + ver, err := migrations.RepoVersion(r.path) if err != nil { if os.IsNotExist(err) { return nil, ErrNoVersion @@ -291,7 +291,7 @@ func Init(repoPath string, conf *config.Config) error { return err } - if err := mfsr.RepoPath(repoPath).WriteVersion(RepoVersion); err != nil { + if err := migrations.WriteRepoVersion(repoPath, RepoVersion); err != nil { return err } diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go new file mode 100644 index 00000000000..436dd809190 --- /dev/null +++ b/repo/fsrepo/migrations/fetch.go @@ -0,0 +1,268 @@ +package migrations + +import ( + "bufio" + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "net/http" + "os" + "os/exec" + "path" + "runtime" + "strings" +) + +const ( + // Distribution + gatewayURL = "https://ipfs.io" + ipfsDist = "/ipns/dist.ipfs.io" + // ipfsDist = "/ipfs/QmYRLRDKobvg1AXTGeK5Xk6ntWTsjGiHbyNKhWfz7koGpa" + + // Maximum download size + fetchSizeLimit = 1024 * 1024 * 512 +) + +type limitReadCloser struct { + io.Reader + io.Closer +} + +var ipfsDistPath string + +func init() { + SetIpfsDistPath("") +} + +// SetIpfsDistPath sets the ipfs path to the distribution site. If an empty +// string is given, then the path is set using the IPFS_DIST_PATH environ +// veriable, or the default value if that is not defined. +func SetIpfsDistPath(distPath string) { + if distPath != "" { + ipfsDistPath = distPath + return + } + + if dist := os.Getenv("IPFS_DIST_PATH"); dist != "" { + ipfsDistPath = dist + } else { + ipfsDistPath = ipfsDist + } +} + +// FetchBinary downloads an archive from the distribution site and unpacks it. +// +// The base name of the archive file, inside the distribution directory on +// distribution site, may differ from the distribution name. If it does, then +// specify arcName. +// +// The base name of the binary inside the archive may differ from the base +// archive name. If it does, then specify binName. For example, the following +// is needed because the archive "go-ipfs_v0.7.0_linux-amd64.tar.gz" contains a +// binary named "ipfs" +// +// FetchBinary(ctx, "go-ipfs", "v0.7.0", "go-ipfs", "ipfs", tmpDir) +// +// If out is a directory, then the binary is written to that directory with the +// same name it has inside the archive. Otherwise, the binary file is written +// to the file named by out. +func FetchBinary(ctx context.Context, dist, ver, arcName, binName, out string) (string, error) { + // If archive base name not specified, then it is same as dist. + if arcName == "" { + arcName = dist + } + // If binary base name is not specified, then it is same as archive base name. + if binName == "" { + binName = arcName + } + + // Name of binary that exists inside archive + binName = ExeName(binName) + + // Return error if file exists or stat fails for reason other than not + // exists. If out is a directory, then write extracted binary to that dir. + fi, err := os.Stat(out) + if !os.IsNotExist(err) { + if err != nil { + return "", err + } + if !fi.IsDir() { + return "", &os.PathError{ + Op: "FetchBinary", + Path: out, + Err: os.ErrExist, + } + } + // out exists and is a directory, so compose final name + out = path.Join(out, binName) + } + + // Create temp directory to store download + tmpDir, err := ioutil.TempDir("", arcName) + if err != nil { + return "", err + } + defer os.RemoveAll(tmpDir) + + atype := "tar.gz" + if runtime.GOOS == "windows" { + atype = "zip" + } + + arcName = makeArchiveName(arcName, ver, atype) + arcIpfsPath := makeIpfsPath(dist, ver, arcName) + + // Create a file to write the archive data to + arcPath := path.Join(tmpDir, arcName) + arcFile, err := os.Create(arcPath) + if err != nil { + return "", err + } + defer arcFile.Close() + + // Open connection to download archive from ipfs path + rc, err := fetch(ctx, arcIpfsPath) + if err != nil { + return "", err + } + defer rc.Close() + + // Write download data + _, err = io.Copy(arcFile, rc) + if err != nil { + return "", err + } + arcFile.Close() + + // Unpack the archive and write binary to out + err = unpackArchive(arcPath, atype, dist, binName, out) + if err != nil { + return "", err + } + + // Set mode of binary to executable + err = os.Chmod(out, 0755) + if err != nil { + return "", err + } + + return out, nil +} + +// fetch attempts to fetch the file at the given ipfs path, first using the +// local ipfs api if available, then using http. Returns io.ReadCloser on +// success, which caller must close. +func fetch(ctx context.Context, ipfsPath string) (io.ReadCloser, error) { + // Try fetching via ipfs daemon + rc, err := ipfsFetch(ctx, ipfsPath) + if err == nil { + // Transferred using local ipfs daemon + return rc, nil + } + // Try fetching via HTTP + return httpFetch(ctx, gatewayURL+ipfsPath) +} + +// ipfsFetch attempts to fetch the file at the given ipfs path using the local +// ipfs api. Returns io.ReadCloser on success, which caller must close. +func ipfsFetch(ctx context.Context, ipfsPath string) (io.ReadCloser, error) { + sh, _, err := ApiShell("") + if err != nil { + return nil, err + } + + resp, err := sh.Request("cat", ipfsPath).Send(ctx) + if err != nil { + return nil, err + } + if resp.Error != nil { + return nil, resp.Error + } + + return newLimitReadCloser(resp.Output, fetchSizeLimit), nil +} + +// httpFetch attempts to fetch the file at the given URL. Returns +// io.ReadCloser on success, which caller must close. +func httpFetch(ctx context.Context, url string) (io.ReadCloser, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return nil, fmt.Errorf("http.NewRequest error: %s", err) + } + + req.Header.Set("User-Agent", "go-ipfs") + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, fmt.Errorf("http.DefaultClient.Do error: %s", err) + } + + if resp.StatusCode >= 400 { + defer resp.Body.Close() + mes, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("error reading error body: %s", err) + } + return nil, fmt.Errorf("GET %s error: %s: %s", url, resp.Status, string(mes)) + } + + return newLimitReadCloser(resp.Body, fetchSizeLimit), nil +} + +func newLimitReadCloser(rc io.ReadCloser, limit int64) io.ReadCloser { + return limitReadCloser{ + Reader: io.LimitReader(rc, limit), + Closer: rc, + } +} + +// osWithVariant returns the OS name with optional variant. +// Currently returns either runtime.GOOS, or "linux-musl". +func osWithVariant() (string, error) { + if runtime.GOOS != "linux" { + return runtime.GOOS, nil + } + + // ldd outputs the system's kind of libc. + // - on standard ubuntu: ldd (Ubuntu GLIBC 2.23-0ubuntu5) 2.23 + // - on alpine: musl libc (x86_64) + // + // we use the combined stdout+stderr, + // because ldd --version prints differently on different OSes. + // - on standard ubuntu: stdout + // - on alpine: stderr (it probably doesn't know the --version flag) + // + // we suppress non-zero exit codes (see last point about alpine). + out, err := exec.Command("sh", "-c", "ldd --version || true").CombinedOutput() + if err != nil { + return "", err + } + + // now just see if we can find "musl" somewhere in the output + scan := bufio.NewScanner(bytes.NewBuffer(out)) + for scan.Scan() { + if strings.Contains(scan.Text(), "musl") { + return "linux-musl", nil + } + } + + return "linux", nil +} + +// makeArchiveName composes the name of a migration binary archive. +// +// The archive name is in the format: name_version_osv-GOARCH.atype +// Example: ipfs-10-to-11_v1.8.0_darwin-amd64.tar.gz +func makeArchiveName(name, ver, atype string) string { + return fmt.Sprintf("%s_%s_%s-%s.%s", name, ver, runtime.GOOS, runtime.GOARCH, atype) +} + +// makeIpfsPath composes the name ipfs path location to download a migration +// binary from the distribution site. +// +// The ipfs path format: distBaseCID/rootdir/version/name/archive +func makeIpfsPath(dist, ver, arcName string) string { + return fmt.Sprintf("%s/%s/%s/%s", ipfsDistPath, dist, ver, arcName) +} diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go new file mode 100644 index 00000000000..f23729e3f22 --- /dev/null +++ b/repo/fsrepo/migrations/fetch_test.go @@ -0,0 +1,129 @@ +package migrations + +import ( + "bufio" + "context" + "io/ioutil" + "os" + "path" + "strings" + "testing" +) + +func TestHttpFetch(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + url := gatewayURL + path.Join(ipfsDistPath, distFSRM, distVersions) + rc, err := httpFetch(ctx, url) + if err != nil { + t.Fatal(err) + } + defer rc.Close() + + var out []string + scan := bufio.NewScanner(rc) + for scan.Scan() { + out = append(out, scan.Text()) + } + err = scan.Err() + if err != nil { + t.Fatal("could not read versions:", err) + } + + if len(out) < 14 { + t.Fatal("do not get all expected data") + } + if out[0] != "v1.0.0" { + t.Fatal("expected v1.0.0 as first line, got", out[0]) + } + + // Check bad URL + url = gatewayURL + path.Join(ipfsDistPath, distFSRM, "no_such_file") + rc, err = httpFetch(ctx, url) + if err == nil || !strings.Contains(err.Error(), "404") { + t.Fatal("expected error 404") + } +} + +func TestIpfsFetch(t *testing.T) { + _, err := ApiEndpoint("") + if err != nil { + t.Skip("skipped - local ipfs daemon not available") + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + url := path.Join(ipfsDistPath, distFSRM, distVersions) + rc, err := ipfsFetch(ctx, url) + if err != nil { + t.Fatal(err) + } + defer rc.Close() + + var out []string + scan := bufio.NewScanner(rc) + for scan.Scan() { + out = append(out, scan.Text()) + } + err = scan.Err() + if err != nil { + t.Fatal("could not read versions:", err) + } + + if len(out) < 14 { + t.Fatal("do not get all expected data") + } + if out[0] != "v1.0.0" { + t.Fatal("expected v1.0.0 as first line, got", out[0]) + } + + // Check bad URL + url = path.Join(ipfsDistPath, distFSRM, "no_such_file") + rc, err = ipfsFetch(ctx, url) + if err == nil || !strings.Contains(err.Error(), "no link") { + t.Fatal("expected 'no link' error, got:", err) + } +} + +func TestFetchBinary(t *testing.T) { + tmpDir, err := ioutil.TempDir("", "fetchtest") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmpDir) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + vers, err := DistVersions(ctx, distFSRM, false) + if err != nil { + t.Fatal(err) + } + t.Log("latest version of", distFSRM, "is", vers[len(vers)-1]) + + bin, err := FetchBinary(ctx, distFSRM, vers[0], distFSRM, distFSRM, tmpDir) + if err != nil { + t.Fatal(err) + } + + fi, err := os.Stat(bin) + if os.IsNotExist(err) { + t.Error("expected file to exist:", bin) + } + + t.Log("downloaded and unpacked", fi.Size(), "byte file:", fi.Name()) + + bin, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "go-ipfs", "ipfs", tmpDir) + if err != nil { + t.Fatal(err) + } + + fi, err = os.Stat(bin) + if os.IsNotExist(err) { + t.Error("expected file to exist:", bin) + } + + t.Log("downloaded and unpacked", fi.Size(), "byte file:", fi.Name()) +} diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go new file mode 100644 index 00000000000..c3a809041c8 --- /dev/null +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -0,0 +1,198 @@ +package migrations + +import ( + "errors" + "fmt" + "io/ioutil" + "os" + "path" + "strconv" + "strings" + "time" + + api "github.com/ipfs/go-ipfs-api" + "github.com/mitchellh/go-homedir" +) + +const ( + envIpfsPath = "IPFS_PATH" + versionFile = "version" + + // Local IPFS API + apiFile = "api" + shellUpTimeout = 2 * time.Second +) + +var ( + disableDirCache bool + ipfsDirCache string + ipfsDirCacheKey string +) + +// ApiEndpoint reads the api file from the local ipfs install directory and +// returns the address:port read from the file. If the ipfs directory is not +// specified then the default location is used. +func ApiEndpoint(ipfsDir string) (string, error) { + ipfsDir, err := checkIpfsDir(ipfsDir) + if err != nil { + return "", err + } + apiPath := path.Join(ipfsDir, apiFile) + + apiData, err := ioutil.ReadFile(apiPath) + if err != nil { + return "", err + } + + val := strings.TrimSpace(string(apiData)) + parts := strings.Split(val, "/") + if len(parts) != 5 { + return "", fmt.Errorf("incorrectly formatted api string: %q", val) + } + + return parts[2] + ":" + parts[4], nil +} + +// ApiShell creates a new ipfs api shell and checks that it is up. If the shell +// is available, then the shell and ipfs version are returned. +func ApiShell(ipfsDir string) (*api.Shell, string, error) { + apiEp, err := ApiEndpoint("") + if err != nil { + return nil, "", err + } + sh := api.NewShell(apiEp) + sh.SetTimeout(shellUpTimeout) + ver, _, err := sh.Version() + if err != nil { + return nil, "", errors.New("ipfs api shell not up") + } + sh.SetTimeout(0) + return sh, ver, nil +} + +// Returns the path of the default ipfs directory. +func IpfsDir() (string, error) { + return checkIpfsDir("") +} + +// RepoVersion returns the version of the repo in the ipfs directory. If the +// ipfs directory is not specified then the default location is used. +func RepoVersion(ipfsDir string) (int, error) { + ipfsDir, err := checkIpfsDir(ipfsDir) + if err != nil { + return 0, err + } + return repoVersion(ipfsDir) +} + +// WriteRepoVersion writes the specified repo version to the repo located in +// ipfsDir. If ipfsDir is not specified, then the default location is used. +func WriteRepoVersion(ipfsDir string, version int) error { + ipfsDir, err := checkIpfsDir(ipfsDir) + if err != nil { + return err + } + + vFilePath := path.Join(ipfsDir, versionFile) + return ioutil.WriteFile(vFilePath, []byte(fmt.Sprintf("%d\n", version)), 0644) +} + +// CacheIpfsDir enables or disables caching the location of the ipfs directory. +// Enabled by default, this avoids subsequent search for and check of the same +// ipfs directory. Disabling the cache may be useful if the location of the +// ipfs directory is expected to change. +func CacheIpfsDir(enable bool) { + if !enable { + disableDirCache = true + ipfsDirCache = "" + ipfsDirCacheKey = "" + homedir.DisableCache = true + homedir.Reset() + } else { + homedir.DisableCache = false + disableDirCache = false + } +} + +func repoVersion(ipfsDir string) (int, error) { + c, err := ioutil.ReadFile(path.Join(ipfsDir, versionFile)) + if err != nil { + if os.IsNotExist(err) { + // IPFS directory exists without version file, so version 0 + return 0, nil + } + return 0, fmt.Errorf("cannot read repo version file: %s", err) + } + + ver, err := strconv.Atoi(strings.TrimSpace(string(c))) + if err != nil { + return 0, errors.New("invalid data in repo version file") + } + return ver, nil +} + +func checkIpfsDir(dir string) (string, error) { + if dir == ipfsDirCacheKey && ipfsDirCache != "" { + return ipfsDirCache, nil + } + + var ( + err error + found string + ) + if dir == "" { + found, err = findIpfsDir() + if err != nil { + return "", fmt.Errorf("could not find ipfs directory: %s", err) + } + } else { + found, err = homedir.Expand(dir) + if err != nil { + return "", err + } + + _, err = os.Stat(found) + if err != nil { + return "", err + } + } + + if !disableDirCache { + ipfsDirCacheKey = dir + ipfsDirCache = found + } + + return found, nil +} + +func findIpfsDir() (string, error) { + ipfspath := os.Getenv(envIpfsPath) + if ipfspath != "" { + expandedPath, err := homedir.Expand(ipfspath) + if err != nil { + return "", err + } + return expandedPath, nil + } + + home, err := homedir.Dir() + if err != nil { + return "", err + } + if home == "" { + return "", errors.New("could not determine IPFS_PATH, home dir not set") + } + + for _, dir := range []string{".go-ipfs", ".ipfs"} { + defaultDir := path.Join(home, dir) + _, err = os.Stat(defaultDir) + if err == nil { + return defaultDir, nil + } + if !os.IsNotExist(err) { + return "", err + } + } + + return "", err +} diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go new file mode 100644 index 00000000000..e4a5fa761cf --- /dev/null +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -0,0 +1,156 @@ +package migrations + +import ( + "io/ioutil" + "os" + "path" + "testing" +) + +var ( + fakeHome string + fakeIpfs string +) + +func init() { + CacheIpfsDir(false) +} + +func TestRepoDir(t *testing.T) { + var err error + fakeHome, err = ioutil.TempDir("", "testhome") + if err != nil { + panic(err) + } + defer os.RemoveAll(fakeHome) + + os.Setenv("HOME", fakeHome) + fakeIpfs = path.Join(fakeHome, ".ipfs") + + t.Run("testFindIpfsDir", testFindIpfsDir) + t.Run("testCheckIpfsDir", testCheckIpfsDir) + t.Run("testRepoVersion", testRepoVersion) +} + +func testFindIpfsDir(t *testing.T) { + _, err := findIpfsDir() + if err == nil { + t.Fatal("expected error when no .ipfs directory to find") + } + + err = os.Mkdir(fakeIpfs, os.ModePerm) + if err != nil { + panic(err) + } + + dir, err := findIpfsDir() + if err != nil { + t.Fatal(err) + } + if dir != fakeIpfs { + t.Fatal("wrong ipfs directory:", dir) + } + + os.Setenv("IPFS_PATH", "~/.ipfs") + dir, err = findIpfsDir() + if err != nil { + t.Fatal(err) + } + if dir != fakeIpfs { + t.Fatal("wrong ipfs directory:", dir) + } +} + +func testCheckIpfsDir(t *testing.T) { + _, err := checkIpfsDir("~/no_such_dir") + if err == nil { + t.Fatal("expected error from nonexistent directory") + } + + dir, err := checkIpfsDir("~/.ipfs") + if err != nil { + t.Fatal(err) + } + if dir != fakeIpfs { + t.Fatal("wrong ipfs directory:", dir) + } +} + +func testRepoVersion(t *testing.T) { + ver, err := RepoVersion(fakeIpfs) + if err != nil { + t.Fatal(err) + } + if ver != 0 { + t.Fatal("expected version 0 when no version file") + } + + testVer := 42 + err = WriteRepoVersion(fakeIpfs, testVer) + if err != nil { + t.Fatal(err) + } + + ver, err = RepoVersion(fakeIpfs) + if err != nil { + t.Fatal(err) + } + if ver != testVer { + t.Fatalf("expected version %d, got %d", testVer, ver) + } +} + +func TestApiEndpoint(t *testing.T) { + var err error + fakeHome, err = ioutil.TempDir("", "testhome") + if err != nil { + panic(err) + } + defer os.RemoveAll(fakeHome) + defer os.Unsetenv("HOME") + + os.Setenv("HOME", fakeHome) + fakeIpfs = path.Join(fakeHome, ".ipfs") + + err = os.Mkdir(fakeIpfs, os.ModePerm) + if err != nil { + panic(err) + } + + _, err = ApiEndpoint("") + if err == nil { + t.Fatal("expected error when missing api file") + } + + apiPath := path.Join(fakeIpfs, apiFile) + err = ioutil.WriteFile(apiPath, []byte("bad-data"), 0644) + if err != nil { + panic(err) + } + + _, err = ApiEndpoint("") + if err == nil { + t.Fatal("expected error when bad data") + } + + err = ioutil.WriteFile(apiPath, []byte("/ip4/127.0.0.1/tcp/5001"), 0644) + if err != nil { + panic(err) + } + + val, err := ApiEndpoint("") + if err != nil { + t.Fatal(err) + } + if val != "127.0.0.1:5001" { + t.Fatal("got unexpected value:", val) + } + + val2, err := ApiEndpoint(fakeIpfs) + if err != nil { + t.Fatal(err) + } + if val2 != val { + t.Fatal("expected", val, "got", val2) + } +} diff --git a/repo/fsrepo/migrations/mfsr.go b/repo/fsrepo/migrations/mfsr.go deleted file mode 100644 index c0f3b8b4862..00000000000 --- a/repo/fsrepo/migrations/mfsr.go +++ /dev/null @@ -1,55 +0,0 @@ -package mfsr - -import ( - "fmt" - "io/ioutil" - "os" - "path" - "strconv" - "strings" -) - -const VersionFile = "version" - -type RepoPath string - -func (rp RepoPath) VersionFile() string { - return path.Join(string(rp), VersionFile) -} - -func (rp RepoPath) Version() (int, error) { - if rp == "" { - return 0, fmt.Errorf("invalid repo path \"%s\"", rp) - } - - fn := rp.VersionFile() - if _, err := os.Stat(fn); err != nil { - return 0, err - } - - c, err := ioutil.ReadFile(fn) - if err != nil { - return 0, err - } - - s := strings.TrimSpace(string(c)) - return strconv.Atoi(s) -} - -func (rp RepoPath) CheckVersion(version int) error { - v, err := rp.Version() - if err != nil { - return err - } - - if v != version { - return fmt.Errorf("versions differ (expected: %d, actual:%d)", version, v) - } - - return nil -} - -func (rp RepoPath) WriteVersion(version int) error { - fn := rp.VersionFile() - return ioutil.WriteFile(fn, []byte(fmt.Sprintf("%d\n", version)), 0644) -} diff --git a/repo/fsrepo/migrations/mfsr_test.go b/repo/fsrepo/migrations/mfsr_test.go deleted file mode 100644 index c93babff7f6..00000000000 --- a/repo/fsrepo/migrations/mfsr_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package mfsr - -import ( - "io/ioutil" - "os" - "strconv" - "testing" - - "github.com/ipfs/go-ipfs/thirdparty/assert" -) - -func testVersionFile(v string, t *testing.T) (rp RepoPath) { - name, err := ioutil.TempDir("", v) - if err != nil { - t.Fatal(err) - } - rp = RepoPath(name) - return rp -} - -func TestVersion(t *testing.T) { - rp := RepoPath("") - _, err := rp.Version() - assert.Err(err, t, "Should throw an error when path is bad,") - - rp = RepoPath("/path/to/nowhere") - _, err = rp.Version() - if !os.IsNotExist(err) { - t.Fatalf("Should throw an `IsNotExist` error when file doesn't exist: %v", err) - } - - fsrepoV := 5 - - rp = testVersionFile(strconv.Itoa(fsrepoV), t) - _, err = rp.Version() - assert.Err(err, t, "Bad VersionFile") - - assert.Nil(rp.WriteVersion(fsrepoV), t, "Trouble writing version") - - assert.Nil(rp.CheckVersion(fsrepoV), t, "Trouble checking the version") - - assert.Err(rp.CheckVersion(1), t, "Should throw an error for the wrong version.") -} diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 33266dd9127..aa46dbc4182 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -1,282 +1,203 @@ -package mfsr +package migrations import ( - "bufio" - "bytes" + "context" "fmt" - "io" "io/ioutil" - "net/http" + "log" "os" "os/exec" - "path/filepath" + "path" "runtime" - "strconv" "strings" + "sync" ) -var DistPath = "https://ipfs.io/ipfs/QmYRLRDKobvg1AXTGeK5Xk6ntWTsjGiHbyNKhWfz7koGpa" +const ( + // Migrations distribution + distMigsRoot = "go-ipfs-repo-migrations" + distFSRM = "fs-repo-migrations" +) -func init() { - if dist := os.Getenv("IPFS_DIST_PATH"); dist != "" { - DistPath = dist +// RunMigration finds, downloads, and runs the individual migrations needed to +// migrate the repo from its current version to the target version. +func RunMigration(ctx context.Context, targetVer int, ipfsDir string) error { + ipfsDir, err := checkIpfsDir(ipfsDir) + if err != nil { + return err } -} - -const migrations = "fs-repo-migrations" - -func migrationsBinName() string { - switch runtime.GOOS { - case "windows": - return migrations + ".exe" - default: - return migrations + fromVer, err := repoVersion(ipfsDir) + if err != nil { + return fmt.Errorf("could not get repo version: %s", err) + } + if fromVer == targetVer { + // repo already at target version number + return nil } -} - -func RunMigration(newv int) error { - migrateBin := migrationsBinName() - fmt.Println(" => Looking for suitable fs-repo-migrations binary.") + log.Print("Looking for suitable migration binaries.") - var err error - migrateBin, err = exec.LookPath(migrateBin) - if err == nil { - // check to make sure migrations binary supports our target version - err = verifyMigrationSupportsVersion(migrateBin, newv) + migrations, binPaths, err := findMigrations(ctx, fromVer, targetVer) + if err != nil { + return err } - if err != nil { - fmt.Println(" => None found, downloading.") + // Download migrations that were not found + if len(binPaths) < len(migrations) { + missing := make([]string, 0, len(migrations)-len(binPaths)) + for _, mig := range migrations { + if _, ok := binPaths[mig]; !ok { + missing = append(missing, mig) + } + } + + log.Print("Need", len(missing), "migrations, downloading.") - loc, err := GetMigrations() + tmpDir, err := ioutil.TempDir("", "migrations") if err != nil { - fmt.Println(" => Failed to download fs-repo-migrations.") return err } + defer os.RemoveAll(tmpDir) - err = verifyMigrationSupportsVersion(loc, newv) + fetched, err := fetchMigrations(ctx, missing, tmpDir) if err != nil { - return fmt.Errorf("no fs-repo-migration binary found for version %d: %s", newv, err) + log.Print("Failed to download migrations.") + return err + } + for i := range missing { + binPaths[missing[i]] = fetched[i] } - - migrateBin = loc } - cmd := exec.Command(migrateBin, "-to", fmt.Sprint(newv), "-y") - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - - fmt.Printf(" => Running: %s -to %d -y\n", migrateBin, newv) - - err = cmd.Run() - if err != nil { - fmt.Printf(" => Failed: %s -to %d -y\n", migrateBin, newv) - return fmt.Errorf("migration failed: %s", err) + var revert bool + if fromVer > targetVer { + revert = true } - - fmt.Printf(" => Success: fs-repo has been migrated to version %d.\n", newv) + for _, migration := range migrations { + log.Println("Running migration", migration, "...") + err = runMigration(ctx, binPaths[migration], ipfsDir, revert) + if err != nil { + return fmt.Errorf("migration %s failed: %s", migration, err) + } + } + log.Printf("Success: fs-repo migrated to version %d.\n", targetVer) return nil } -func GetMigrations() (string, error) { - latest, err := GetLatestVersion(DistPath, migrations) - if err != nil { - return "", fmt.Errorf("failed to find latest fs-repo-migrations: %s", err) - } - - dir, err := ioutil.TempDir("", "go-ipfs-migrate") - if err != nil { - return "", fmt.Errorf("failed to create fs-repo-migrations tempdir: %s", err) - } - - out := filepath.Join(dir, migrationsBinName()) - - err = GetBinaryForVersion(migrations, migrations, DistPath, latest, out) - if err != nil { - return "", fmt.Errorf("failed to download latest fs-repo-migrations: %s", err) - } - - err = os.Chmod(out, 0755) +func NeedMigration(target int) (bool, error) { + vnum, err := RepoVersion("") if err != nil { - return "", err + return false, fmt.Errorf("could not get repo version: %s", err) } - return out, nil + return vnum != target, nil } -func verifyMigrationSupportsVersion(fsrbin string, vn int) error { - sn, err := migrationsVersion(fsrbin) - if err != nil { - return err +func ExeName(name string) string { + if runtime.GOOS == "windows" { + return name + ".exe" } - - if sn >= vn { - return nil - } - - return fmt.Errorf("migrations binary doesn't support version %d: %s", vn, fsrbin) + return name } -func migrationsVersion(bin string) (int, error) { - out, err := exec.Command(bin, "-v").CombinedOutput() - if err != nil { - return 0, fmt.Errorf("failed to check migrations version: %s", err) - } - - vs := strings.Trim(string(out), " \n\t") - vn, err := strconv.Atoi(vs) - if err != nil { - return 0, fmt.Errorf("migrations binary version check did not return a number: %s", err) - } - - return vn, nil +func migrationName(from, to int) string { + return fmt.Sprintf("ipfs-%d-to-%d", from, to) } -func GetVersions(ipfspath, dist string) ([]string, error) { - rc, err := httpFetch(ipfspath + "/" + dist + "/versions") - if err != nil { - return nil, err - } - defer rc.Close() - - var out []string - scan := bufio.NewScanner(rc) - for scan.Scan() { - out = append(out, scan.Text()) +// findMigrations returns a list of migrations, ordered from first to last +// migration to apply, and a map of locations migration binaries of any +// migrations that were found. +func findMigrations(ctx context.Context, from, to int) ([]string, map[string]string, error) { + step := 1 + count := to - from + if from > to { + step = -1 + count = from - to } - return out, nil -} + migrations := make([]string, 0, count) + binPaths := make(map[string]string, count) -func GetLatestVersion(ipfspath, dist string) (string, error) { - vs, err := GetVersions(ipfspath, dist) - if err != nil { - return "", err - } - var latest string - for i := len(vs) - 1; i >= 0; i-- { - if !strings.Contains(vs[i], "-dev") { - latest = vs[i] - break + for cur := from; cur != to; cur += step { + if ctx.Err() != nil { + return nil, nil, ctx.Err() } - } - if latest == "" { - return "", fmt.Errorf("couldn't find a non dev version in the list") - } - return vs[len(vs)-1], nil -} - -func httpGet(url string) (*http.Response, error) { - req, err := http.NewRequest(http.MethodGet, url, nil) - if err != nil { - return nil, fmt.Errorf("http.NewRequest error: %s", err) - } - - req.Header.Set("User-Agent", "go-ipfs") - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, fmt.Errorf("http.DefaultClient.Do error: %s", err) - } - - return resp, nil -} - -func httpFetch(url string) (io.ReadCloser, error) { - resp, err := httpGet(url) - if err != nil { - return nil, err - } - - if resp.StatusCode >= 400 { - mes, err := ioutil.ReadAll(resp.Body) + migName := migrationName(cur, cur+step) + migrations = append(migrations, migName) + bin, err := exec.LookPath(migName) if err != nil { - return nil, fmt.Errorf("error reading error body: %s", err) + continue } - - return nil, fmt.Errorf("GET %s error: %s: %s", url, resp.Status, string(mes)) + binPaths[migName] = bin } - - return resp.Body, nil + return migrations, binPaths, nil } -func GetBinaryForVersion(distname, binnom, root, vers, out string) error { - dir, err := ioutil.TempDir("", "go-ipfs-auto-migrate") - if err != nil { - return err +func runMigration(ctx context.Context, binPath, ipfsDir string, revert bool) error { + pathArg := fmt.Sprintf("-path=%s", ipfsDir) + var cmd *exec.Cmd + if revert { + log.Println(" => Running:", binPath, pathArg, "-verbose=true -revert") + cmd = exec.CommandContext(ctx, binPath, pathArg, "-verbose=true", "-revert") + } else { + log.Println(" => Running:", binPath, pathArg, "-verbose=true") + cmd = exec.CommandContext(ctx, binPath, pathArg, "-verbose=true") } + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() +} - var archive string - switch runtime.GOOS { - case "windows": - archive = "zip" - binnom += ".exe" - default: - archive = "tar.gz" - } +// fetchMigrations downloads the requested migrations, and returns a slice with +// the paths of each binary, in the same order as in needed. +func fetchMigrations(ctx context.Context, needed []string, destDir string) ([]string, error) { osv, err := osWithVariant() if err != nil { - return err + return nil, err } - if osv == "linux-musl" { - return fmt.Errorf("linux-musl not supported, you must build the binary from source for your platform") - } - - finame := fmt.Sprintf("%s_%s_%s-%s.%s", distname, vers, osv, runtime.GOARCH, archive) - distpath := fmt.Sprintf("%s/%s/%s/%s", root, distname, vers, finame) - - data, err := httpFetch(distpath) - if err != nil { - return err - } - - arcpath := filepath.Join(dir, finame) - fi, err := os.Create(arcpath) - if err != nil { - return err - } - - _, err = io.Copy(fi, data) - if err != nil { - return err - } - fi.Close() - - return unpackArchive(distname, binnom, arcpath, out, archive) -} - -// osWithVariant returns the OS name with optional variant. -// Currently returns either runtime.GOOS, or "linux-musl". -func osWithVariant() (string, error) { - if runtime.GOOS != "linux" { - return runtime.GOOS, nil - } - - // ldd outputs the system's kind of libc. - // - on standard ubuntu: ldd (Ubuntu GLIBC 2.23-0ubuntu5) 2.23 - // - on alpine: musl libc (x86_64) - // - // we use the combined stdout+stderr, - // because ldd --version prints differently on different OSes. - // - on standard ubuntu: stdout - // - on alpine: stderr (it probably doesn't know the --version flag) - // - // we suppress non-zero exit codes (see last point about alpine). - out, err := exec.Command("sh", "-c", "ldd --version || true").CombinedOutput() - if err != nil { - return "", err + return nil, fmt.Errorf("linux-musl not supported, you must build the binary from source for your platform") + } + + var wg sync.WaitGroup + wg.Add(len(needed)) + bins := make([]string, len(needed)) + // Download and unpack all requested migrations concurrently. + for i, name := range needed { + log.Printf("Downloading migration: %s...", name) + go func(i int, name string) { + defer wg.Done() + distDir := path.Join(distMigsRoot, name) + ver, err := LatestDistVersion(ctx, distDir) + if err != nil { + log.Printf("could not get latest version of migration %s: %s", name, err) + return + } + loc, err := FetchBinary(ctx, distDir, ver, name, name, destDir) + if err != nil { + log.Printf("could not download %s: %s", name, err) + return + } + log.Printf("Downloaded and unpacked migration: %s", loc) + bins[i] = loc + }(i, name) + } + wg.Wait() + + var fails []string + for i := range bins { + if bins[i] == "" { + fails = append(fails, needed[i]) + } } - - // now just see if we can find "musl" somewhere in the output - scan := bufio.NewScanner(bytes.NewBuffer(out)) - for scan.Scan() { - if strings.Contains(scan.Text(), "musl") { - return "linux-musl", nil + if len(fails) != 0 { + err = fmt.Errorf("failed to download migrations: %s", strings.Join(fails, " ")) + if ctx.Err() != nil { + err = fmt.Errorf("%s, %s", ctx.Err(), err) } + return nil, err } - return "linux", nil + return bins, nil } diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go new file mode 100644 index 00000000000..27b45820027 --- /dev/null +++ b/repo/fsrepo/migrations/migrations_test.go @@ -0,0 +1,93 @@ +package migrations + +import ( + "context" + "io/ioutil" + "os" + "path" + "testing" +) + +func TestFindMigrations(t *testing.T) { + tmpDir, err := ioutil.TempDir("", "migratetest") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmpDir) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + migs, bins, err := findMigrations(ctx, 0, 5) + if err != nil { + t.Fatal(err) + } + if len(bins) != 0 { + t.Fatal("should not have found migrations") + } + + for i := 1; i < 6; i++ { + createFakeBin(i-1, i, tmpDir) + } + + origPath := os.Getenv("PATH") + os.Setenv("PATH", tmpDir) + defer os.Setenv("PATH", origPath) + + migs, bins, err = findMigrations(ctx, 0, 5) + if err != nil { + t.Fatal(err) + } + if len(migs) != 5 { + t.Fatal("expected 5 migrations") + } + if len(bins) != len(migs) { + t.Fatal("missing", len(migs)-len(bins), "migrations") + } + + os.Remove(bins[migs[2]]) + + migs, bins, err = findMigrations(ctx, 0, 5) + if err != nil { + t.Fatal(err) + } + if len(bins) != len(migs)-1 { + t.Fatal("should be missing one migration bin") + } +} + +func TestFetchMigrations(t *testing.T) { + t.Skip("skip - migrations not available on distribution site yet") + + tmpDir, err := ioutil.TempDir("", "migratetest") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmpDir) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + needed := []string{"ipfs-1-to-2", "ipfs-2-to-3"} + fetched, err := fetchMigrations(ctx, needed, tmpDir) + if err != nil { + t.Fatal(err) + } + + for _, bin := range fetched { + _, err = os.Stat(bin) + if os.IsNotExist(err) { + t.Error("expected file to exist:", bin) + } + } +} + +func createFakeBin(from, to int, tmpDir string) { + migPath := path.Join(tmpDir, ExeName(migrationName(from, to))) + emptyFile, err := os.Create(migPath) + if err != nil { + panic(err) + } + emptyFile.Close() + os.Chmod(migPath, 0755) +} diff --git a/repo/fsrepo/migrations/unpack.go b/repo/fsrepo/migrations/unpack.go index 5b563071f65..04c429e68f5 100644 --- a/repo/fsrepo/migrations/unpack.go +++ b/repo/fsrepo/migrations/unpack.go @@ -1,90 +1,82 @@ -package mfsr +package migrations import ( "archive/tar" "archive/zip" "compress/gzip" + "errors" "fmt" "io" "os" ) -func unpackArchive(dist, binnom, path, out, atype string) error { +func unpackArchive(arcPath, atype, root, name, out string) error { + var err error switch atype { - case "zip": - return unpackZip(dist, binnom, path, out) case "tar.gz": - return unpackTgz(dist, binnom, path, out) + err = unpackTgz(arcPath, root, name, out) + case "zip": + err = unpackZip(arcPath, root, name, out) default: - return fmt.Errorf("unrecognized archive type: %s", atype) + err = fmt.Errorf("unrecognized archive type: %s", atype) + } + if err != nil { + return err } + os.Remove(arcPath) + return nil } -func unpackTgz(dist, binnom, path, out string) error { - fi, err := os.Open(path) +func unpackTgz(arcPath, root, name, out string) error { + fi, err := os.Open(arcPath) if err != nil { - return err + return fmt.Errorf("cannot open archive file: %s", err) } defer fi.Close() gzr, err := gzip.NewReader(fi) if err != nil { - return err + return fmt.Errorf("error opening gzip reader: %s", err) } - defer gzr.Close() var bin io.Reader tarr := tar.NewReader(gzr) -loop: + lookFor := root + "/" + name for { th, err := tarr.Next() - switch err { - default: - return err - case io.EOF: - break loop - case nil: - // continue + if err != nil { + if err == io.EOF { + break + } + return fmt.Errorf("cannot read archive: %s", err) } - if th.Name == dist+"/"+binnom { + if th.Name == lookFor { bin = tarr break } } if bin == nil { - return fmt.Errorf("no binary found in downloaded archive") + return errors.New("no binary found in archive") } return writeToPath(bin, out) } -func writeToPath(rc io.Reader, out string) error { - binfi, err := os.Create(out) - if err != nil { - return fmt.Errorf("error opening tmp bin path '%s': %s", out, err) - } - defer binfi.Close() - - _, err = io.Copy(binfi, rc) - - return err -} - -func unpackZip(dist, binnom, path, out string) error { - zipr, err := zip.OpenReader(path) +func unpackZip(arcPath, root, name, out string) error { + zipr, err := zip.OpenReader(arcPath) if err != nil { - return fmt.Errorf("error opening zipreader: %s", err) + return fmt.Errorf("error opening zip reader: %s", err) } - defer zipr.Close() + lookFor := root + "/" + name var bin io.ReadCloser for _, fis := range zipr.File { - if fis.Name == dist+"/"+binnom { + if fis.Name == lookFor { rc, err := fis.Open() if err != nil { return fmt.Errorf("error extracting binary from archive: %s", err) @@ -96,3 +88,15 @@ func unpackZip(dist, binnom, path, out string) error { return writeToPath(bin, out) } + +func writeToPath(rc io.Reader, out string) error { + binfi, err := os.Create(out) + if err != nil { + return fmt.Errorf("error opening tmp bin path '%s': %s", out, err) + } + defer binfi.Close() + + _, err = io.Copy(binfi, rc) + + return err +} diff --git a/repo/fsrepo/migrations/versions.go b/repo/fsrepo/migrations/versions.go new file mode 100644 index 00000000000..7e58381d357 --- /dev/null +++ b/repo/fsrepo/migrations/versions.go @@ -0,0 +1,90 @@ +package migrations + +import ( + "bufio" + "context" + "errors" + "fmt" + "os/exec" + "path" + "sort" + "strconv" + "strings" + + "github.com/coreos/go-semver/semver" +) + +const distVersions = "versions" + +// LatestDistVersion returns the latest version, of the specified distribution, +// that is available on the distribution site. +func LatestDistVersion(ctx context.Context, dist string) (string, error) { + vs, err := DistVersions(ctx, dist, false) + if err != nil { + return "", err + } + + for i := len(vs) - 1; i >= 0; i-- { + ver := vs[i] + if !strings.Contains(ver, "-dev") { + return ver, nil + } + } + return "", errors.New("could not find a non dev version") +} + +// DistVersions returns all versions of the specified distribution, that are +// available on the distriburion site. List is in ascending order, unless +// sortDesc is true. +func DistVersions(ctx context.Context, dist string, sortDesc bool) ([]string, error) { + rc, err := fetch(ctx, path.Join(ipfsDistPath, dist, distVersions)) + if err != nil { + return nil, err + } + defer rc.Close() + + prefix := "v" + var vers []*semver.Version + + scan := bufio.NewScanner(rc) + for scan.Scan() { + ver, err := semver.NewVersion(strings.TrimLeft(scan.Text(), prefix)) + if err != nil { + continue + } + vers = append(vers, ver) + } + err = scan.Err() + if err != nil { + return nil, fmt.Errorf("could not read versions: %s", err) + } + + if sortDesc { + sort.Sort(sort.Reverse(semver.Versions(vers))) + } else { + sort.Sort(semver.Versions(vers)) + } + + out := make([]string, len(vers)) + for i := range vers { + out[i] = prefix + vers[i].String() + } + + return out, nil +} + +// IpfsRepoVersion returns the repo version required by the ipfs daemon +func IpfsRepoVersion(ctx context.Context) (int, error) { + out, err := exec.CommandContext(ctx, "ipfs", "version", "--repo").CombinedOutput() + if err != nil { + return 0, fmt.Errorf("%s: %s", err, string(out)) + } + + verStr := strings.TrimSpace(string(out)) + ver, err := strconv.Atoi(verStr) + if err != nil { + return 0, fmt.Errorf("repo version is not an integer: %s", verStr) + } + + return ver, nil +} diff --git a/repo/fsrepo/migrations/versions_test.go b/repo/fsrepo/migrations/versions_test.go new file mode 100644 index 00000000000..a9725404999 --- /dev/null +++ b/repo/fsrepo/migrations/versions_test.go @@ -0,0 +1,63 @@ +package migrations + +import ( + "context" + "os/exec" + "testing" + + "github.com/coreos/go-semver/semver" +) + +const testDist = "go-ipfs" + +func TestDistVersions(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + vers, err := DistVersions(ctx, testDist, true) + if err != nil { + t.Fatal(err) + } + if len(vers) == 0 { + t.Fatal("no versions of", testDist) + } + t.Log("There are", len(vers), "versions of", testDist) + t.Log("Latest 5 are:", vers[:5]) +} + +func TestLatestDistVersion(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + latest, err := LatestDistVersion(ctx, testDist) + if err != nil { + t.Fatal(err) + } + if len(latest) < 6 { + t.Fatal("latest version string too short", latest) + } + _, err = semver.NewVersion(latest[1:]) + if err != nil { + t.Fatal("latest version has invalid format:", latest) + } + t.Log("Latest version of", testDist, "is", latest) +} + +func TestIpfsRepoVersion(t *testing.T) { + _, err := exec.LookPath("ipfs") + if err != nil { + t.Skip("ipfs not available") + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ipfsRepoVer, err := IpfsRepoVersion(ctx) + if err != nil { + t.Fatal("Could not get required repo version:", err) + } + if ipfsRepoVer < 1 { + t.Fatal("Invalid repo version") + } + t.Log("IPFS repo version:", ipfsRepoVer) +} From 5a3e567321401851e66afb42e85c063feaa6dfb9 Mon Sep 17 00:00:00 2001 From: gammazero Date: Mon, 11 Jan 2021 20:06:06 -0800 Subject: [PATCH 004/161] Do not put migrations under their own root Since the migrations are not displayed on the dirtributions, there is not need to organize them under their own root to reduce visual clutter. Having each migration follow the same path as all other distributions makes each easier to find in the absence of a link displayed on the distributions web page. It also avoids complicating the distribution deployment scripts and allows each migration distribution to be treated the same as any other distribution. --- repo/fsrepo/migrations/fetch_test.go | 4 ++-- repo/fsrepo/migrations/migrations.go | 4 ++-- repo/fsrepo/migrations/migrations_test.go | 24 ++++++++++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index f23729e3f22..0e7770c2c37 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -40,7 +40,7 @@ func TestHttpFetch(t *testing.T) { // Check bad URL url = gatewayURL + path.Join(ipfsDistPath, distFSRM, "no_such_file") - rc, err = httpFetch(ctx, url) + _, err = httpFetch(ctx, url) if err == nil || !strings.Contains(err.Error(), "404") { t.Fatal("expected error 404") } @@ -81,7 +81,7 @@ func TestIpfsFetch(t *testing.T) { // Check bad URL url = path.Join(ipfsDistPath, distFSRM, "no_such_file") - rc, err = ipfsFetch(ctx, url) + _, err = ipfsFetch(ctx, url) if err == nil || !strings.Contains(err.Error(), "no link") { t.Fatal("expected 'no link' error, got:", err) } diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index aa46dbc4182..8bccc78874a 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -14,8 +14,8 @@ import ( ) const ( - // Migrations distribution - distMigsRoot = "go-ipfs-repo-migrations" + // Migrations subdirectory in distribution. Empty for root (no subdir). + distMigsRoot = "" distFSRM = "fs-repo-migrations" ) diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 27b45820027..e57093527df 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -3,8 +3,10 @@ package migrations import ( "context" "io/ioutil" + "net/http" "os" "path" + "strings" "testing" ) @@ -22,6 +24,9 @@ func TestFindMigrations(t *testing.T) { if err != nil { t.Fatal(err) } + if len(migs) != 5 { + t.Fatal("expected 5 migrations") + } if len(bins) != 0 { t.Fatal("should not have found migrations") } @@ -57,7 +62,16 @@ func TestFindMigrations(t *testing.T) { } func TestFetchMigrations(t *testing.T) { - t.Skip("skip - migrations not available on distribution site yet") + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + _, err := LatestDistVersion(ctx, "ipfs-1-to-2") + if err != nil { + if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) { + t.Skip("skip - migrations not yet available on distribution site") + } + t.Fatal(err) + } tmpDir, err := ioutil.TempDir("", "migratetest") if err != nil { @@ -65,9 +79,6 @@ func TestFetchMigrations(t *testing.T) { } defer os.RemoveAll(tmpDir) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - needed := []string{"ipfs-1-to-2", "ipfs-2-to-3"} fetched, err := fetchMigrations(ctx, needed, tmpDir) if err != nil { @@ -89,5 +100,8 @@ func createFakeBin(from, to int, tmpDir string) { panic(err) } emptyFile.Close() - os.Chmod(migPath, 0755) + err = os.Chmod(migPath, 0755) + if err != nil { + panic(err) + } } From 01df5bd2118d351a9d18428d9b1b44f3eb0c7950 Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 14 Jan 2021 15:43:18 -0800 Subject: [PATCH 005/161] Export IpfsDir() and CheckIpfsDir() - IpfsDir gets the location of the ipfs directory, whether it exists or not - CheckIpfsDir get the location and checks whether it exists. --- repo/fsrepo/migrations/ipfsdir.go | 148 ++++++++-------------- repo/fsrepo/migrations/ipfsdir_test.go | 14 +- repo/fsrepo/migrations/migrations.go | 2 +- repo/fsrepo/migrations/migrations_test.go | 1 + 4 files changed, 61 insertions(+), 104 deletions(-) diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index c3a809041c8..f371f25ea0f 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -23,17 +23,15 @@ const ( shellUpTimeout = 2 * time.Second ) -var ( - disableDirCache bool - ipfsDirCache string - ipfsDirCacheKey string -) +func init() { + homedir.DisableCache = true +} // ApiEndpoint reads the api file from the local ipfs install directory and // returns the address:port read from the file. If the ipfs directory is not // specified then the default location is used. func ApiEndpoint(ipfsDir string) (string, error) { - ipfsDir, err := checkIpfsDir(ipfsDir) + ipfsDir, err := CheckIpfsDir(ipfsDir) if err != nil { return "", err } @@ -70,15 +68,60 @@ func ApiShell(ipfsDir string) (*api.Shell, string, error) { return sh, ver, nil } -// Returns the path of the default ipfs directory. -func IpfsDir() (string, error) { - return checkIpfsDir("") +// IpfsDir returns the path of the ipfs directory. If dir specified, then +// returns the expanded version dir. If dir is "", then return the directory +// set by IPFS_PATH, or if IPFS_PATH is not set, then return the default +// location in the home directory. +func IpfsDir(dir string) (string, error) { + var err error + if dir != "" { + dir, err = homedir.Expand(dir) + if err != nil { + return "", err + } + return dir, nil + } + + ipfspath := os.Getenv(envIpfsPath) + if ipfspath != "" { + dir, err := homedir.Expand(ipfspath) + if err != nil { + return "", err + } + return dir, nil + } + + home, err := homedir.Dir() + if err != nil { + return "", err + } + if home == "" { + return "", errors.New("could not determine IPFS_PATH, home dir not set") + } + + return path.Join(home, ".ipfs"), nil +} + +// CheckIpfsDir gets the ipfs directory and checks that the directory exists. +func CheckIpfsDir(dir string) (string, error) { + var err error + dir, err = IpfsDir(dir) + if err != nil { + return "", err + } + + _, err = os.Stat(dir) + if err != nil { + return "", err + } + + return dir, nil } // RepoVersion returns the version of the repo in the ipfs directory. If the // ipfs directory is not specified then the default location is used. func RepoVersion(ipfsDir string) (int, error) { - ipfsDir, err := checkIpfsDir(ipfsDir) + ipfsDir, err := CheckIpfsDir(ipfsDir) if err != nil { return 0, err } @@ -88,7 +131,7 @@ func RepoVersion(ipfsDir string) (int, error) { // WriteRepoVersion writes the specified repo version to the repo located in // ipfsDir. If ipfsDir is not specified, then the default location is used. func WriteRepoVersion(ipfsDir string, version int) error { - ipfsDir, err := checkIpfsDir(ipfsDir) + ipfsDir, err := IpfsDir(ipfsDir) if err != nil { return err } @@ -97,23 +140,6 @@ func WriteRepoVersion(ipfsDir string, version int) error { return ioutil.WriteFile(vFilePath, []byte(fmt.Sprintf("%d\n", version)), 0644) } -// CacheIpfsDir enables or disables caching the location of the ipfs directory. -// Enabled by default, this avoids subsequent search for and check of the same -// ipfs directory. Disabling the cache may be useful if the location of the -// ipfs directory is expected to change. -func CacheIpfsDir(enable bool) { - if !enable { - disableDirCache = true - ipfsDirCache = "" - ipfsDirCacheKey = "" - homedir.DisableCache = true - homedir.Reset() - } else { - homedir.DisableCache = false - disableDirCache = false - } -} - func repoVersion(ipfsDir string) (int, error) { c, err := ioutil.ReadFile(path.Join(ipfsDir, versionFile)) if err != nil { @@ -130,69 +156,3 @@ func repoVersion(ipfsDir string) (int, error) { } return ver, nil } - -func checkIpfsDir(dir string) (string, error) { - if dir == ipfsDirCacheKey && ipfsDirCache != "" { - return ipfsDirCache, nil - } - - var ( - err error - found string - ) - if dir == "" { - found, err = findIpfsDir() - if err != nil { - return "", fmt.Errorf("could not find ipfs directory: %s", err) - } - } else { - found, err = homedir.Expand(dir) - if err != nil { - return "", err - } - - _, err = os.Stat(found) - if err != nil { - return "", err - } - } - - if !disableDirCache { - ipfsDirCacheKey = dir - ipfsDirCache = found - } - - return found, nil -} - -func findIpfsDir() (string, error) { - ipfspath := os.Getenv(envIpfsPath) - if ipfspath != "" { - expandedPath, err := homedir.Expand(ipfspath) - if err != nil { - return "", err - } - return expandedPath, nil - } - - home, err := homedir.Dir() - if err != nil { - return "", err - } - if home == "" { - return "", errors.New("could not determine IPFS_PATH, home dir not set") - } - - for _, dir := range []string{".go-ipfs", ".ipfs"} { - defaultDir := path.Join(home, dir) - _, err = os.Stat(defaultDir) - if err == nil { - return defaultDir, nil - } - if !os.IsNotExist(err) { - return "", err - } - } - - return "", err -} diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go index e4a5fa761cf..6bf37b69724 100644 --- a/repo/fsrepo/migrations/ipfsdir_test.go +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -12,10 +12,6 @@ var ( fakeIpfs string ) -func init() { - CacheIpfsDir(false) -} - func TestRepoDir(t *testing.T) { var err error fakeHome, err = ioutil.TempDir("", "testhome") @@ -33,7 +29,7 @@ func TestRepoDir(t *testing.T) { } func testFindIpfsDir(t *testing.T) { - _, err := findIpfsDir() + _, err := CheckIpfsDir("") if err == nil { t.Fatal("expected error when no .ipfs directory to find") } @@ -43,7 +39,7 @@ func testFindIpfsDir(t *testing.T) { panic(err) } - dir, err := findIpfsDir() + dir, err := IpfsDir("") if err != nil { t.Fatal(err) } @@ -52,7 +48,7 @@ func testFindIpfsDir(t *testing.T) { } os.Setenv("IPFS_PATH", "~/.ipfs") - dir, err = findIpfsDir() + dir, err = IpfsDir("") if err != nil { t.Fatal(err) } @@ -62,12 +58,12 @@ func testFindIpfsDir(t *testing.T) { } func testCheckIpfsDir(t *testing.T) { - _, err := checkIpfsDir("~/no_such_dir") + _, err := CheckIpfsDir("~/no_such_dir") if err == nil { t.Fatal("expected error from nonexistent directory") } - dir, err := checkIpfsDir("~/.ipfs") + dir, err := CheckIpfsDir("~/.ipfs") if err != nil { t.Fatal(err) } diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 8bccc78874a..ddd4419abb4 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -22,7 +22,7 @@ const ( // RunMigration finds, downloads, and runs the individual migrations needed to // migrate the repo from its current version to the target version. func RunMigration(ctx context.Context, targetVer int, ipfsDir string) error { - ipfsDir, err := checkIpfsDir(ipfsDir) + ipfsDir, err := CheckIpfsDir(ipfsDir) if err != nil { return err } diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index e57093527df..58085a2b999 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -65,6 +65,7 @@ func TestFetchMigrations(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() + SetIpfsDistPath("/ipfs/QmdFVsmD668ijuBFJwjyXdP5Sq44a5bPNAq3nnQF77kpyJ") _, err := LatestDistVersion(ctx, "ipfs-1-to-2") if err != nil { if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) { From 048db7599a9a498797a8f685739a880bc9f83e76 Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 14 Jan 2021 17:39:26 -0800 Subject: [PATCH 006/161] When version file is missing, do not assume this indicates version 0 since that breaks tests that get the version to see if ipfs is initialized --- repo/fsrepo/migrations/ipfsdir.go | 6 +----- repo/fsrepo/migrations/ipfsdir_test.go | 10 ++++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index f371f25ea0f..7d374d316fd 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -143,11 +143,7 @@ func WriteRepoVersion(ipfsDir string, version int) error { func repoVersion(ipfsDir string) (int, error) { c, err := ioutil.ReadFile(path.Join(ipfsDir, versionFile)) if err != nil { - if os.IsNotExist(err) { - // IPFS directory exists without version file, so version 0 - return 0, nil - } - return 0, fmt.Errorf("cannot read repo version file: %s", err) + return 0, err } ver, err := strconv.Atoi(strings.TrimSpace(string(c))) diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go index 6bf37b69724..c4861ece798 100644 --- a/repo/fsrepo/migrations/ipfsdir_test.go +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -73,12 +73,9 @@ func testCheckIpfsDir(t *testing.T) { } func testRepoVersion(t *testing.T) { - ver, err := RepoVersion(fakeIpfs) - if err != nil { - t.Fatal(err) - } - if ver != 0 { - t.Fatal("expected version 0 when no version file") + _, err := RepoVersion(fakeIpfs) + if !os.IsNotExist(err) { + t.Fatal("expected not-exist error") } testVer := 42 @@ -87,6 +84,7 @@ func testRepoVersion(t *testing.T) { t.Fatal(err) } + var ver int ver, err = RepoVersion(fakeIpfs) if err != nil { t.Fatal(err) From afcda7c05b6b37f392390202d13eda00650045cf Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 14 Jan 2021 18:31:37 -0800 Subject: [PATCH 007/161] Fix migraion name when fetching in reverse order --- repo/fsrepo/migrations/migrations.go | 7 +++- repo/fsrepo/migrations/migrations_test.go | 51 +++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index ddd4419abb4..1a75962a504 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -123,7 +123,12 @@ func findMigrations(ctx context.Context, from, to int) ([]string, map[string]str if ctx.Err() != nil { return nil, nil, ctx.Err() } - migName := migrationName(cur, cur+step) + var migName string + if step == -1 { + migName = migrationName(cur+step, cur) + } else { + migName = migrationName(cur, cur+step) + } migrations = append(migrations, migName) bin, err := exec.LookPath(migName) if err != nil { diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 58085a2b999..59f9d98640c 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -61,6 +61,57 @@ func TestFindMigrations(t *testing.T) { } } +func TestFindMigrationsReverse(t *testing.T) { + tmpDir, err := ioutil.TempDir("", "migratetest") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmpDir) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + migs, bins, err := findMigrations(ctx, 5, 0) + if err != nil { + t.Fatal(err) + } + if len(migs) != 5 { + t.Fatal("expected 5 migrations") + } + if len(bins) != 0 { + t.Fatal("should not have found migrations") + } + + for i := 1; i < 6; i++ { + createFakeBin(i-1, i, tmpDir) + } + + origPath := os.Getenv("PATH") + os.Setenv("PATH", tmpDir) + defer os.Setenv("PATH", origPath) + + migs, bins, err = findMigrations(ctx, 5, 0) + if err != nil { + t.Fatal(err) + } + if len(migs) != 5 { + t.Fatal("expected 5 migrations") + } + if len(bins) != len(migs) { + t.Fatal("missing", len(migs)-len(bins), "migrations:", migs) + } + + os.Remove(bins[migs[2]]) + + migs, bins, err = findMigrations(ctx, 5, 0) + if err != nil { + t.Fatal(err) + } + if len(bins) != len(migs)-1 { + t.Fatal("should be missing one migration bin") + } +} + func TestFetchMigrations(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() From e205b664a2da1994c06fbc8e4bdf433e75115f7f Mon Sep 17 00:00:00 2001 From: gammazero Date: Wed, 27 Jan 2021 20:32:43 -0800 Subject: [PATCH 008/161] Fix error reading zip when archive not found - Udate path to IPFS dist - Improve test coverage --- repo/fsrepo/migrations/fetch.go | 4 +- repo/fsrepo/migrations/fetch_test.go | 86 ++++++++- repo/fsrepo/migrations/ipfsdir_test.go | 82 ++++++++- repo/fsrepo/migrations/migrations_test.go | 2 +- repo/fsrepo/migrations/unpack.go | 5 + repo/fsrepo/migrations/unpack_test.go | 212 ++++++++++++++++++++++ 6 files changed, 382 insertions(+), 9 deletions(-) create mode 100644 repo/fsrepo/migrations/unpack_test.go diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 436dd809190..d52c2ef8937 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -16,6 +16,8 @@ import ( ) const ( + envIpfsDistPath = "IPFS_DIST_PATH" + // Distribution gatewayURL = "https://ipfs.io" ipfsDist = "/ipns/dist.ipfs.io" @@ -45,7 +47,7 @@ func SetIpfsDistPath(distPath string) { return } - if dist := os.Getenv("IPFS_DIST_PATH"); dist != "" { + if dist := os.Getenv(envIpfsDistPath); dist != "" { ipfsDistPath = dist } else { ipfsDistPath = ipfsDist diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 0e7770c2c37..18bb2595502 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -10,6 +10,35 @@ import ( "testing" ) +func TestSetIpfsDistPath(t *testing.T) { + os.Unsetenv(envIpfsDistPath) + SetIpfsDistPath("") + if ipfsDistPath != ipfsDist { + t.Error("did not set default dist path") + } + + testDist := "/unit/test/dist" + err := os.Setenv(envIpfsDistPath, testDist) + if err != nil { + panic(err) + } + defer func() { + os.Unsetenv(envIpfsDistPath) + SetIpfsDistPath("") + }() + + SetIpfsDistPath("") + if ipfsDistPath != testDist { + t.Error("did not set dist path from environ") + } + + testDist = "/unit/test/dist2" + SetIpfsDistPath(testDist) + if ipfsDistPath != testDist { + t.Error("did not set dist path") + } +} + func TestHttpFetch(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -39,11 +68,24 @@ func TestHttpFetch(t *testing.T) { } // Check bad URL + _, err = httpFetch(ctx, "") + if err == nil { + t.Fatal("expected error") + } + + // Check unreachable URL + _, err = httpFetch(ctx, "http://127.0.0.123:65510") + if err == nil || !strings.HasSuffix(err.Error(), "connection refused") { + t.Fatal("expected 'connection refused' error") + } + + // Check not found url = gatewayURL + path.Join(ipfsDistPath, distFSRM, "no_such_file") _, err = httpFetch(ctx, url) if err == nil || !strings.Contains(err.Error(), "404") { t.Fatal("expected error 404") } + } func TestIpfsFetch(t *testing.T) { @@ -103,7 +145,7 @@ func TestFetchBinary(t *testing.T) { } t.Log("latest version of", distFSRM, "is", vers[len(vers)-1]) - bin, err := FetchBinary(ctx, distFSRM, vers[0], distFSRM, distFSRM, tmpDir) + bin, err := FetchBinary(ctx, distFSRM, vers[0], distFSRM, "", tmpDir) if err != nil { t.Fatal(err) } @@ -115,7 +157,7 @@ func TestFetchBinary(t *testing.T) { t.Log("downloaded and unpacked", fi.Size(), "byte file:", fi.Name()) - bin, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "go-ipfs", "ipfs", tmpDir) + bin, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "ipfs", tmpDir) if err != nil { t.Fatal(err) } @@ -126,4 +168,44 @@ func TestFetchBinary(t *testing.T) { } t.Log("downloaded and unpacked", fi.Size(), "byte file:", fi.Name()) + + // Check error is destination already exists and is not directory + _, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "ipfs", bin) + if !os.IsExist(err) { + t.Fatal("expected 'exists' error") + } + + // Check error creating temp download directory + err = os.Chmod(tmpDir, 0555) + if err != nil { + panic(err) + } + err = os.Setenv("TMPDIR", tmpDir) + if err != nil { + panic(err) + } + _, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "ipfs", tmpDir) + if !os.IsPermission(err) { + t.Error("expected 'permission'error") + } + err = os.Setenv("TMPDIR", "/tmp") + if err != nil { + panic(err) + } + err = os.Chmod(tmpDir, 0755) + if err != nil { + panic(err) + } + + // Check error if failure to fetch due to bad dist + _, err = FetchBinary(ctx, "no-such-dist", "v0.3.5", "", "ipfs", tmpDir) + if err == nil || !strings.Contains(err.Error(), "Not Found") { + t.Error("expected 'Not Found' error") + } + + // Check error if failure to unpack archive + _, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "not-such-bin", tmpDir) + if err == nil || err.Error() != "no binary found in archive" { + t.Error("expected 'no binary found in archive' error") + } } diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go index c4861ece798..59c14a16423 100644 --- a/repo/fsrepo/migrations/ipfsdir_test.go +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -23,12 +23,12 @@ func TestRepoDir(t *testing.T) { os.Setenv("HOME", fakeHome) fakeIpfs = path.Join(fakeHome, ".ipfs") - t.Run("testFindIpfsDir", testFindIpfsDir) + t.Run("testIpfsDir", testIpfsDir) t.Run("testCheckIpfsDir", testCheckIpfsDir) t.Run("testRepoVersion", testRepoVersion) } -func testFindIpfsDir(t *testing.T) { +func testIpfsDir(t *testing.T) { _, err := CheckIpfsDir("") if err == nil { t.Fatal("expected error when no .ipfs directory to find") @@ -47,7 +47,7 @@ func testFindIpfsDir(t *testing.T) { t.Fatal("wrong ipfs directory:", dir) } - os.Setenv("IPFS_PATH", "~/.ipfs") + os.Setenv(envIpfsPath, "~/.ipfs") dir, err = IpfsDir("") if err != nil { t.Fatal(err) @@ -55,10 +55,46 @@ func testFindIpfsDir(t *testing.T) { if dir != fakeIpfs { t.Fatal("wrong ipfs directory:", dir) } + + _, err = IpfsDir("~somesuer/foo") + if err == nil { + t.Fatal("expected error with user-specific home dir") + } + + err = os.Setenv(envIpfsPath, "~somesuer/foo") + if err != nil { + panic(err) + } + _, err = IpfsDir("~somesuer/foo") + if err == nil { + t.Fatal("expected error with user-specific home dir") + } + err = os.Unsetenv(envIpfsPath) + if err != nil { + panic(err) + } + + dir, err = IpfsDir("~/.ipfs") + if err != nil { + t.Fatal(err) + } + if dir != fakeIpfs { + t.Fatal("wrong ipfs directory:", dir) + } + + _, err = IpfsDir("") + if err != nil { + t.Fatal(err) + } } func testCheckIpfsDir(t *testing.T) { - _, err := CheckIpfsDir("~/no_such_dir") + _, err := CheckIpfsDir("~somesuer/foo") + if err == nil { + t.Fatal("expected error with user-specific home dir") + } + + _, err = CheckIpfsDir("~/no_such_dir") if err == nil { t.Fatal("expected error from nonexistent directory") } @@ -73,7 +109,13 @@ func testCheckIpfsDir(t *testing.T) { } func testRepoVersion(t *testing.T) { - _, err := RepoVersion(fakeIpfs) + badDir := "~somesuer/foo" + _, err := RepoVersion(badDir) + if err == nil { + t.Fatal("expected error with user-specific home dir") + } + + _, err = RepoVersion(fakeIpfs) if !os.IsNotExist(err) { t.Fatal("expected not-exist error") } @@ -92,6 +134,29 @@ func testRepoVersion(t *testing.T) { if ver != testVer { t.Fatalf("expected version %d, got %d", testVer, ver) } + + err = WriteRepoVersion(badDir, testVer) + if err == nil { + t.Fatal("expected error with user-specific home dir") + } + + ipfsDir, err := IpfsDir(fakeIpfs) + if err != nil { + t.Fatal(err) + } + vFilePath := path.Join(ipfsDir, versionFile) + err = ioutil.WriteFile(vFilePath, []byte("bad-version-data\n"), 0644) + if err != nil { + panic(err) + } + _, err = RepoVersion(fakeIpfs) + if err == nil || err.Error() != "invalid data in repo version file" { + t.Fatal("expected 'invalid data' error") + } + err = WriteRepoVersion(fakeIpfs, testVer) + if err != nil { + t.Fatal(err) + } } func TestApiEndpoint(t *testing.T) { @@ -147,4 +212,11 @@ func TestApiEndpoint(t *testing.T) { if val2 != val { t.Fatal("expected", val, "got", val2) } + + _, _, err = ApiShell(fakeIpfs) + if err != nil { + if err.Error() != "ipfs api shell not up" { + t.Fatal("expected 'ipfs api shell not up' error") + } + } } diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 59f9d98640c..5136132dcde 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -116,7 +116,7 @@ func TestFetchMigrations(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - SetIpfsDistPath("/ipfs/QmdFVsmD668ijuBFJwjyXdP5Sq44a5bPNAq3nnQF77kpyJ") + SetIpfsDistPath("/ipfs/QmXt92hFRuvQgFhgHoaMxC4wLFcvKsCywQPTNmPYCGfEV4") _, err := LatestDistVersion(ctx, "ipfs-1-to-2") if err != nil { if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) { diff --git a/repo/fsrepo/migrations/unpack.go b/repo/fsrepo/migrations/unpack.go index 04c429e68f5..f08a19885ae 100644 --- a/repo/fsrepo/migrations/unpack.go +++ b/repo/fsrepo/migrations/unpack.go @@ -83,9 +83,14 @@ func unpackZip(arcPath, root, name, out string) error { } bin = rc + break } } + if bin == nil { + return errors.New("no binary found in archive") + } + return writeToPath(bin, out) } diff --git a/repo/fsrepo/migrations/unpack_test.go b/repo/fsrepo/migrations/unpack_test.go new file mode 100644 index 00000000000..cc3ec96a6d6 --- /dev/null +++ b/repo/fsrepo/migrations/unpack_test.go @@ -0,0 +1,212 @@ +package migrations + +import ( + "archive/tar" + "archive/zip" + "bufio" + "compress/gzip" + "io/ioutil" + "os" + "path" + "strings" + "testing" +) + +func TestUnpackArchive(t *testing.T) { + // Check unrecognized archive type + err := unpackArchive("", "no-arch-type", "", "", "") + if err == nil || err.Error() != "unrecognized archive type: no-arch-type" { + t.Fatal("expected 'unrecognized archive type' error") + } + + // Test cannot open errors + err = unpackArchive("no-archive", "tar.gz", "", "", "") + if err == nil || !strings.HasPrefix(err.Error(), "cannot open archive file") { + t.Fatal("expected 'cannot open' error, got:", err) + } + err = unpackArchive("no-archive", "zip", "", "", "") + if err == nil || !strings.HasPrefix(err.Error(), "error opening zip reader") { + t.Fatal("expected 'cannot open' error, got:", err) + } +} + +func TestUnpackTgz(t *testing.T) { + tmpDir, err := ioutil.TempDir("", "testunpacktgz") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmpDir) + + badTarGzip := path.Join(tmpDir, "bad.tar.gz") + err = ioutil.WriteFile(badTarGzip, []byte("bad-data\n"), 0644) + if err != nil { + panic(err) + } + err = unpackTgz(badTarGzip, "", "abc", "abc") + if err == nil || !strings.HasPrefix(err.Error(), "error opening gzip reader") { + t.Fatal("expected error opening gzip reader, got:", err) + } + + testTarGzip := path.Join(tmpDir, "test.tar.gz") + testData := "some data" + err = writeTarGzip(testTarGzip, "testroot", "testfile", testData) + if err != nil { + panic(err) + } + + out := path.Join(tmpDir, "out.txt") + + // Test looking for file that is not in archive + err = unpackTgz(testTarGzip, "testroot", "abc", out) + if err == nil || err.Error() != "no binary found in archive" { + t.Fatal("expected 'no binary found in archive' error, got:", err) + } + + // Test that unpack works. + err = unpackTgz(testTarGzip, "testroot", "testfile", out) + if err != nil { + t.Fatal(err) + } + + fi, err := os.Stat(out) + if err != nil { + t.Fatal(err) + } + if fi.Size() != int64(len(testData)) { + t.Fatal("unpacked file size is", fi.Size(), "expected", len(testData)) + } + +} + +func TestUnpackZip(t *testing.T) { + tmpDir, err := ioutil.TempDir("", "testunpackzip") + if err != nil { + panic(err) + } + defer os.RemoveAll(tmpDir) + + badZip := path.Join(tmpDir, "bad.zip") + err = ioutil.WriteFile(badZip, []byte("bad-data\n"), 0644) + if err != nil { + panic(err) + } + err = unpackZip(badZip, "", "abc", "abc") + if err == nil || !strings.HasPrefix(err.Error(), "error opening zip reader") { + t.Fatal("expected error opening zip reader, got:", err) + } + + testZip := path.Join(tmpDir, "test.zip") + testData := "some data" + err = writeZip(testZip, "testroot", "testfile", testData) + if err != nil { + panic(err) + } + + out := path.Join(tmpDir, "out.txt") + + // Test looking for file that is not in archive + err = unpackZip(testZip, "testroot", "abc", out) + if err == nil || err.Error() != "no binary found in archive" { + t.Fatal("expected 'no binary found in archive' error, got:", err) + } + + // Test that unpack works. + err = unpackZip(testZip, "testroot", "testfile", out) + if err != nil { + t.Fatal(err) + } + + fi, err := os.Stat(out) + if err != nil { + t.Fatal(err) + } + if fi.Size() != int64(len(testData)) { + t.Fatal("unpacked file size is", fi.Size(), "expected", len(testData)) + } +} + +func writeTarGzip(archName, root, fileName, data string) error { + archFile, err := os.Create(archName) + if err != nil { + return err + } + defer archFile.Close() + wr := bufio.NewWriter(archFile) + + // gzip writer writes to buffer + gzw := gzip.NewWriter(wr) + defer gzw.Close() + // tar writer writes to gzip + tw := tar.NewWriter(gzw) + defer tw.Close() + + if fileName != "" { + hdr := &tar.Header{ + Name: path.Join(root, fileName), + Mode: 0600, + Size: int64(len(data)), + } + // Write header + if err = tw.WriteHeader(hdr); err != nil { + return err + } + // Write file body + if _, err := tw.Write([]byte(data)); err != nil { + return err + } + } + + if err = tw.Close(); err != nil { + return err + } + // Close gzip writer; finish writing gzip data to buffer + if err = gzw.Close(); err != nil { + return err + } + // Flush buffered data to file + if err = wr.Flush(); err != nil { + return err + } + // Close tar file + if err = archFile.Close(); err != nil { + return err + } + return nil +} + +func writeZip(archName, root, fileName, data string) error { + archFile, err := os.Create(archName) + if err != nil { + return err + } + defer archFile.Close() + wr := bufio.NewWriter(archFile) + + zw := zip.NewWriter(wr) + defer zw.Close() + + // Write file name + f, err := zw.Create(path.Join(root, fileName)) + if err != nil { + return err + } + // Write file data + _, err = f.Write([]byte(data)) + if err != nil { + return err + } + + // Close zip writer + if err = zw.Close(); err != nil { + return err + } + // Flush buffered data to file + if err = wr.Flush(); err != nil { + return err + } + // Close zip file + if err = archFile.Close(); err != nil { + return err + } + return nil +} From 0942e3be66b03406751e6d38bdac46b47a02b93d Mon Sep 17 00:00:00 2001 From: gammazero Date: Wed, 27 Jan 2021 21:50:36 -0800 Subject: [PATCH 009/161] rebase and resolve conflicts --- go.mod | 1 + go.sum | 3 +++ repo/fsrepo/migrations/fetch.go | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 190ed2675c0..4525aafa290 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,7 @@ require ( github.com/ipfs/go-filestore v0.0.3 github.com/ipfs/go-fs-lock v0.0.6 github.com/ipfs/go-graphsync v0.6.0 + github.com/ipfs/go-ipfs-api v0.2.0 github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 diff --git a/go.sum b/go.sum index 2a8ce4f4bdc..9dc230ba8dc 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,7 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= @@ -321,6 +322,8 @@ github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0 github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0= github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= +github.com/ipfs/go-ipfs-api v0.2.0 h1:BXRctUU8YOUOQT/jW1s56d9wLa85ntOqK6bptvCKb8c= +github.com/ipfs/go-ipfs-api v0.2.0/go.mod h1:zCTyTl+BuyvUqoSmVb8vjezCJLVTW7G/HBZbCXpTgeM= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index d52c2ef8937..1cfc904c999 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -21,7 +21,6 @@ const ( // Distribution gatewayURL = "https://ipfs.io" ipfsDist = "/ipns/dist.ipfs.io" - // ipfsDist = "/ipfs/QmYRLRDKobvg1AXTGeK5Xk6ntWTsjGiHbyNKhWfz7koGpa" // Maximum download size fetchSizeLimit = 1024 * 1024 * 512 From 9d1fdccdca84a13b0c7760bb90c0088973f5a63b Mon Sep 17 00:00:00 2001 From: gammazero Date: Mon, 1 Feb 2021 16:48:49 -0800 Subject: [PATCH 010/161] test with latest distribution --- repo/fsrepo/migrations/migrations.go | 2 +- repo/fsrepo/migrations/migrations_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 1a75962a504..794413e203d 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -184,7 +184,7 @@ func fetchMigrations(ctx context.Context, needed []string, destDir string) ([]st log.Printf("could not download %s: %s", name, err) return } - log.Printf("Downloaded and unpacked migration: %s", loc) + log.Printf("Downloaded and unpacked migration: %s (%s)", loc, ver) bins[i] = loc }(i, name) } diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 5136132dcde..d86ddbb930e 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -10,6 +10,8 @@ import ( "testing" ) +const testIPFSDistPath = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" + func TestFindMigrations(t *testing.T) { tmpDir, err := ioutil.TempDir("", "migratetest") if err != nil { @@ -116,7 +118,7 @@ func TestFetchMigrations(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - SetIpfsDistPath("/ipfs/QmXt92hFRuvQgFhgHoaMxC4wLFcvKsCywQPTNmPYCGfEV4") + SetIpfsDistPath(testIPFSDistPath) _, err := LatestDistVersion(ctx, "ipfs-1-to-2") if err != nil { if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) { From 531f37eb6e0c3b34e4a962254432b299766dab24 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 5 Feb 2021 11:24:54 +0000 Subject: [PATCH 011/161] chore(deps): bump github.com/ipfs/go-block-format from 0.0.2 to 0.0.3 Bumps [github.com/ipfs/go-block-format](https://github.com/ipfs/go-block-format) from 0.0.2 to 0.0.3. - [Release notes](https://github.com/ipfs/go-block-format/releases) - [Commits](https://github.com/ipfs/go-block-format/compare/v0.0.2...v0.0.3) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 25e25fcd3d5..e41ba0ad347 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/golang-lru v0.5.4 github.com/ipfs/go-bitswap v0.3.3 - github.com/ipfs/go-block-format v0.0.2 + github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-blockservice v0.1.4 github.com/ipfs/go-cid v0.0.7 github.com/ipfs/go-cidutil v0.0.2 diff --git a/go.sum b/go.sum index dcb0966c873..0db7e538944 100644 --- a/go.sum +++ b/go.sum @@ -268,6 +268,7 @@ github.com/ipfs/go-bitswap v0.3.3/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZG github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= +github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= github.com/ipfs/go-blockservice v0.1.1/go.mod h1:t+411r7psEUhLueM8C7aPA7cxCclv4O3VsUVxt9kz2I= From 17d533909b88a47af8dedb0aa29e4943f7d383e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 5 Feb 2021 14:26:08 +0000 Subject: [PATCH 012/161] all: gofmt -s This "simplify" flag mainly removes redundant types in expressions. Not particularly important, but a nice change that also makes gopls not show warnings. --- assets/bindata.go | 22 ++++++++++---------- core/commands/pin/pin.go | 4 ++-- core/commands/root.go | 2 +- namesys/dns.go | 2 +- namesys/dns_test.go | 44 ++++++++++++++++++++-------------------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/assets/bindata.go b/assets/bindata.go index 605b5945438..e80a04d5c99 100644 --- a/assets/bindata.go +++ b/assets/bindata.go @@ -370,18 +370,18 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "dir-index-html": &bintree{nil, map[string]*bintree{ - "dir-index.html": &bintree{dirIndexHtmlDirIndexHtml, map[string]*bintree{}}, - "knownIcons.txt": &bintree{dirIndexHtmlKnowniconsTxt, map[string]*bintree{}}, + "dir-index-html": {nil, map[string]*bintree{ + "dir-index.html": {dirIndexHtmlDirIndexHtml, map[string]*bintree{}}, + "knownIcons.txt": {dirIndexHtmlKnowniconsTxt, map[string]*bintree{}}, }}, - "init-doc": &bintree{nil, map[string]*bintree{ - "about": &bintree{initDocAbout, map[string]*bintree{}}, - "contact": &bintree{initDocContact, map[string]*bintree{}}, - "help": &bintree{initDocHelp, map[string]*bintree{}}, - "ping": &bintree{initDocPing, map[string]*bintree{}}, - "quick-start": &bintree{initDocQuickStart, map[string]*bintree{}}, - "readme": &bintree{initDocReadme, map[string]*bintree{}}, - "security-notes": &bintree{initDocSecurityNotes, map[string]*bintree{}}, + "init-doc": {nil, map[string]*bintree{ + "about": {initDocAbout, map[string]*bintree{}}, + "contact": {initDocContact, map[string]*bintree{}}, + "help": {initDocHelp, map[string]*bintree{}}, + "ping": {initDocPing, map[string]*bintree{}}, + "quick-start": {initDocQuickStart, map[string]*bintree{}}, + "readme": {initDocReadme, map[string]*bintree{}}, + "security-notes": {initDocSecurityNotes, map[string]*bintree{}}, }}, }} diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index a951bac950d..4be060ae926 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -682,7 +682,7 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts, enc ci if err := verifcid.ValidateCid(root); err != nil { status := PinStatus{Ok: false} if opts.explain { - status.BadNodes = []BadNode{BadNode{Cid: enc.Encode(key), Err: err.Error()}} + status.BadNodes = []BadNode{{Cid: enc.Encode(key), Err: err.Error()}} } visited[key] = status return status @@ -692,7 +692,7 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts, enc ci if err != nil { status := PinStatus{Ok: false} if opts.explain { - status.BadNodes = []BadNode{BadNode{Cid: enc.Encode(key), Err: err.Error()}} + status.BadNodes = []BadNode{{Cid: enc.Encode(key), Err: err.Error()}} } visited[key] = status return status diff --git a/core/commands/root.go b/core/commands/root.go index 1440c31b7eb..f367d06e2bd 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -166,7 +166,7 @@ var VersionROCmd = &cmds.Command{} var rootROSubcommands = map[string]*cmds.Command{ "commands": CommandsDaemonROCmd, "cat": CatCmd, - "block": &cmds.Command{ + "block": { Subcommands: map[string]*cmds.Command{ "stat": blockStatCmd, "get": blockGetCmd, diff --git a/namesys/dns.go b/namesys/dns.go index 0b48ad34bdb..738612f46b2 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -3,9 +3,9 @@ package namesys import ( "context" "errors" + "fmt" "net" "strings" - "fmt" path "github.com/ipfs/go-path" opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" diff --git a/namesys/dns_test.go b/namesys/dns_test.go index 653c3c7887f..5a0e2a7d2ff 100644 --- a/namesys/dns_test.go +++ b/namesys/dns_test.go @@ -61,72 +61,72 @@ func TestDnsEntryParsing(t *testing.T) { func newMockDNS() *mockDNS { return &mockDNS{ entries: map[string][]string{ - "multihash.example.com.": []string{ + "multihash.example.com.": { "dnslink=QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "ipfs.example.com.": []string{ + "ipfs.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "_dnslink.dipfs.example.com.": []string{ + "_dnslink.dipfs.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "dns1.example.com.": []string{ + "dns1.example.com.": { "dnslink=/ipns/ipfs.example.com", }, - "dns2.example.com.": []string{ + "dns2.example.com.": { "dnslink=/ipns/dns1.example.com", }, - "multi.example.com.": []string{ + "multi.example.com.": { "some stuff", "dnslink=/ipns/dns1.example.com", "masked dnslink=/ipns/example.invalid", }, - "equals.example.com.": []string{ + "equals.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/=equals", }, - "loop1.example.com.": []string{ + "loop1.example.com.": { "dnslink=/ipns/loop2.example.com", }, - "loop2.example.com.": []string{ + "loop2.example.com.": { "dnslink=/ipns/loop1.example.com", }, - "_dnslink.dloop1.example.com.": []string{ + "_dnslink.dloop1.example.com.": { "dnslink=/ipns/loop2.example.com", }, - "_dnslink.dloop2.example.com.": []string{ + "_dnslink.dloop2.example.com.": { "dnslink=/ipns/loop1.example.com", }, - "bad.example.com.": []string{ + "bad.example.com.": { "dnslink=", }, - "withsegment.example.com.": []string{ + "withsegment.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment", }, - "withrecsegment.example.com.": []string{ + "withrecsegment.example.com.": { "dnslink=/ipns/withsegment.example.com/subsub", }, - "withtrailing.example.com.": []string{ + "withtrailing.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/", }, - "withtrailingrec.example.com.": []string{ + "withtrailingrec.example.com.": { "dnslink=/ipns/withtrailing.example.com/segment/", }, - "double.example.com.": []string{ + "double.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "_dnslink.double.example.com.": []string{ + "_dnslink.double.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "double.conflict.com.": []string{ + "double.conflict.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "_dnslink.conflict.example.com.": []string{ + "_dnslink.conflict.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjE", }, - "fqdn.example.com.": []string{ + "fqdn.example.com.": { "dnslink=/ipfs/QmYvMB9yrsSf7RKBghkfwmHJkzJhW2ZgVwq3LxBXXPasFr", }, - "www.wealdtech.eth.link.": []string{ + "www.wealdtech.eth.link.": { "dnslink=/ipns/ipfs.example.com", }, }, From 5e0c8bbf28e830c8a81bc81eee3633c0a176c30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 6 Feb 2021 17:58:18 +0000 Subject: [PATCH 013/161] peering: add logs before many-second waits This test takes a full minute to run, and I was honestly thinking my run of "go test -v" had simply hung, as I saw no output and no apparent resource usage. The least we can do is print a few log messages before the potentially long waits, to hint that we're still making progress. Each of these "Eventually" and "Never" calls ends up blocking the test for a few seconds at a time. --- peering/peering_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/peering/peering_test.go b/peering/peering_test.go index 3bfdd9d946e..a6ce1332bde 100644 --- a/peering/peering_test.go +++ b/peering/peering_test.go @@ -57,11 +57,13 @@ func TestPeeringService(t *testing.T) { require.NoError(t, ps1.Start()) // We should eventually connect. + t.Logf("waiting for h1 to connect to h2") require.Eventually(t, func() bool { return h1.Network().Connectedness(h2.ID()) == network.Connected }, 30*time.Second, 10*time.Millisecond) - // Now explicitly connect to p3. + // Now explicitly connect to h3. + t.Logf("waiting for h1's connection to h3 to work") require.NoError(t, h1.Connect(ctx, peer.AddrInfo{ID: h3.ID(), Addrs: h3.Addrs()})) require.Eventually(t, func() bool { return h1.Network().Connectedness(h2.ID()) == network.Connected @@ -72,7 +74,8 @@ func TestPeeringService(t *testing.T) { // force a disconnect h1.ConnManager().TrimOpenConns(ctx) - // Should disconnect from p3. + // Should disconnect from h3. + t.Logf("waiting for h1's connection to h3 to disconnect") require.Eventually(t, func() bool { return h1.Network().Connectedness(h3.ID()) != network.Connected }, 5*time.Second, 10*time.Millisecond) @@ -88,6 +91,7 @@ func TestPeeringService(t *testing.T) { h2.ConnManager().TrimOpenConns(ctx) // All conns to peer should eventually close. + t.Logf("waiting for all connections to close") for _, c := range conns { require.Eventually(t, func() bool { s, err := c.NewStream(context.Background()) @@ -110,11 +114,13 @@ func TestPeeringService(t *testing.T) { h1.ConnManager().TrimOpenConns(ctx) // Should disconnect + t.Logf("waiting for h1 to disconnect from h2") require.Eventually(t, func() bool { return h1.Network().Connectedness(h2.ID()) != network.Connected }, 5*time.Second, 10*time.Millisecond) // Should never reconnect. + t.Logf("ensuring h1 is not connected to h2 again") require.Never(t, func() bool { return h1.Network().Connectedness(h2.ID()) == network.Connected }, 20*time.Second, 1*time.Second) @@ -122,6 +128,7 @@ func TestPeeringService(t *testing.T) { // Until added back ps1.AddPeer(peer.AddrInfo{ID: h2.ID(), Addrs: h2.Addrs()}) ps1.AddPeer(peer.AddrInfo{ID: h3.ID(), Addrs: h3.Addrs()}) + t.Logf("wait for h1 to connect to h2 and h3 again") require.Eventually(t, func() bool { return h1.Network().Connectedness(h2.ID()) == network.Connected }, 30*time.Second, 1*time.Second) From fed5f05134b70a9e51a4c13498dd2708111a4bc1 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 8 Feb 2021 12:41:35 -0800 Subject: [PATCH 014/161] build: simplify on gofmt --- assets/assets.go | 4 ++-- bin/test-go-fmt | 2 +- test/bin/verify-go-fmt.sh | 19 ------------------- 3 files changed, 3 insertions(+), 22 deletions(-) delete mode 100755 test/bin/verify-go-fmt.sh diff --git a/assets/assets.go b/assets/assets.go index 920488f4f2c..d203089f8b9 100644 --- a/assets/assets.go +++ b/assets/assets.go @@ -1,8 +1,8 @@ //go:generate git submodule update --init ./dir-index-html //go:generate go run github.com/go-bindata/go-bindata/v3/go-bindata -mode=0644 -modtime=1403768328 -pkg=assets init-doc dir-index-html/dir-index.html dir-index-html/knownIcons.txt -//go:generate gofmt -w bindata.go +//go:generate gofmt -sw bindata.go //go:generate sh -c "sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go" -//go:generate gofmt -w bindata_version_hash.go +//go:generate gofmt -sw bindata_version_hash.go package assets import ( diff --git a/bin/test-go-fmt b/bin/test-go-fmt index a9e6d5a7331..8bd1f07bf2e 100755 --- a/bin/test-go-fmt +++ b/bin/test-go-fmt @@ -4,7 +4,7 @@ T="$(mktemp)" find . \ -path ./test/sharness -prune \ -o -path ./plugin/loader/preload.go -prune \ - -o -name '*.go' -print0 | xargs -0 gofmt -l > "$T" + -o -name '*.go' -print0 | xargs -0 gofmt -sl > "$T" if [ -n "$(cat $T)" ]; then echo "Following Go code is not formatted." diff --git a/test/bin/verify-go-fmt.sh b/test/bin/verify-go-fmt.sh deleted file mode 100755 index fedcf511a8d..00000000000 --- a/test/bin/verify-go-fmt.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -#TODO add go lint and go vet - -verify_gofmt() { - GOFMT="gofmt -s" - cd "$(git rev-parse --show-toplevel)" - bad_files=$($GOFMT -l .) - cd - - if [[ -n $bad_files ]]; then - echo "You have to run '$GOFMT' on these files:" - echo "$bad_files" - false - else - true - fi -} - -verify_gofmt From 82e6674099a33359279a96953ac614d6671493a2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 8 Feb 2021 12:49:51 -0800 Subject: [PATCH 015/161] fix: go doesn't allow gnu short flags --- assets/assets.go | 4 ++-- bin/test-go-fmt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/assets.go b/assets/assets.go index d203089f8b9..e8893c63501 100644 --- a/assets/assets.go +++ b/assets/assets.go @@ -1,8 +1,8 @@ //go:generate git submodule update --init ./dir-index-html //go:generate go run github.com/go-bindata/go-bindata/v3/go-bindata -mode=0644 -modtime=1403768328 -pkg=assets init-doc dir-index-html/dir-index.html dir-index-html/knownIcons.txt -//go:generate gofmt -sw bindata.go +//go:generate gofmt -s -w bindata.go //go:generate sh -c "sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go" -//go:generate gofmt -sw bindata_version_hash.go +//go:generate gofmt -s -w bindata_version_hash.go package assets import ( diff --git a/bin/test-go-fmt b/bin/test-go-fmt index 8bd1f07bf2e..3f69d83895a 100755 --- a/bin/test-go-fmt +++ b/bin/test-go-fmt @@ -4,7 +4,7 @@ T="$(mktemp)" find . \ -path ./test/sharness -prune \ -o -path ./plugin/loader/preload.go -prune \ - -o -name '*.go' -print0 | xargs -0 gofmt -sl > "$T" + -o -name '*.go' -print0 | xargs -0 gofmt -s -l > "$T" if [ -n "$(cat $T)" ]; then echo "Following Go code is not formatted." From 28fec951663e39fdc5898ab5ff994f6d7be8dfe5 Mon Sep 17 00:00:00 2001 From: Naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Mon, 8 Feb 2021 16:44:11 -0500 Subject: [PATCH 016/161] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000000..1c5b404f1e2 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,40 @@ +# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '30 12 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'go', 'python' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 515381da1286b967c2e1566a93f7c51b0699ebe2 Mon Sep 17 00:00:00 2001 From: gammazero Date: Fri, 12 Feb 2021 14:13:36 -0800 Subject: [PATCH 017/161] minor code improvememts --- repo/fsrepo/migrations/ipfsdir.go | 15 +++++---------- repo/fsrepo/migrations/migrations.go | 4 ++-- repo/fsrepo/migrations/versions.go | 5 ++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index 7d374d316fd..bcc3853b175 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -16,6 +16,7 @@ import ( const ( envIpfsPath = "IPFS_PATH" + defIpfsDir = ".ipfs" versionFile = "version" // Local IPFS API @@ -74,6 +75,9 @@ func ApiShell(ipfsDir string) (*api.Shell, string, error) { // location in the home directory. func IpfsDir(dir string) (string, error) { var err error + if dir == "" { + dir = os.Getenv(envIpfsPath) + } if dir != "" { dir, err = homedir.Expand(dir) if err != nil { @@ -82,15 +86,6 @@ func IpfsDir(dir string) (string, error) { return dir, nil } - ipfspath := os.Getenv(envIpfsPath) - if ipfspath != "" { - dir, err := homedir.Expand(ipfspath) - if err != nil { - return "", err - } - return dir, nil - } - home, err := homedir.Dir() if err != nil { return "", err @@ -99,7 +94,7 @@ func IpfsDir(dir string) (string, error) { return "", errors.New("could not determine IPFS_PATH, home dir not set") } - return path.Join(home, ".ipfs"), nil + return path.Join(home, defIpfsDir), nil } // CheckIpfsDir gets the ipfs directory and checks that the directory exists. diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 794413e203d..2fd7c7ecae4 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -106,7 +106,7 @@ func migrationName(from, to int) string { } // findMigrations returns a list of migrations, ordered from first to last -// migration to apply, and a map of locations migration binaries of any +// migration to apply, and a map of locations of migration binaries of any // migrations that were found. func findMigrations(ctx context.Context, from, to int) ([]string, map[string]string, error) { step := 1 @@ -155,7 +155,7 @@ func runMigration(ctx context.Context, binPath, ipfsDir string, revert bool) err } // fetchMigrations downloads the requested migrations, and returns a slice with -// the paths of each binary, in the same order as in needed. +// the paths of each binary, in the same order specified by needed. func fetchMigrations(ctx context.Context, needed []string, destDir string) ([]string, error) { osv, err := osWithVariant() if err != nil { diff --git a/repo/fsrepo/migrations/versions.go b/repo/fsrepo/migrations/versions.go index 7e58381d357..fd45f21804a 100644 --- a/repo/fsrepo/migrations/versions.go +++ b/repo/fsrepo/migrations/versions.go @@ -54,9 +54,8 @@ func DistVersions(ctx context.Context, dist string, sortDesc bool) ([]string, er } vers = append(vers, ver) } - err = scan.Err() - if err != nil { - return nil, fmt.Errorf("could not read versions: %s", err) + if scan.Err() != nil { + return nil, fmt.Errorf("could not read versions: %s", scan.Err()) } if sortDesc { From d1c4c90280573081fd51aa7be3f31e8896150b4b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 16 Feb 2021 13:28:41 -0800 Subject: [PATCH 018/161] ci: remove python from codeql --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1c5b404f1e2..90bdd75b7bc 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'go', 'python' ] + language: [ 'go' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed From 770f612346a485fe5d5993445d52356e1712a2e3 Mon Sep 17 00:00:00 2001 From: gammazero Date: Tue, 16 Feb 2021 14:41:03 -0800 Subject: [PATCH 019/161] Fix build issue with go1.16 --- go.sum | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/go.sum b/go.sum index 0db7e538944..72a4c78659c 100644 --- a/go.sum +++ b/go.sum @@ -167,7 +167,6 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -266,8 +265,8 @@ github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMi github.com/ipfs/go-bitswap v0.3.3 h1:CrTO3OiOYFBcdliw074/C7T2QYHEOsPClgvR6RIYcO4= github.com/ipfs/go-bitswap v0.3.3/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= -github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= +github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= @@ -458,7 +457,6 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -620,7 +618,6 @@ github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6n github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= -github.com/libp2p/go-libp2p-pubsub v0.4.0 h1:YNVRyXqBgv9i4RG88jzoTtkSOaSB45CqHkL29NNBZb4= github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDFhWj+8yy8= github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= @@ -991,7 +988,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -1157,7 +1153,6 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1177,7 +1172,6 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1224,7 +1218,6 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1274,13 +1267,11 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3 h1:r3P/5xOq/dK1991B65Oy6E1fRF/2d/fSYZJ/fXGVfJc= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e22413ab927bfb6252b5bf1a9b84c23c54ad8aaa Mon Sep 17 00:00:00 2001 From: gammazero Date: Wed, 17 Feb 2021 19:12:09 -0800 Subject: [PATCH 020/161] go-ipfs fetches migrations using specific IPFS path --- cmd/ipfs/daemon.go | 2 ++ repo/fsrepo/migrations/fetch.go | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 698b6c8c4e0..92374dfd865 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -288,6 +288,8 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment return fmt.Errorf("fs-repo requires migration") } + // Fetch migrations using the current distribution + migrations.SetIpfsDistPath(migrations.CurrentIpfsDist) err = migrations.RunMigration(cctx.Context(), fsrepo.RepoVersion, "") if err != nil { fmt.Println("The migrations of fs-repo failed:") diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 1cfc904c999..0814bd0c6ee 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -16,6 +16,9 @@ import ( ) const ( + // Current dirstibution to fetch migrations from + CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" + envIpfsDistPath = "IPFS_DIST_PATH" // Distribution @@ -39,7 +42,7 @@ func init() { // SetIpfsDistPath sets the ipfs path to the distribution site. If an empty // string is given, then the path is set using the IPFS_DIST_PATH environ -// veriable, or the default value if that is not defined. +// veriable, or the default dns link value if that is not defined. func SetIpfsDistPath(distPath string) { if distPath != "" { ipfsDistPath = distPath From c338ed83c7a8e7b9e4e679837a6771f8611abb15 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 15 Feb 2021 19:47:41 +0100 Subject: [PATCH 021/161] docs: Pinning.RemoteServices.Policies --- docs/config.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index d2806a8a7d0..5d700051ceb 100644 --- a/docs/config.md +++ b/docs/config.md @@ -181,6 +181,8 @@ does (e.g, `"1d2h4m40.01s"`). - [`Pinning.RemoteServices.API`](#pinningremoteservices-api) - [`Pinning.RemoteServices.API.Endpoint`](#pinningremoteservices-apiendpoint) - [`Pinning.RemoteServices.API.Key`](#pinningremoteservices-apikey) + - [`Pinning.RemoteServices.Policies`](#pinningremoteservices-policies) + - [`Pinning.RemoteServices.Policies.MFS`](#pinningremoteservices-policiesmfs) - [`Pubsub`](#pubsub) - [`Pubsub.Router`](#pubsubrouter) - [`Pubsub.DisableSigning`](#pubsubdisablesigning) @@ -847,7 +849,7 @@ Example: "API" : { "Endpoint" : "https://pinningservice.tld:1234/my/api/path", "Key" : "someOpaqueKey" - } + } } } } @@ -868,6 +870,44 @@ The key through which access to the pinning service is granted Type: `string` +#### `Pinning.RemoteServices: Policies` + +Contains additional opt-in policies for the remote pinning service + +##### `Pinning.RemoteServices: Policies.MFS` + +When this policy is enabled it will be following changes to MFS +and updating the pin for MFS root on the configured remote service. + +Pin request to the remote service is sent only when MFS root changed +and time passed since the previous pin is bigger than `RepinInterval`. + +###### `Pinning.RemoteServices: Policies.MFS.Enabled` + +Controls if this policy is active. + +Default: `false` + +Type: `bool` + +###### `Pinning.RemoteServices: Policies.MFS.PinName` + +Optional name to use for remote pin that represents MFS root CID. +When left empty, default name will be generated. + +Default: `"policy/12.../mfs"` + +Type: `string` + +###### `Pinning.RemoteServices: Policies.MFS.RepinInterval` + +Defines how often (at most) the pin request should be sent to remote service. +When left empty, default interval will be used. Values lower than `1m` will be ignored. + +Default: `"5m"` + +Type: `duration` + ## `Pubsub` Pubsub configures the `ipfs pubsub` subsystem. To use, it must be enabled by From af96ded9734b728d1bee21bcfb7e7f40deebe4c0 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 15 Feb 2021 20:03:44 +0100 Subject: [PATCH 022/161] style: improved MFS PinName example Co-authored-by: Adin Schmahmann --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index 5d700051ceb..c68355cc409 100644 --- a/docs/config.md +++ b/docs/config.md @@ -895,7 +895,7 @@ Type: `bool` Optional name to use for remote pin that represents MFS root CID. When left empty, default name will be generated. -Default: `"policy/12.../mfs"` +Default: `"policy/{PeerID}/mfs"`, e.g. `"policy/12.../mfs"` Type: `string` From aaa64baaed2a032036242768c4088647cfb59d20 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 15 Feb 2021 21:28:14 +0100 Subject: [PATCH 023/161] style: docs/config.md Co-authored-by: Jessica Schilling --- docs/config.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/config.md b/docs/config.md index c68355cc409..e4077726891 100644 --- a/docs/config.md +++ b/docs/config.md @@ -872,15 +872,15 @@ Type: `string` #### `Pinning.RemoteServices: Policies` -Contains additional opt-in policies for the remote pinning service +Contains additional opt-in policies for the remote pinning service. ##### `Pinning.RemoteServices: Policies.MFS` -When this policy is enabled it will be following changes to MFS -and updating the pin for MFS root on the configured remote service. +When this policy is enabled, it follows changes to MFS +and updates the pin for MFS root on the configured remote service. -Pin request to the remote service is sent only when MFS root changed -and time passed since the previous pin is bigger than `RepinInterval`. +A pin request to the remote service is sent only when MFS root has changed +and time has passed, since the previous pin is bigger than `RepinInterval`. ###### `Pinning.RemoteServices: Policies.MFS.Enabled` @@ -892,8 +892,8 @@ Type: `bool` ###### `Pinning.RemoteServices: Policies.MFS.PinName` -Optional name to use for remote pin that represents MFS root CID. -When left empty, default name will be generated. +Optional name to use for a remote pin that represents the MFS root CID. +When left empty, a default name will be generated. Default: `"policy/{PeerID}/mfs"`, e.g. `"policy/12.../mfs"` @@ -901,8 +901,8 @@ Type: `string` ###### `Pinning.RemoteServices: Policies.MFS.RepinInterval` -Defines how often (at most) the pin request should be sent to remote service. -When left empty, default interval will be used. Values lower than `1m` will be ignored. +Defines how often (at most) the pin request should be sent to the remote service. +If left empty, the default interval will be used. Values lower than `1m` will be ignored. Default: `"5m"` From 04838257f8cfee9ca783c5f0f4d0c795e941c818 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 15 Feb 2021 21:52:32 +0100 Subject: [PATCH 024/161] docs: RepinInterval --- docs/config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config.md b/docs/config.md index e4077726891..bf244ecf2dd 100644 --- a/docs/config.md +++ b/docs/config.md @@ -879,8 +879,8 @@ Contains additional opt-in policies for the remote pinning service. When this policy is enabled, it follows changes to MFS and updates the pin for MFS root on the configured remote service. -A pin request to the remote service is sent only when MFS root has changed -and time has passed, since the previous pin is bigger than `RepinInterval`. +A pin request to the remote service is sent only when MFS root CID has changed +and enough time has passed since the previous request (determined by `RepinInterval`). ###### `Pinning.RemoteServices: Policies.MFS.Enabled` From 66e0f8a1d9e811596e66062198637007b5bded99 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Thu, 18 Feb 2021 20:28:54 -0800 Subject: [PATCH 025/161] build(Makefile): set supported platforms by go-version Set supported platforms correctly by go version (no darwin-386 for >=1.15, no darwin-arm64 unless >=1.16), make check-go-version work on mac License: MIT Signed-off-by: hannahhoward --- bin/check_version | 8 ++++---- mk/util.mk | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/check_version b/bin/check_version index 6309238db81..25007002c3b 100755 --- a/bin/check_version +++ b/bin/check_version @@ -34,27 +34,27 @@ check_at_least_version() { # We expect a version to be of form X.X.X # if the second dot doesn't match, we consider it a prerelease - if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9]\+\)"); then + if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then # this captured digit is necessary, since expr returns code 1 if the output is empty if expr "$MIN_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then MIN_PRERELEASE="0" else MIN_PRERELEASE="1" fi - MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || MIN_FIX="0" + MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || MIN_FIX="0" else MIN_MIN="0" MIN_PRERELEASE="0" MIN_FIX="0" fi - if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9]\+\)"); then + if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then # this captured digit is necessary, since expr returns code 1 if the output is empty if expr "$CUR_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then CUR_PRERELEASE="0" else CUR_PRERELEASE="1" fi - CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || CUR_FIX="0" + CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || CUR_FIX="0" else CUR_MIN="0" CUR_PRERELEASE="0" diff --git a/mk/util.mk b/mk/util.mk index 48e5fa72ae3..a84e4e943c1 100644 --- a/mk/util.mk +++ b/mk/util.mk @@ -17,9 +17,13 @@ SUPPORTED_PLATFORMS += linux-arm64 SUPPORTED_PLATFORMS += linux-386 SUPPORTED_PLATFORMS += linux-amd64 -SUPPORTED_PLATFORMS += darwin-386 SUPPORTED_PLATFORMS += darwin-amd64 - +ifeq ($(shell bin/check_go_version "1.15.0" 2>/dev/null; echo $$?),1) +SUPPORTED_PLATFORMS += darwin-386 +endif +ifeq ($(shell bin/check_go_version "1.16.0" 2>/dev/null; echo $$?),0) +SUPPORTED_PLATFORMS += darwin-arm64 +endif SUPPORTED_PLATFORMS += freebsd-386 SUPPORTED_PLATFORMS += freebsd-amd64 From 15e3732afd29b380f6a12b06303dce49abe46f82 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 20 Feb 2021 00:09:17 +0100 Subject: [PATCH 026/161] =?UTF-8?q?feat(gw):=20/ipfs/ipfs/{cid}=20?= =?UTF-8?q?=E2=86=92=20/ipfs/{cid}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will try to recover from invalid paths like /ipfs/ipfs/{cid} and redirect to proper one, when possible. --- core/corehttp/gateway_handler.go | 11 +++++++++++ test/sharness/t0110-gateway.sh | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index e4719817418..cf5acf209de 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -217,6 +217,17 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request parsedPath := ipath.New(urlPath) if err := parsedPath.IsValid(); err != nil { + // Attempt to fix redundant /ipfs/ namespace as long resulting + // 'intended' path is valid. This is in case gremlins were tickled + // wrong way and user ended up at /ipfs/ipfs/{cid} or /ipfs/ipns/{id} + // like in bafybeien3m7mdn6imm425vc2s22erzyhbvk5n3ofzgikkhmdkh5cuqbpbq + // :^)) + intendedPath := ipath.New(strings.TrimPrefix(urlPath, "/ipfs")) + if err2 := intendedPath.IsValid(); err2 == nil { + intendedURL := strings.Replace(r.URL.String(), urlPath, intendedPath.String(), 1) + http.Redirect(w, r, intendedURL, http.StatusMovedPermanently) + return + } webError(w, "invalid ipfs path", err, http.StatusBadRequest) return } diff --git a/test/sharness/t0110-gateway.sh b/test/sharness/t0110-gateway.sh index cb0b0cd6743..45feca45e9b 100755 --- a/test/sharness/t0110-gateway.sh +++ b/test/sharness/t0110-gateway.sh @@ -84,6 +84,11 @@ test_expect_success "GET IPFS nonexistent file returns code expected (404)" ' test_curl_resp_http_code "http://127.0.0.1:$port/ipfs/$HASH2/pleaseDontAddMe" "HTTP/1.1 404 Not Found" ' +test_expect_success "GET /ipfs/ipfs/{cid} returns redirect to the valid path" " + curl -sI -o response_with_double_ipfs_ns \"http://127.0.0.1:$port/ipfs/ipfs/bafkqaaa?query=to-remember\" && + test_should_contain \"Location: /ipfs/bafkqaaa?query=to-remember\" response_with_double_ipfs_ns +" + test_expect_failure "GET IPNS path succeeds" ' ipfs name publish --allow-offline "$HASH" && PEERID=$(ipfs config Identity.PeerID) && @@ -95,6 +100,12 @@ test_expect_failure "GET IPNS path output looks good" ' test_cmp expected actual ' +test_expect_success "GET /ipfs/ipns/{peerid} returns redirect to the valid path" ' + PEERID=$(ipfs config Identity.PeerID) && + curl -sI -o response_with_ipfs_ipns_ns "http://127.0.0.1:$port/ipfs/ipns/${PEERID}?query=to-remember" && + test_should_contain "Location: /ipns/${PEERID}?query=to-remember" response_with_ipfs_ipns_ns +' + test_expect_success "GET invalid IPFS path errors" ' test_must_fail curl -sf "http://127.0.0.1:$port/ipfs/12345" ' From ced35805812b74d2ed68f27e65732461e2b8c6be Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 20 Feb 2021 11:46:08 +0100 Subject: [PATCH 027/161] docs: fix DNSLink gw recipe Unfortunate typo due to additional negation. --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index bf244ecf2dd..280a4395fdc 100644 --- a/docs/config.md +++ b/docs/config.md @@ -730,7 +730,7 @@ Below is a list of the most common public gateway setups. * Public [DNSLink](https://dnslink.io/) gateway resolving every hostname passed in `Host` header. ```console - $ ipfs config --json Gateway.NoDNSLink true + $ ipfs config --json Gateway.NoDNSLink false ``` * Note that `NoDNSLink: false` is the default (it works out of the box unless set to `true` manually) From cb7b147e5aef39cbdfa3fddb605d3f805d44b989 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 23 Feb 2021 17:08:49 +0100 Subject: [PATCH 028/161] docs: tips on debugging Policies.MFS (#7929) * docs: tips on debugging Policies.MFS Co-authored-by: Adin Schmahmann --- docs/config.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/config.md b/docs/config.md index 280a4395fdc..61c9aad7c83 100644 --- a/docs/config.md +++ b/docs/config.md @@ -882,6 +882,8 @@ and updates the pin for MFS root on the configured remote service. A pin request to the remote service is sent only when MFS root CID has changed and enough time has passed since the previous request (determined by `RepinInterval`). +One can observe MFS pinning details by enabling debug via `ipfs log level remotepinning/mfs debug` and switching back to `error` when done. + ###### `Pinning.RemoteServices: Policies.MFS.Enabled` Controls if this policy is active. From 83d94d26d96ad5b4a82492fae4cd5aba6eba94fa Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 25 Feb 2021 15:56:18 -0500 Subject: [PATCH 029/161] fix: correctly return pin ls errors --- core/commands/pin/pin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index 4be060ae926..409b75cc00d 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -500,7 +500,7 @@ func pinLsAll(req *cmds.Request, typeStr string, api coreiface.CoreAPI, emit fun } for p := range pins { - if p.Err() != nil { + if err := p.Err(); err != nil { return err } err = emit(&PinLsOutputWrapper{ From ccc2d237306c8f22630809292f1960eb87f242d1 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Feb 2021 13:17:43 -0800 Subject: [PATCH 030/161] feat: remove secio support We've had a reliable and enabled by default TLS implementation since 0.4.23 (over a year ago) and turned off SECIO in September of last year. We might as well remove support entirely in the next release and encourage users to upgrade their networks. Noise is faster, anyways. --- cmd/seccat/.gitignore | 1 - cmd/seccat/seccat.go | 255 ----------------------------- cmd/seccat/seccat_plan9.go | 8 - cmd/seccat/seccat_posix.go | 10 -- cmd/seccat/util.go | 47 ------ core/node/libp2p/sec.go | 14 +- docs/config.md | 12 +- docs/experimental-features.md | 24 +-- go.mod | 1 - go.sum | 1 - test/sharness/t0061-daemon-opts.sh | 1 - test/sharness/t0125-twonode.sh | 3 +- test/sharness/t0191-noise.sh | 1 - 13 files changed, 14 insertions(+), 364 deletions(-) delete mode 100644 cmd/seccat/.gitignore delete mode 100644 cmd/seccat/seccat.go delete mode 100644 cmd/seccat/seccat_plan9.go delete mode 100644 cmd/seccat/seccat_posix.go delete mode 100644 cmd/seccat/util.go diff --git a/cmd/seccat/.gitignore b/cmd/seccat/.gitignore deleted file mode 100644 index 5b0d9d0490f..00000000000 --- a/cmd/seccat/.gitignore +++ /dev/null @@ -1 +0,0 @@ -seccat diff --git a/cmd/seccat/seccat.go b/cmd/seccat/seccat.go deleted file mode 100644 index 21724b4c51d..00000000000 --- a/cmd/seccat/seccat.go +++ /dev/null @@ -1,255 +0,0 @@ -// package main provides an implementation of netcat using the secio package. -// This means the channel is encrypted (and MACed). -// It is meant to exercise the spipe package. -// Usage: -// seccat [] -// seccat -l -// -// Address format is: [host]:port -package main - -import ( - "context" - "flag" - "fmt" - "io" - "net" - "os" - "os/signal" - "syscall" - - logging "github.com/ipfs/go-log" - ci "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" - secio "github.com/libp2p/go-libp2p-secio" -) - -var verbose = false - -// Usage prints out the usage of this module. -// Assumes flags use go stdlib flag package. -var Usage = func() { - text := `seccat - secure netcat in Go - -Usage: - - listen: %s [] - dial: %s -l - -Address format is Go's: [host]:port -` - - fmt.Fprintf(os.Stderr, text, os.Args[0], os.Args[0]) - flag.PrintDefaults() -} - -type args struct { - listen bool - verbose bool - debug bool - localAddr string - remoteAddr string - // keyfile string - keybits int -} - -func parseArgs() args { - var a args - - // setup + parse flags - flag.BoolVar(&a.listen, "listen", false, "listen for connections") - flag.BoolVar(&a.listen, "l", false, "listen for connections (short)") - flag.BoolVar(&a.verbose, "v", true, "verbose") - flag.BoolVar(&a.debug, "debug", false, "debugging") - // flag.StringVar(&a.keyfile, "key", "", "private key file") - flag.IntVar(&a.keybits, "keybits", 2048, "num bits for generating private key") - flag.Usage = Usage - flag.Parse() - osArgs := flag.Args() - - if len(osArgs) < 1 { - exit("") - } - - if a.verbose { - out("verbose on") - } - - if a.listen { - a.localAddr = osArgs[0] - } else { - if len(osArgs) > 1 { - a.localAddr = osArgs[0] - a.remoteAddr = osArgs[1] - } else { - a.remoteAddr = osArgs[0] - } - } - - return a -} - -func main() { - args := parseArgs() - verbose = args.verbose - if args.debug { - logging.SetDebugLogging() - } - - go func() { - // wait until we exit. - sigc := make(chan os.Signal, 1) - signal.Notify(sigc, syscall.SIGABRT) - <-sigc - panic("ABORT! ABORT! ABORT!") - }() - - if err := connect(args); err != nil { - exit("%s", err) - } -} - -func setupPeer(a args) (peer.ID, pstore.Peerstore, error) { - if a.keybits < ci.MinRsaKeyBits { - return "", nil, ci.ErrRsaKeyTooSmall - } - - out("generating key pair...") - sk, pk, err := ci.GenerateKeyPair(ci.RSA, a.keybits) - if err != nil { - return "", nil, err - } - - p, err := peer.IDFromPublicKey(pk) - if err != nil { - return "", nil, err - } - - ps := pstoremem.NewPeerstore() - err = ps.AddPrivKey(p, sk) - if err != nil { - return "", nil, err - } - err = ps.AddPubKey(p, pk) - if err != nil { - return "", nil, err - } - - out("local peer id: %s", p) - return p, ps, nil -} - -func connect(args args) error { - p, ps, err := setupPeer(args) - if err != nil { - return err - } - - var conn net.Conn - if args.listen { - conn, err = Listen(args.localAddr) - } else { - conn, err = Dial(args.localAddr, args.remoteAddr) - } - if err != nil { - return err - } - - // log everything that goes through conn - rwc := &logConn{n: "conn", Conn: conn} - - // OK, let's setup the channel. - sk := ps.PrivKey(p) - sg, err := secio.New(sk) - if err != nil { - return err - } - sconn, err := sg.SecureInbound(context.TODO(), rwc) - if err != nil { - return err - } - out("remote peer id: %s", sconn.RemotePeer()) - netcat(sconn) - return nil -} - -// Listen listens and accepts one incoming UDT connection on a given port, -// and pipes all incoming data to os.Stdout. -func Listen(localAddr string) (net.Conn, error) { - l, err := net.Listen("tcp", localAddr) - if err != nil { - return nil, err - } - out("listening at %s", l.Addr()) - - c, err := l.Accept() - if err != nil { - return nil, err - } - out("accepted connection from %s", c.RemoteAddr()) - - // done with listener - l.Close() - - return c, nil -} - -// Dial connects to a remote address and pipes all os.Stdin to the remote end. -// If localAddr is set, uses it to Dial from. -func Dial(localAddr, remoteAddr string) (net.Conn, error) { - - var laddr net.Addr - var err error - if localAddr != "" { - laddr, err = net.ResolveTCPAddr("tcp", localAddr) - if err != nil { - return nil, fmt.Errorf("failed to resolve address %s", localAddr) - } - } - - if laddr != nil { - out("dialing %s from %s", remoteAddr, laddr) - } else { - out("dialing %s", remoteAddr) - } - - d := net.Dialer{LocalAddr: laddr} - c, err := d.Dial("tcp", remoteAddr) - if err != nil { - return nil, err - } - out("connected to %s", c.RemoteAddr()) - - return c, nil -} - -func netcat(c io.ReadWriteCloser) { - out("piping stdio to connection") - - done := make(chan struct{}, 2) - - go func() { - n, _ := io.Copy(c, os.Stdin) - out("sent %d bytes", n) - done <- struct{}{} - }() - go func() { - n, _ := io.Copy(os.Stdout, c) - out("received %d bytes", n) - done <- struct{}{} - }() - - // wait until we exit. - sigc := make(chan os.Signal, 1) - signal.Notify(sigc, notifySignals...) - - select { - case <-done: - case <-sigc: - return - } - - c.Close() -} diff --git a/cmd/seccat/seccat_plan9.go b/cmd/seccat/seccat_plan9.go deleted file mode 100644 index 3139500c5b3..00000000000 --- a/cmd/seccat/seccat_plan9.go +++ /dev/null @@ -1,8 +0,0 @@ -package main - -import ( - "os" - "syscall" -) - -var notifySignals = []os.Signal{syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM} diff --git a/cmd/seccat/seccat_posix.go b/cmd/seccat/seccat_posix.go deleted file mode 100644 index 92906db6250..00000000000 --- a/cmd/seccat/seccat_posix.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build !plan9 - -package main - -import ( - "os" - "syscall" -) - -var notifySignals = []os.Signal{syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT} diff --git a/cmd/seccat/util.go b/cmd/seccat/util.go deleted file mode 100644 index 05140e3254d..00000000000 --- a/cmd/seccat/util.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import ( - "fmt" - "net" - "os" - - logging "github.com/ipfs/go-log" -) - -var log = logging.Logger("seccat") - -func exit(format string, vals ...interface{}) { - if format != "" { - fmt.Fprintf(os.Stderr, "seccat: error: "+format+"\n", vals...) - } - Usage() - os.Exit(1) -} - -func out(format string, vals ...interface{}) { - if verbose { - fmt.Fprintf(os.Stderr, "seccat: "+format+"\n", vals...) - } -} - -type logConn struct { - net.Conn - n string -} - -func (r *logConn) Read(buf []byte) (int, error) { - n, err := r.Conn.Read(buf) - if n > 0 { - log.Debugf("%s read: %v", r.n, buf) - } - return n, err -} - -func (r *logConn) Write(buf []byte) (int, error) { - log.Debugf("%s write: %v", r.n, buf) - return r.Conn.Write(buf) -} - -func (r *logConn) Close() error { - return r.Conn.Close() -} diff --git a/core/node/libp2p/sec.go b/core/node/libp2p/sec.go index 8d6fde0008a..65b440ec4a4 100644 --- a/core/node/libp2p/sec.go +++ b/core/node/libp2p/sec.go @@ -4,10 +4,14 @@ import ( config "github.com/ipfs/go-ipfs-config" "github.com/libp2p/go-libp2p" noise "github.com/libp2p/go-libp2p-noise" - secio "github.com/libp2p/go-libp2p-secio" tls "github.com/libp2p/go-libp2p-tls" ) +const secioEnabledWarning = `The SECIO security transport was enabled in the config but is no longer supported. + +SECIO disabled by default in go-ipfs 0.7 removed in go-ipfs 0.9. Please remove +Swarm.Transports.Security.SECIO from your IPFS config.` + func Security(enabled bool, tptConfig config.Transports) interface{} { if !enabled { return func() (opts Libp2pOpts) { @@ -18,16 +22,16 @@ func Security(enabled bool, tptConfig config.Transports) interface{} { } } + if _, enabled := tptConfig.Security.SECIO.WithDefault(config.Disabled); enabled { + log.Error(secioEnabledWarning) + } + // Using the new config options. return func() (opts Libp2pOpts) { opts.Opts = append(opts.Opts, prioritizeOptions([]priorityOption{{ priority: tptConfig.Security.TLS, defaultPriority: 100, opt: libp2p.Security(tls.ID, tls.New), - }, { - priority: tptConfig.Security.SECIO, - defaultPriority: config.Disabled, - opt: libp2p.Security(secio.ID, secio.New), }, { priority: tptConfig.Security.Noise, defaultPriority: 300, diff --git a/docs/config.md b/docs/config.md index 61c9aad7c83..3f70795bccb 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1352,8 +1352,7 @@ receiver supports. When establishing an _inbound_ connection, go-ipfs will let the initiator choose the protocol, but will refuse to use any of the disabled transports. -Supported transports are: TLS (priority 100), SECIO (Disabled: i.e. priority false), Noise -(priority 300). +Supported transports are: TLS (priority 100) and Noise (priority 300). No default priority will ever be less than 100. @@ -1369,14 +1368,7 @@ Type: `priority` #### `Swarm.Transports.Security.SECIO` -[SECIO](https://github.com/libp2p/specs/tree/master/secio) was the most widely -supported IPFS & libp2p security transport. However, it is currently being -phased out in favor of more popular and better vetted protocols like TLS and -Noise. - -Default: `false` - -Type: `priority` +Support for SECIO has been removed. Please remove this option from your config. #### `Swarm.Transports.Security.Noise` diff --git a/docs/experimental-features.md b/docs/experimental-features.md index 725ccd46251..fd8cd331811 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -544,26 +544,6 @@ ipfs config --json Experimental.GraphsyncEnabled true ### State -Experimental, enabled by default +Stable, enabled by default -[Noise](https://github.com/libp2p/specs/tree/master/noise) libp2p transport based on the [Noise Protocol Framework](https://noiseprotocol.org/noise.html). While TLS remains the default transport in go-ipfs, Noise is easier to implement and will thus serve as the "interop" transport between IPFS and libp2p implementations, eventually replacing SECIO. - -### How to enable - -While the Noise transport is now shipped and enabled by default in go-ipfs, it won't be used by default for most connections because TLS and SECIO are currently preferred. If you'd like to test out the Noise transport, you can increase the priority of the noise transport: - -``` -ipfs config --json Swarm.Transports.Security.Noise 1 -``` - -Or even disable TLS and/or SECIO (not recommended for the moment): - -``` -ipfs config --json Swarm.Transports.Security.TLS false -ipfs config --json Swarm.Transports.Security.SECIO false -``` - -### Road to being a real feature - -- [ ] Needs real-world testing. -- [ ] Ideally a js-ipfs and a rust-ipfs release would include support for Noise. +[Noise](https://github.com/libp2p/specs/tree/master/noise) libp2p transport based on the [Noise Protocol Framework](https://noiseprotocol.org/noise.html). While TLS remains the default transport in go-ipfs, Noise is easier to implement and is thus the "interop" transport between IPFS and libp2p implementations. diff --git a/go.mod b/go.mod index b25330e4a10..4b704de6bfb 100644 --- a/go.mod +++ b/go.mod @@ -78,7 +78,6 @@ require ( github.com/libp2p/go-libp2p-quic-transport v0.10.0 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 - github.com/libp2p/go-libp2p-secio v0.2.2 github.com/libp2p/go-libp2p-swarm v0.4.0 github.com/libp2p/go-libp2p-testing v0.4.0 github.com/libp2p/go-libp2p-tls v0.1.3 diff --git a/go.sum b/go.sum index f4ac2a048ed..c06f71c139d 100644 --- a/go.sum +++ b/go.sum @@ -638,7 +638,6 @@ github.com/libp2p/go-libp2p-secio v0.0.3/go.mod h1:hS7HQ00MgLhRO/Wyu1bTX6ctJKhVp github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= -github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= github.com/libp2p/go-libp2p-swarm v0.0.6/go.mod h1:s5GZvzg9xXe8sbeESuFpjt8CJPTCa8mhEusweJqyFy8= github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= diff --git a/test/sharness/t0061-daemon-opts.sh b/test/sharness/t0061-daemon-opts.sh index 7d5cf7fe7b6..9d60852c845 100755 --- a/test/sharness/t0061-daemon-opts.sh +++ b/test/sharness/t0061-daemon-opts.sh @@ -19,7 +19,6 @@ apiaddr=$API_ADDR # Odd. this fails here, but the inverse works on t0060-daemon. test_expect_success SOCAT 'transport should be unencrypted ( needs socat )' ' socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-ls && - grep -q -v "/secio" swarmnc && grep -q "/plaintext" swarmnc || test_fsh cat swarmnc ' diff --git a/test/sharness/t0125-twonode.sh b/test/sharness/t0125-twonode.sh index d8fb45e44c3..28c919c22dd 100755 --- a/test/sharness/t0125-twonode.sh +++ b/test/sharness/t0125-twonode.sh @@ -119,8 +119,7 @@ test_expect_success "re-enable yamux" ' echo "Running advanced tests with NOISE" test_expect_success "use noise only" ' - iptb run -- ipfs config --json Swarm.Transports.Security.TLS false && - iptb run -- ipfs config --json Swarm.Transports.Security.Secio false + iptb run -- ipfs config --json Swarm.Transports.Security.TLS false ' run_advanced_test diff --git a/test/sharness/t0191-noise.sh b/test/sharness/t0191-noise.sh index bffec2d80c9..c68073d14a8 100755 --- a/test/sharness/t0191-noise.sh +++ b/test/sharness/t0191-noise.sh @@ -15,7 +15,6 @@ tcp_addr='"[\"/ip4/127.0.0.1/tcp/0\"]"' test_expect_success "configure security transports" ' iptb run < Date: Thu, 25 Feb 2021 14:12:39 -0800 Subject: [PATCH 031/161] ci: install netstat --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5374299a904..47db019fdd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,7 +129,7 @@ jobs: GOPATH: /home/circleci/go TEST_VERBOSE: 1 steps: - - run: sudo apt install socat + - run: sudo apt install socat net-tools - checkout - run: From 6a13d8614821d87f3a074ab7745559d69e93318f Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Feb 2021 14:12:56 -0800 Subject: [PATCH 032/161] test(sharness): correctly use test_must_fail --- test/sharness/t0165-keystore.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/sharness/t0165-keystore.sh b/test/sharness/t0165-keystore.sh index 0bbbe91aca5..b3ae12fefd7 100755 --- a/test/sharness/t0165-keystore.sh +++ b/test/sharness/t0165-keystore.sh @@ -175,12 +175,12 @@ ipfs key rm key_ed25519 test_cmp rsa_key_id roundtrip_rsa_key_id ' - test_must_fail "online export rsa key" ' - ipfs key export generated_rsa_key + test_expect_success "online export rsa key" ' + test_must_fail ipfs key export generated_rsa_key ' - test_must_fail "online rotate rsa key" ' - ipfs key rotate + test_expect_success "online rotate rsa key" ' + test_must_fail ipfs key rotate ' test_kill_ipfs_daemon From 88831814d012c65bfc7ed841e25c8bc5e94eb9fe Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Feb 2021 16:16:03 -0800 Subject: [PATCH 033/161] ci: update before install --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 47db019fdd8..8891a342da8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,6 +129,7 @@ jobs: GOPATH: /home/circleci/go TEST_VERBOSE: 1 steps: + - run: sudo apt update - run: sudo apt install socat net-tools - checkout From 01403e90e9678c5c1d6799471cd56a895ef8d765 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Feb 2021 12:28:38 -0800 Subject: [PATCH 034/161] chore: update deps Primarily, * update semver (go mod support) * update graphsync & go-ipld-prime * update golang.org/x packages. --- fuse/node/mount_darwin.go | 2 +- go.mod | 25 ++-- go.sum | 272 +++++++++++++++++++++++++++++++------- 3 files changed, 240 insertions(+), 59 deletions(-) diff --git a/fuse/node/mount_darwin.go b/fuse/node/mount_darwin.go index ea859756597..a27d64ccd0a 100644 --- a/fuse/node/mount_darwin.go +++ b/fuse/node/mount_darwin.go @@ -11,7 +11,7 @@ import ( core "github.com/ipfs/go-ipfs/core" - "github.com/blang/semver" + "github.com/blang/semver/v4" unix "golang.org/x/sys/unix" ) diff --git a/go.mod b/go.mod index 4b704de6bfb..9178cca5fe0 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/ipfs/go-ipfs require ( bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc contrib.go.opencensus.io/exporter/prometheus v0.2.0 - github.com/blang/semver v3.5.1+incompatible - github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d + github.com/blang/semver/v4 v4.0.0 + github.com/bren2010/proquint v0.0.0-20201027163346-95122a84635f github.com/cheggaaa/pb v1.0.29 github.com/coreos/go-systemd/v22 v22.1.0 github.com/dustin/go-humanize v1.0.0 @@ -28,7 +28,7 @@ require ( github.com/ipfs/go-ds-measure v0.1.0 github.com/ipfs/go-filestore v0.0.3 github.com/ipfs/go-fs-lock v0.0.6 - github.com/ipfs/go-graphsync v0.6.0 + github.com/ipfs/go-graphsync v0.7.0 github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 @@ -56,7 +56,7 @@ require ( github.com/ipfs/go-unixfs v0.2.4 github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 - github.com/ipld/go-car v0.1.1-0.20201015032735-ff6ccdc46acc + github.com/ipld/go-car v0.2.0 github.com/jbenet/go-is-domain v1.0.5 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 @@ -64,7 +64,7 @@ require ( github.com/libp2p/go-libp2p v0.13.0 github.com/libp2p/go-libp2p-circuit v0.4.0 github.com/libp2p/go-libp2p-connmgr v0.2.4 - github.com/libp2p/go-libp2p-core v0.8.0 + github.com/libp2p/go-libp2p-core v0.8.5 github.com/libp2p/go-libp2p-discovery v0.5.0 github.com/libp2p/go-libp2p-http v0.2.0 github.com/libp2p/go-libp2p-kad-dht v0.11.1 @@ -78,7 +78,7 @@ require ( github.com/libp2p/go-libp2p-quic-transport v0.10.0 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 - github.com/libp2p/go-libp2p-swarm v0.4.0 + github.com/libp2p/go-libp2p-swarm v0.4.1 github.com/libp2p/go-libp2p-testing v0.4.0 github.com/libp2p/go-libp2p-tls v0.1.3 github.com/libp2p/go-libp2p-yamux v0.5.1 @@ -94,20 +94,21 @@ require ( github.com/multiformats/go-multihash v0.0.14 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.7.1 + github.com/prometheus/client_golang v1.9.0 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.0 github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b - go.opencensus.io v0.22.5 + go.opencensus.io v0.23.0 go.uber.org/fx v1.13.1 go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/sync v0.0.0-20201207232520-09787c993a3a - golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 + golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect + golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 ) go 1.14 diff --git a/go.sum b/go.sum index c06f71c139d..273db1cd0dc 100644 --- a/go.sum +++ b/go.sum @@ -33,23 +33,38 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOv github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Kubuxu/go-os-helper v0.0.1 h1:EJiD2VUQyh5A9hWJLmc6iWg6yIcJ7jpBcwC8GMGXfDk= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 h1:iW0a5ljuFxkLGPNem5Ui+KBjFJzKg4Fv2fnxe4dvzpM= github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5/go.mod h1:Y2QMoi1vgtOIfc+6DhrMOGkLoGzqSV2rKp4Sm+opsyA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= @@ -57,11 +72,12 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d h1:QgeLLoPD3kRVmeu/1al9iIpIANMi9O1zXFm8BnYGCJg= -github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI= +github.com/bren2010/proquint v0.0.0-20201027163346-95122a84635f h1:aYq2dAS53HXEmxlI9AAggLbqJS4DML1/H0+r59TH/vw= +github.com/bren2010/proquint v0.0.0-20201027163346-95122a84635f/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= @@ -77,6 +93,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -92,23 +109,29 @@ github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuP github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.2.1-0.20180108230905-e214231b295a/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -125,19 +148,27 @@ github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/ristretto v0.0.2 h1:a5WaUrDa0qm0YrAAS1tUykT5El3kt62KNZZeMxQn3po= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 h1:QV0ZrfBLpFc2KDk+a4LJefDczXnonRwrYrQJY/9L4dA= github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302/go.mod h1:qBlWZqWeVx9BjvqBsnC/8RUlAYpIFmPvgROcw0n1scE= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -145,6 +176,8 @@ github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNp github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -160,17 +193,23 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -194,8 +233,9 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -204,8 +244,9 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -217,6 +258,7 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -228,32 +270,58 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f h1:KMlcu9X58lhTA/KrfX8Bi1LQSO4pzoVjTiL3h4Jk+Zk= github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= @@ -318,8 +386,8 @@ github.com/ipfs/go-filestore v0.0.3 h1:MhZ1jT5K3NewZwim6rS/akcJLm1xM+r6nz6foeB9E github.com/ipfs/go-filestore v0.0.3/go.mod h1:dvXRykFzyyXN2CdNlRGzDAkXMDPyI+D7JE066SiKLSE= github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= -github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0= -github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= +github.com/ipfs/go-graphsync v0.7.0 h1:ZdyU2otZYPjcvduAPwVjCdijmkPtHI1mm1VyZbRQ5KI= +github.com/ipfs/go-graphsync v0.7.0/go.mod h1:YRQg0TyvD2HzFansAZdMcUFBJ8zIJ4K+32kNdnHfHZc= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= @@ -416,14 +484,12 @@ github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2 github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/ipld/go-car v0.1.1-0.20201015032735-ff6ccdc46acc h1:BdI33Q56hLWG9Ef0WbQ7z+dwmbRYhTb45SMjw0RudbQ= -github.com/ipld/go-car v0.1.1-0.20201015032735-ff6ccdc46acc/go.mod h1:WdIgzcEjFqydQ7jH+BXzGYxVCmLeAs5nP8Vu3Rege2Y= -github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018 h1:RbRHv8epkmvBYA5cGfz68GUSbOgx5j/7ObLIl4Rsif0= -github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0= -github.com/ipld/go-ipld-prime-proto v0.1.0 h1:j7gjqrfwbT4+gXpHwEx5iMssma3mnctC7YaCimsFP70= -github.com/ipld/go-ipld-prime-proto v0.1.0/go.mod h1:11zp8f3sHVgIqtb/c9Kr5ZGqpnCLF1IVTNOez9TopzE= +github.com/ipld/go-car v0.2.0 h1:WwP83IdXdEuaW4fkCj+DWmdWygcFXpixramvItqFo1A= +github.com/ipld/go-car v0.2.0/go.mod h1:pPb7hzVBHBoRqU3GkPy1d6FZKQoGQ56yd3MyPGzZ0Xs= +github.com/ipld/go-ipld-prime v0.7.0 h1:eigF1ZpaL1prbsKYVMqPLoPJqD/pzkQOe2j1uzvVg7w= +github.com/ipld/go-ipld-prime v0.7.0/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= +github.com/ipld/go-ipld-prime-proto v0.1.1 h1:EX4yWYaIqSLwtVE30nxEcZDcvsWDtx1vImSG+XCJebY= +github.com/ipld/go-ipld-prime-proto v0.1.1/go.mod h1:cI9NwYAUKCLUwqufoUjChISxuTEkaY2yvNYCRCuhRck= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= @@ -445,9 +511,13 @@ github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZl github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -455,6 +525,7 @@ github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVY github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -462,8 +533,9 @@ github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHz github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jvAOgROwZ3H+Y3hIDk4tbbmIjcYQ= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= @@ -549,11 +621,12 @@ github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.0 h1:5K3mT+64qDTKbV3yTdbMCzJ7O6wbNsavAEb8iqBvBcI= github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= +github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= +github.com/libp2p/go-libp2p-core v0.8.5 h1:aEgbIcPGsKy6zYcC+5AJivYFedhYa4sW7mIpWpUaLKw= +github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= -github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= github.com/libp2p/go-libp2p-discovery v0.0.5/go.mod h1:YtF20GUxjgoKZ4zmXj8j3Nb2TUSBHFlOCetzYdbZL5I= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= @@ -602,7 +675,6 @@ github.com/libp2p/go-libp2p-noise v0.1.2 h1:IH9GRihQJTx56obm+GnpdPX4KeVIlvpXrP6x github.com/libp2p/go-libp2p-noise v0.1.2/go.mod h1:9B10b7ueo7TIxZHHcjcDCo5Hd6kfKT2m77by82SFRfE= github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es= -github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= github.com/libp2p/go-libp2p-peerstore v0.0.1/go.mod h1:RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20= github.com/libp2p/go-libp2p-peerstore v0.0.6/go.mod h1:RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20= @@ -646,8 +718,9 @@ github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHv github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.4.0 h1:hahq/ijRoeH6dgROOM8x7SeaKK5VgjjIr96vdrT+NUA= github.com/libp2p/go-libp2p-swarm v0.4.0/go.mod h1:XVFcO52VoLoo0eitSxNQWYq4D6sydGOweTOAjJNraCw= +github.com/libp2p/go-libp2p-swarm v0.4.1 h1:5e08LZ8I1HLDyutZr5m5OSCHV5pUVTsUHb5aVAljDC0= +github.com/libp2p/go-libp2p-swarm v0.4.1/go.mod h1:lZ3rjk0+w4cO7d4yhBlvYoH/2nuS5E8PU+uYuC7pwtE= github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -754,9 +827,12 @@ github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.0.0 h1:vSGhAy5u6iHBq11ZDcyHH4Blcf9xlBhT4WQDoOE90LU= github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -770,11 +846,13 @@ github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcncea github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -783,6 +861,7 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo= @@ -795,8 +874,14 @@ github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -862,10 +947,21 @@ github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -879,57 +975,87 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a h1:hjZfReYVLbqFkAtr2us7vdy04YWz3LVAirzP7reh8+M= -github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= +github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/statsd_exporter v0.15.0 h1:UiwC1L5HkxEPeapXdm2Ye0u1vUJfTj7uwT5yydYpa1E= github.com/prometheus/statsd_exporter v0.15.0/go.mod h1:Dv8HnkoLQkeEjkIE4/2ndAA7WL1zHKK7WMqFQqu72rw= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= @@ -955,8 +1081,9 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= @@ -966,6 +1093,8 @@ github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:s github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= @@ -976,11 +1105,16 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -995,9 +1129,12 @@ github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpP github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e h1:T5PdfK/M1xyrHwynxMIVMWLS7f/qHwfslZphxtGnw7s= github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c h1:u6SKchux2yDvFQnDHS3lPnIRmfVJ5Sxy3ao2SIdysLQ= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= @@ -1008,8 +1145,9 @@ github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvS github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d h1:wSxKhvbN7kUoP0sfRS+w2tWr45qlU8409i94hHLOT8w= github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 h1:bsUlNhdmbtlfdLVXAVfuvKQ01RnWAM09TVrJkI7NZs4= +github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= @@ -1030,19 +1168,24 @@ github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1: github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= @@ -1055,12 +1198,14 @@ go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= @@ -1071,6 +1216,7 @@ go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZM golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1085,6 +1231,7 @@ golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1092,8 +1239,8 @@ golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1114,25 +1261,29 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1146,6 +1297,7 @@ golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1154,8 +1306,10 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1172,16 +1326,19 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1203,6 +1360,7 @@ golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1212,6 +1370,7 @@ golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1221,12 +1380,17 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1236,6 +1400,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1269,13 +1434,14 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 h1:g3QwFWCjsUzBtcQIcI+CYmiL/0i0BxTJjQp54GGDLEM= +golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1284,6 +1450,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1309,6 +1476,7 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1323,16 +1491,21 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1349,13 +1522,18 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1375,5 +1553,7 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= From a895bac94c0862da8534b5f8cb152d41655b8379 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 25 Feb 2021 18:15:45 -0800 Subject: [PATCH 035/161] build: drop support for darwin-386 The new sys package drops support. --- mk/util.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/mk/util.mk b/mk/util.mk index a84e4e943c1..e761aeb2174 100644 --- a/mk/util.mk +++ b/mk/util.mk @@ -18,9 +18,6 @@ SUPPORTED_PLATFORMS += linux-386 SUPPORTED_PLATFORMS += linux-amd64 SUPPORTED_PLATFORMS += darwin-amd64 -ifeq ($(shell bin/check_go_version "1.15.0" 2>/dev/null; echo $$?),1) -SUPPORTED_PLATFORMS += darwin-386 -endif ifeq ($(shell bin/check_go_version "1.16.0" 2>/dev/null; echo $$?),0) SUPPORTED_PLATFORMS += darwin-arm64 endif From fcbe47bc4be7e08239ee0819cf279a7f596b6e29 Mon Sep 17 00:00:00 2001 From: gammazero Date: Fri, 26 Feb 2021 08:41:08 -0800 Subject: [PATCH 036/161] Review changes --- cmd/ipfs/daemon.go | 7 +- repo/fsrepo/migrations/fetch.go | 170 +++++---------------- repo/fsrepo/migrations/fetch_test.go | 174 ++++++++++++---------- repo/fsrepo/migrations/fetcher.go | 96 ++++++++++++ repo/fsrepo/migrations/httpfetcher.go | 91 +++++++++++ repo/fsrepo/migrations/ipfsdir.go | 18 --- repo/fsrepo/migrations/ipfsdir_test.go | 7 - repo/fsrepo/migrations/migrations.go | 15 +- repo/fsrepo/migrations/migrations_test.go | 64 ++++++-- repo/fsrepo/migrations/unpack.go | 12 +- repo/fsrepo/migrations/unpack_test.go | 66 +++++--- repo/fsrepo/migrations/versions.go | 16 +- repo/fsrepo/migrations/versions_test.go | 14 +- 13 files changed, 454 insertions(+), 296 deletions(-) create mode 100644 repo/fsrepo/migrations/fetcher.go create mode 100644 repo/fsrepo/migrations/httpfetcher.go diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 92374dfd865..c9b05497b1e 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -288,9 +288,10 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment return fmt.Errorf("fs-repo requires migration") } - // Fetch migrations using the current distribution - migrations.SetIpfsDistPath(migrations.CurrentIpfsDist) - err = migrations.RunMigration(cctx.Context(), fsrepo.RepoVersion, "") + fetcher := migrations.NewHttpFetcher() + // Fetch migrations from current distribution, or location from environ + fetcher.SetDistPath(migrations.GetDistPathEnv(migrations.CurrentIpfsDist)) + err = migrations.RunMigration(cctx.Context(), fetcher, fsrepo.RepoVersion, "", false) if err != nil { fmt.Println("The migrations of fs-repo failed:") fmt.Printf(" %s\n", err) diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 0814bd0c6ee..282978fe3dc 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "io/ioutil" - "net/http" "os" "os/exec" "path" @@ -15,68 +14,22 @@ import ( "strings" ) -const ( - // Current dirstibution to fetch migrations from - CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" - - envIpfsDistPath = "IPFS_DIST_PATH" - - // Distribution - gatewayURL = "https://ipfs.io" - ipfsDist = "/ipns/dist.ipfs.io" - - // Maximum download size - fetchSizeLimit = 1024 * 1024 * 512 -) - -type limitReadCloser struct { - io.Reader - io.Closer -} - -var ipfsDistPath string - -func init() { - SetIpfsDistPath("") -} - -// SetIpfsDistPath sets the ipfs path to the distribution site. If an empty -// string is given, then the path is set using the IPFS_DIST_PATH environ -// veriable, or the default dns link value if that is not defined. -func SetIpfsDistPath(distPath string) { - if distPath != "" { - ipfsDistPath = distPath - return - } - - if dist := os.Getenv(envIpfsDistPath); dist != "" { - ipfsDistPath = dist - } else { - ipfsDistPath = ipfsDist - } -} - // FetchBinary downloads an archive from the distribution site and unpacks it. // -// The base name of the archive file, inside the distribution directory on -// distribution site, may differ from the distribution name. If it does, then -// specify arcName. -// // The base name of the binary inside the archive may differ from the base // archive name. If it does, then specify binName. For example, the following // is needed because the archive "go-ipfs_v0.7.0_linux-amd64.tar.gz" contains a // binary named "ipfs" // -// FetchBinary(ctx, "go-ipfs", "v0.7.0", "go-ipfs", "ipfs", tmpDir) +// FetchBinary(ctx, fetcher, "go-ipfs", "v0.7.0", "ipfs", tmpDir) // // If out is a directory, then the binary is written to that directory with the // same name it has inside the archive. Otherwise, the binary file is written // to the file named by out. -func FetchBinary(ctx context.Context, dist, ver, arcName, binName, out string) (string, error) { - // If archive base name not specified, then it is same as dist. - if arcName == "" { - arcName = dist - } +func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out string) (string, error) { + // The archive file name is the base of dist to support possible subdir in + // dist, for example: "ipfs-repo-migrations/ipfs-11-to-12" + arcName := path.Base(dist) // If binary base name is not specified, then it is same as archive base name. if binName == "" { binName = arcName @@ -101,6 +54,18 @@ func FetchBinary(ctx context.Context, dist, ver, arcName, binName, out string) ( } // out exists and is a directory, so compose final name out = path.Join(out, binName) + // Check if the binary already exists in the directory + fi, err = os.Stat(out) + if !os.IsNotExist(err) { + if err != nil { + return "", err + } + return "", &os.PathError{ + Op: "FetchBinary", + Path: out, + Err: os.ErrExist, + } + } } // Create temp directory to store download @@ -115,11 +80,10 @@ func FetchBinary(ctx context.Context, dist, ver, arcName, binName, out string) ( atype = "zip" } - arcName = makeArchiveName(arcName, ver, atype) - arcIpfsPath := makeIpfsPath(dist, ver, arcName) + arcDistPath, arcFullName := makeArchivePath(dist, arcName, ver, atype) // Create a file to write the archive data to - arcPath := path.Join(tmpDir, arcName) + arcPath := path.Join(tmpDir, arcFullName) arcFile, err := os.Create(arcPath) if err != nil { return "", err @@ -127,7 +91,7 @@ func FetchBinary(ctx context.Context, dist, ver, arcName, binName, out string) ( defer arcFile.Close() // Open connection to download archive from ipfs path - rc, err := fetch(ctx, arcIpfsPath) + rc, err := fetcher.Fetch(ctx, arcDistPath) if err != nil { return "", err } @@ -155,73 +119,6 @@ func FetchBinary(ctx context.Context, dist, ver, arcName, binName, out string) ( return out, nil } -// fetch attempts to fetch the file at the given ipfs path, first using the -// local ipfs api if available, then using http. Returns io.ReadCloser on -// success, which caller must close. -func fetch(ctx context.Context, ipfsPath string) (io.ReadCloser, error) { - // Try fetching via ipfs daemon - rc, err := ipfsFetch(ctx, ipfsPath) - if err == nil { - // Transferred using local ipfs daemon - return rc, nil - } - // Try fetching via HTTP - return httpFetch(ctx, gatewayURL+ipfsPath) -} - -// ipfsFetch attempts to fetch the file at the given ipfs path using the local -// ipfs api. Returns io.ReadCloser on success, which caller must close. -func ipfsFetch(ctx context.Context, ipfsPath string) (io.ReadCloser, error) { - sh, _, err := ApiShell("") - if err != nil { - return nil, err - } - - resp, err := sh.Request("cat", ipfsPath).Send(ctx) - if err != nil { - return nil, err - } - if resp.Error != nil { - return nil, resp.Error - } - - return newLimitReadCloser(resp.Output, fetchSizeLimit), nil -} - -// httpFetch attempts to fetch the file at the given URL. Returns -// io.ReadCloser on success, which caller must close. -func httpFetch(ctx context.Context, url string) (io.ReadCloser, error) { - req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) - if err != nil { - return nil, fmt.Errorf("http.NewRequest error: %s", err) - } - - req.Header.Set("User-Agent", "go-ipfs") - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, fmt.Errorf("http.DefaultClient.Do error: %s", err) - } - - if resp.StatusCode >= 400 { - defer resp.Body.Close() - mes, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("error reading error body: %s", err) - } - return nil, fmt.Errorf("GET %s error: %s: %s", url, resp.Status, string(mes)) - } - - return newLimitReadCloser(resp.Body, fetchSizeLimit), nil -} - -func newLimitReadCloser(rc io.ReadCloser, limit int64) io.ReadCloser { - return limitReadCloser{ - Reader: io.LimitReader(rc, limit), - Closer: rc, - } -} - // osWithVariant returns the OS name with optional variant. // Currently returns either runtime.GOOS, or "linux-musl". func osWithVariant() (string, error) { @@ -255,18 +152,21 @@ func osWithVariant() (string, error) { return "linux", nil } -// makeArchiveName composes the name of a migration binary archive. +// makeArchivePath composes the path, relative to the distribution site, from which to +// download a binary. The path returned does not contain the distribution site path, +// e.g. "/ipns/dist.ipfs.io/", since that is know to the fetcher. // -// The archive name is in the format: name_version_osv-GOARCH.atype -// Example: ipfs-10-to-11_v1.8.0_darwin-amd64.tar.gz -func makeArchiveName(name, ver, atype string) string { - return fmt.Sprintf("%s_%s_%s-%s.%s", name, ver, runtime.GOOS, runtime.GOARCH, atype) -} - -// makeIpfsPath composes the name ipfs path location to download a migration -// binary from the distribution site. +// Returns the archive path and the base name. +// +// The ipfs path format is: distribution/version/archiveName +// - distribution is the name of a distribution, such as "go-ipfs" +// - version is the version to fetch, such as "v0.8.0-rc2" +// - archiveName is formatted as name_version_osv-GOARCH.atype, such as +// "go-ipfs_v0.8.0-rc2_linux-amd64.tar.gz" // -// The ipfs path format: distBaseCID/rootdir/version/name/archive -func makeIpfsPath(dist, ver, arcName string) string { - return fmt.Sprintf("%s/%s/%s/%s", ipfsDistPath, dist, ver, arcName) +// This would form the path: +// go-ipfs/v0.8.0/go-ipfs_v0.8.0_linux-amd64.tar.gz +func makeArchivePath(dist, name, ver, atype string) (string, string) { + arcName := fmt.Sprintf("%s_%s_%s-%s.%s", name, ver, runtime.GOOS, runtime.GOARCH, atype) + return fmt.Sprintf("%s/%s/%s", dist, ver, arcName), arcName } diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 18bb2595502..694e22e2bad 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -3,17 +3,63 @@ package migrations import ( "bufio" "context" + "fmt" + "io" "io/ioutil" + "net/http" + "net/http/httptest" "os" "path" "strings" "testing" ) -func TestSetIpfsDistPath(t *testing.T) { +func createTestServer() *httptest.Server { + reqHandler := func(w http.ResponseWriter, r *http.Request) { + defer r.Body.Close() + if strings.Contains(r.URL.Path, "not-here") { + http.NotFound(w, r) + } else if strings.HasSuffix(r.URL.Path, "versions") { + fmt.Fprint(w, "v1.0.0\nv1.1.0\nv1.1.2\nv2.0.0-rc1\n2.0.0\nv2.0.1\n") + } else if strings.HasSuffix(r.URL.Path, ".tar.gz") { + createFakeArchive(r.URL.Path, false, w) + } else if strings.HasSuffix(r.URL.Path, "zip") { + createFakeArchive(r.URL.Path, true, w) + } else { + http.NotFound(w, r) + } + } + return httptest.NewServer(http.HandlerFunc(reqHandler)) +} + +func createFakeArchive(name string, archZip bool, w io.Writer) { + fileName := strings.Split(path.Base(name), "_")[0] + root := path.Base(path.Dir(path.Dir(name))) + + // Simulate fetching go-ipfs, which has "ipfs" as the name in the archive. + if fileName == "go-ipfs" { + fileName = "ipfs" + } + + var err error + if archZip { + err = writeZip(root, fileName, "FAKE DATA", w) + } else { + err = writeTarGzip(root, fileName, "FAKE DATA", w) + } + if err != nil { + panic(err) + } +} + +func TestSetDistPath(t *testing.T) { + f1 := NewHttpFetcher() + f2 := NewHttpFetcher() + mf := NewMultiFetcher(f1, f2) + os.Unsetenv(envIpfsDistPath) - SetIpfsDistPath("") - if ipfsDistPath != ipfsDist { + mf.SetDistPath(GetDistPathEnv("")) + if f1.distPath != IpnsIpfsDist { t.Error("did not set default dist path") } @@ -24,17 +70,30 @@ func TestSetIpfsDistPath(t *testing.T) { } defer func() { os.Unsetenv(envIpfsDistPath) - SetIpfsDistPath("") }() - SetIpfsDistPath("") - if ipfsDistPath != testDist { + mf.SetDistPath(GetDistPathEnv("")) + if f1.distPath != testDist { + t.Error("did not set dist path from environ") + } + if f2.distPath != testDist { + t.Error("did not set dist path from environ") + } + + mf.SetDistPath(GetDistPathEnv("ignored")) + if f1.distPath != testDist { + t.Error("did not set dist path from environ") + } + if f2.distPath != testDist { t.Error("did not set dist path from environ") } testDist = "/unit/test/dist2" - SetIpfsDistPath(testDist) - if ipfsDistPath != testDist { + mf.SetDistPath(testDist) + if f1.distPath != testDist { + t.Error("did not set dist path") + } + if f2.distPath != testDist { t.Error("did not set dist path") } } @@ -43,8 +102,12 @@ func TestHttpFetch(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - url := gatewayURL + path.Join(ipfsDistPath, distFSRM, distVersions) - rc, err := httpFetch(ctx, url) + fetcher := NewHttpFetcher() + ts := createTestServer() + defer ts.Close() + fetcher.SetGateway(ts.URL) + + rc, err := fetcher.Fetch(ctx, "/versions") if err != nil { t.Fatal(err) } @@ -60,73 +123,18 @@ func TestHttpFetch(t *testing.T) { t.Fatal("could not read versions:", err) } - if len(out) < 14 { + if len(out) < 6 { t.Fatal("do not get all expected data") } if out[0] != "v1.0.0" { t.Fatal("expected v1.0.0 as first line, got", out[0]) } - // Check bad URL - _, err = httpFetch(ctx, "") - if err == nil { - t.Fatal("expected error") - } - - // Check unreachable URL - _, err = httpFetch(ctx, "http://127.0.0.123:65510") - if err == nil || !strings.HasSuffix(err.Error(), "connection refused") { - t.Fatal("expected 'connection refused' error") - } - // Check not found - url = gatewayURL + path.Join(ipfsDistPath, distFSRM, "no_such_file") - _, err = httpFetch(ctx, url) + _, err = fetcher.Fetch(ctx, "/no_such_file") if err == nil || !strings.Contains(err.Error(), "404") { t.Fatal("expected error 404") } - -} - -func TestIpfsFetch(t *testing.T) { - _, err := ApiEndpoint("") - if err != nil { - t.Skip("skipped - local ipfs daemon not available") - } - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - url := path.Join(ipfsDistPath, distFSRM, distVersions) - rc, err := ipfsFetch(ctx, url) - if err != nil { - t.Fatal(err) - } - defer rc.Close() - - var out []string - scan := bufio.NewScanner(rc) - for scan.Scan() { - out = append(out, scan.Text()) - } - err = scan.Err() - if err != nil { - t.Fatal("could not read versions:", err) - } - - if len(out) < 14 { - t.Fatal("do not get all expected data") - } - if out[0] != "v1.0.0" { - t.Fatal("expected v1.0.0 as first line, got", out[0]) - } - - // Check bad URL - url = path.Join(ipfsDistPath, distFSRM, "no_such_file") - _, err = ipfsFetch(ctx, url) - if err == nil || !strings.Contains(err.Error(), "no link") { - t.Fatal("expected 'no link' error, got:", err) - } } func TestFetchBinary(t *testing.T) { @@ -139,13 +147,18 @@ func TestFetchBinary(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - vers, err := DistVersions(ctx, distFSRM, false) + fetcher := NewHttpFetcher() + ts := createTestServer() + defer ts.Close() + fetcher.SetGateway(ts.URL) + + vers, err := DistVersions(ctx, fetcher, distFSRM, false) if err != nil { t.Fatal(err) } t.Log("latest version of", distFSRM, "is", vers[len(vers)-1]) - bin, err := FetchBinary(ctx, distFSRM, vers[0], distFSRM, "", tmpDir) + bin, err := FetchBinary(ctx, fetcher, distFSRM, vers[0], "", tmpDir) if err != nil { t.Fatal(err) } @@ -157,7 +170,7 @@ func TestFetchBinary(t *testing.T) { t.Log("downloaded and unpacked", fi.Size(), "byte file:", fi.Name()) - bin, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "ipfs", tmpDir) + bin, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "ipfs", tmpDir) if err != nil { t.Fatal(err) } @@ -170,11 +183,18 @@ func TestFetchBinary(t *testing.T) { t.Log("downloaded and unpacked", fi.Size(), "byte file:", fi.Name()) // Check error is destination already exists and is not directory - _, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "ipfs", bin) + _, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "ipfs", bin) if !os.IsExist(err) { - t.Fatal("expected 'exists' error") + t.Fatal("expected 'exists' error, got", err) } + _, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "ipfs", tmpDir) + if !os.IsExist(err) { + t.Error("expected 'exists' error, got:", err) + } + + os.Remove(path.Join(tmpDir, "ipfs")) + // Check error creating temp download directory err = os.Chmod(tmpDir, 0555) if err != nil { @@ -184,9 +204,9 @@ func TestFetchBinary(t *testing.T) { if err != nil { panic(err) } - _, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "ipfs", tmpDir) + _, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "ipfs", tmpDir) if !os.IsPermission(err) { - t.Error("expected 'permission'error") + t.Error("expected 'permission' error, got:", err) } err = os.Setenv("TMPDIR", "/tmp") if err != nil { @@ -198,13 +218,13 @@ func TestFetchBinary(t *testing.T) { } // Check error if failure to fetch due to bad dist - _, err = FetchBinary(ctx, "no-such-dist", "v0.3.5", "", "ipfs", tmpDir) + _, err = FetchBinary(ctx, fetcher, "not-here", "v0.3.5", "ipfs", tmpDir) if err == nil || !strings.Contains(err.Error(), "Not Found") { - t.Error("expected 'Not Found' error") + t.Error("expected 'Not Found' error, got:", err) } // Check error if failure to unpack archive - _, err = FetchBinary(ctx, "go-ipfs", "v0.3.5", "", "not-such-bin", tmpDir) + _, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "not-such-bin", tmpDir) if err == nil || err.Error() != "no binary found in archive" { t.Error("expected 'no binary found in archive' error") } diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go new file mode 100644 index 00000000000..6338b75fc11 --- /dev/null +++ b/repo/fsrepo/migrations/fetcher.go @@ -0,0 +1,96 @@ +package migrations + +import ( + "context" + "io" + "os" + "strings" +) + +const ( + // Current dirstibution to fetch migrations from + CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" + // Distribution IPNS path. Default for fetchers. + IpnsIpfsDist = "/ipns/dist.ipfs.io" + + // Distribution environ variable + envIpfsDistPath = "IPFS_DIST_PATH" +) + +type Fetcher interface { + // Fetch attempts to fetch the file at the given ipfs path. + // Returns io.ReadCloser on success, which caller must close. + Fetch(ctx context.Context, filePath string) (io.ReadCloser, error) + // SetDistPath sets the path to the distribution site for a Fetcher + SetDistPath(distPath string) +} + +// MultiFetcher holds multiple Fetchers and provides a Fetch that tries each +// until one succeeds. +type MultiFetcher struct { + fetchers []Fetcher +} + +type limitReadCloser struct { + io.Reader + io.Closer +} + +// NewMultiFetcher creates a MultiFetcher with the given Fetchers. The +// Fetchers are tried in order ther passed to this function. +func NewMultiFetcher(f ...Fetcher) Fetcher { + mf := &MultiFetcher{ + fetchers: make([]Fetcher, len(f)), + } + copy(mf.fetchers, f) + return mf +} + +// Fetch attempts to fetch the file at each of its fetchers until one succeeds. +// Returns io.ReadCloser on success, which caller must close. +func (f *MultiFetcher) Fetch(ctx context.Context, ipfsPath string) (rc io.ReadCloser, err error) { + for _, fetcher := range f.fetchers { + rc, err = fetcher.Fetch(ctx, ipfsPath) + if err == nil { + // Transferred using this fetcher + return + } + } + return +} + +// SetDistPath sets the path to the distribution site for all fetchers +func (f *MultiFetcher) SetDistPath(distPath string) { + if !strings.HasPrefix(distPath, "/") { + distPath = "/" + distPath + } + for _, fetcher := range f.fetchers { + fetcher.SetDistPath(distPath) + } +} + +// NewLimitReadCloser returns a new io.ReadCloser with the reader wrappen in a +// io.LimitedReader limited to reading the amount specified. +func NewLimitReadCloser(rc io.ReadCloser, limit int64) io.ReadCloser { + return limitReadCloser{ + Reader: io.LimitReader(rc, limit), + Closer: rc, + } +} + +// GetDistPathEnv returns the IPFS path to the distribution site, using +// the value of environ variable specified by envIpfsDistPath. If the environ +// variable is not set, then returns the provided distPath, and if that is not set +// then returns the IPNS path. +// +// To get the IPFS path of the latest distribution, if not overriddin by the +// environ variable: GetDistPathEnv(CurrentIpfsDist) +func GetDistPathEnv(distPath string) string { + if dist := os.Getenv(envIpfsDistPath); dist != "" { + return dist + } + if distPath == "" { + return IpnsIpfsDist + } + return distPath +} diff --git a/repo/fsrepo/migrations/httpfetcher.go b/repo/fsrepo/migrations/httpfetcher.go new file mode 100644 index 00000000000..72374702594 --- /dev/null +++ b/repo/fsrepo/migrations/httpfetcher.go @@ -0,0 +1,91 @@ +package migrations + +import ( + "context" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "path" + "strings" +) + +const ( + defaultGatewayURL = "https://ipfs.io" + defaultFetchLimit = 1024 * 1024 * 512 +) + +// HttpFetcher fetches files over HTTP +type HttpFetcher struct { + gateway string + distPath string + limit int64 +} + +var _ Fetcher = (*HttpFetcher)(nil) + +// NewHttpFetcher creates a new HttpFetcher +func NewHttpFetcher() *HttpFetcher { + return &HttpFetcher{ + gateway: defaultGatewayURL, + distPath: IpnsIpfsDist, + limit: defaultFetchLimit, + } +} + +// SetGateway sets the gateway URL +func (f *HttpFetcher) SetGateway(gatewayURL string) error { + gwURL, err := url.Parse(gatewayURL) + if err != nil { + return err + } + f.gateway = gwURL.String() + return nil +} + +// SetDistPath sets the path to the distribution site. +func (f *HttpFetcher) SetDistPath(distPath string) { + if !strings.HasPrefix(distPath, "/") { + distPath = "/" + distPath + } + f.distPath = distPath +} + +// SetFetchLimit sets the download size limit. A value of 0 means no limit. +func (f *HttpFetcher) SetFetchLimit(limit int64) { + f.limit = limit +} + +// Fetch attempts to fetch the file at the given path, from the distribution +// site configured for this HttpFetcher. Returns io.ReadCloser on success, +// which caller must close. +func (f *HttpFetcher) Fetch(ctx context.Context, filePath string) (io.ReadCloser, error) { + gwURL := f.gateway + path.Join(f.distPath, filePath) + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, gwURL, nil) + if err != nil { + return nil, fmt.Errorf("http.NewRequest error: %s", err) + } + + req.Header.Set("User-Agent", "go-ipfs") + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, fmt.Errorf("http.DefaultClient.Do error: %s", err) + } + + if resp.StatusCode >= 400 { + defer resp.Body.Close() + mes, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("error reading error body: %s", err) + } + return nil, fmt.Errorf("GET %s error: %s: %s", gwURL, resp.Status, string(mes)) + } + + if f.limit != 0 { + return NewLimitReadCloser(resp.Body, f.limit), nil + } + return resp.Body, nil +} diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index bcc3853b175..cbc407ca2d0 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -10,7 +10,6 @@ import ( "strings" "time" - api "github.com/ipfs/go-ipfs-api" "github.com/mitchellh/go-homedir" ) @@ -52,23 +51,6 @@ func ApiEndpoint(ipfsDir string) (string, error) { return parts[2] + ":" + parts[4], nil } -// ApiShell creates a new ipfs api shell and checks that it is up. If the shell -// is available, then the shell and ipfs version are returned. -func ApiShell(ipfsDir string) (*api.Shell, string, error) { - apiEp, err := ApiEndpoint("") - if err != nil { - return nil, "", err - } - sh := api.NewShell(apiEp) - sh.SetTimeout(shellUpTimeout) - ver, _, err := sh.Version() - if err != nil { - return nil, "", errors.New("ipfs api shell not up") - } - sh.SetTimeout(0) - return sh, ver, nil -} - // IpfsDir returns the path of the ipfs directory. If dir specified, then // returns the expanded version dir. If dir is "", then return the directory // set by IPFS_PATH, or if IPFS_PATH is not set, then return the default diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go index 59c14a16423..a1003bc7dac 100644 --- a/repo/fsrepo/migrations/ipfsdir_test.go +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -212,11 +212,4 @@ func TestApiEndpoint(t *testing.T) { if val2 != val { t.Fatal("expected", val, "got", val2) } - - _, _, err = ApiShell(fakeIpfs) - if err != nil { - if err.Error() != "ipfs api shell not up" { - t.Fatal("expected 'ipfs api shell not up' error") - } - } } diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 2fd7c7ecae4..1833dff3015 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -21,7 +21,7 @@ const ( // RunMigration finds, downloads, and runs the individual migrations needed to // migrate the repo from its current version to the target version. -func RunMigration(ctx context.Context, targetVer int, ipfsDir string) error { +func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir string, allowDowngrade bool) error { ipfsDir, err := CheckIpfsDir(ipfsDir) if err != nil { return err @@ -34,6 +34,9 @@ func RunMigration(ctx context.Context, targetVer int, ipfsDir string) error { // repo already at target version number return nil } + if fromVer > targetVer && !allowDowngrade { + return fmt.Errorf("downgrade not allowed from %d to %d", fromVer, targetVer) + } log.Print("Looking for suitable migration binaries.") @@ -59,7 +62,7 @@ func RunMigration(ctx context.Context, targetVer int, ipfsDir string) error { } defer os.RemoveAll(tmpDir) - fetched, err := fetchMigrations(ctx, missing, tmpDir) + fetched, err := fetchMigrations(ctx, fetcher, missing, tmpDir) if err != nil { log.Print("Failed to download migrations.") return err @@ -156,7 +159,7 @@ func runMigration(ctx context.Context, binPath, ipfsDir string, revert bool) err // fetchMigrations downloads the requested migrations, and returns a slice with // the paths of each binary, in the same order specified by needed. -func fetchMigrations(ctx context.Context, needed []string, destDir string) ([]string, error) { +func fetchMigrations(ctx context.Context, fetcher Fetcher, needed []string, destDir string) ([]string, error) { osv, err := osWithVariant() if err != nil { return nil, err @@ -173,13 +176,13 @@ func fetchMigrations(ctx context.Context, needed []string, destDir string) ([]st log.Printf("Downloading migration: %s...", name) go func(i int, name string) { defer wg.Done() - distDir := path.Join(distMigsRoot, name) - ver, err := LatestDistVersion(ctx, distDir) + dist := path.Join(distMigsRoot, name) + ver, err := LatestDistVersion(ctx, fetcher, dist, false) if err != nil { log.Printf("could not get latest version of migration %s: %s", name, err) return } - loc, err := FetchBinary(ctx, distDir, ver, name, name, destDir) + loc, err := FetchBinary(ctx, fetcher, dist, ver, name, destDir) if err != nil { log.Printf("could not download %s: %s", name, err) return diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index d86ddbb930e..2293d775ad3 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -3,15 +3,12 @@ package migrations import ( "context" "io/ioutil" - "net/http" "os" "path" "strings" "testing" ) -const testIPFSDistPath = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" - func TestFindMigrations(t *testing.T) { tmpDir, err := ioutil.TempDir("", "migratetest") if err != nil { @@ -118,14 +115,11 @@ func TestFetchMigrations(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - SetIpfsDistPath(testIPFSDistPath) - _, err := LatestDistVersion(ctx, "ipfs-1-to-2") - if err != nil { - if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) { - t.Skip("skip - migrations not yet available on distribution site") - } - t.Fatal(err) - } + fetcher := NewHttpFetcher() + fetcher.SetDistPath(CurrentIpfsDist) + ts := createTestServer() + defer ts.Close() + fetcher.SetGateway(ts.URL) tmpDir, err := ioutil.TempDir("", "migratetest") if err != nil { @@ -134,7 +128,7 @@ func TestFetchMigrations(t *testing.T) { defer os.RemoveAll(tmpDir) needed := []string{"ipfs-1-to-2", "ipfs-2-to-3"} - fetched, err := fetchMigrations(ctx, needed, tmpDir) + fetched, err := fetchMigrations(ctx, fetcher, needed, tmpDir) if err != nil { t.Fatal(err) } @@ -147,6 +141,52 @@ func TestFetchMigrations(t *testing.T) { } } +func TestRunMigrations(t *testing.T) { + var err error + fakeHome, err = ioutil.TempDir("", "testhome") + if err != nil { + panic(err) + } + defer os.RemoveAll(fakeHome) + + os.Setenv("HOME", fakeHome) + fakeIpfs := path.Join(fakeHome, ".ipfs") + + err = os.Mkdir(fakeIpfs, os.ModePerm) + if err != nil { + panic(err) + } + + testVer := 11 + err = WriteRepoVersion(fakeIpfs, testVer) + if err != nil { + t.Fatal(err) + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + fetcher := NewHttpFetcher() + fetcher.SetDistPath(CurrentIpfsDist) + ts := createTestServer() + defer ts.Close() + fetcher.SetGateway(ts.URL) + + targetVer := 9 + + err = RunMigration(ctx, fetcher, targetVer, fakeIpfs, false) + if err == nil || !strings.HasPrefix(err.Error(), "downgrade not allowed") { + t.Fatal("expected 'downgrade not alloed' error") + } + + err = RunMigration(ctx, fetcher, targetVer, fakeIpfs, true) + if err != nil { + if !strings.HasPrefix(err.Error(), "migration ipfs-10-to-11 failed") { + t.Fatal(err) + } + } +} + func createFakeBin(from, to int, tmpDir string) { migPath := path.Join(tmpDir, ExeName(migrationName(from, to))) emptyFile, err := os.Create(migPath) diff --git a/repo/fsrepo/migrations/unpack.go b/repo/fsrepo/migrations/unpack.go index f08a19885ae..485d983cfc1 100644 --- a/repo/fsrepo/migrations/unpack.go +++ b/repo/fsrepo/migrations/unpack.go @@ -30,13 +30,13 @@ func unpackArchive(arcPath, atype, root, name, out string) error { func unpackTgz(arcPath, root, name, out string) error { fi, err := os.Open(arcPath) if err != nil { - return fmt.Errorf("cannot open archive file: %s", err) + return fmt.Errorf("cannot open archive file: %w", err) } defer fi.Close() gzr, err := gzip.NewReader(fi) if err != nil { - return fmt.Errorf("error opening gzip reader: %s", err) + return fmt.Errorf("error opening gzip reader: %w", err) } defer gzr.Close() @@ -50,7 +50,7 @@ func unpackTgz(arcPath, root, name, out string) error { if err == io.EOF { break } - return fmt.Errorf("cannot read archive: %s", err) + return fmt.Errorf("cannot read archive: %w", err) } if th.Name == lookFor { @@ -69,7 +69,7 @@ func unpackTgz(arcPath, root, name, out string) error { func unpackZip(arcPath, root, name, out string) error { zipr, err := zip.OpenReader(arcPath) if err != nil { - return fmt.Errorf("error opening zip reader: %s", err) + return fmt.Errorf("error opening zip reader: %w", err) } defer zipr.Close() @@ -79,7 +79,7 @@ func unpackZip(arcPath, root, name, out string) error { if fis.Name == lookFor { rc, err := fis.Open() if err != nil { - return fmt.Errorf("error extracting binary from archive: %s", err) + return fmt.Errorf("error extracting binary from archive: %w", err) } bin = rc @@ -97,7 +97,7 @@ func unpackZip(arcPath, root, name, out string) error { func writeToPath(rc io.Reader, out string) error { binfi, err := os.Create(out) if err != nil { - return fmt.Errorf("error opening tmp bin path '%s': %s", out, err) + return fmt.Errorf("error creating output file '%s': %w", out, err) } defer binfi.Close() diff --git a/repo/fsrepo/migrations/unpack_test.go b/repo/fsrepo/migrations/unpack_test.go index cc3ec96a6d6..e772f00b197 100644 --- a/repo/fsrepo/migrations/unpack_test.go +++ b/repo/fsrepo/migrations/unpack_test.go @@ -5,6 +5,7 @@ import ( "archive/zip" "bufio" "compress/gzip" + "io" "io/ioutil" "os" "path" @@ -49,7 +50,7 @@ func TestUnpackTgz(t *testing.T) { testTarGzip := path.Join(tmpDir, "test.tar.gz") testData := "some data" - err = writeTarGzip(testTarGzip, "testroot", "testfile", testData) + err = writeTarGzipFile(testTarGzip, "testroot", "testfile", testData) if err != nil { panic(err) } @@ -97,7 +98,7 @@ func TestUnpackZip(t *testing.T) { testZip := path.Join(tmpDir, "test.zip") testData := "some data" - err = writeZip(testZip, "testroot", "testfile", testData) + err = writeZipFile(testZip, "testroot", "testfile", testData) if err != nil { panic(err) } @@ -125,21 +126,38 @@ func TestUnpackZip(t *testing.T) { } } -func writeTarGzip(archName, root, fileName, data string) error { +func writeTarGzipFile(archName, root, fileName, data string) error { archFile, err := os.Create(archName) if err != nil { return err } defer archFile.Close() - wr := bufio.NewWriter(archFile) + w := bufio.NewWriter(archFile) + err = writeTarGzip(root, fileName, data, w) + if err != nil { + return err + } + // Flush buffered data to file + if err = w.Flush(); err != nil { + return err + } + // Close tar file + if err = archFile.Close(); err != nil { + return err + } + return nil +} + +func writeTarGzip(root, fileName, data string, w io.Writer) error { // gzip writer writes to buffer - gzw := gzip.NewWriter(wr) + gzw := gzip.NewWriter(w) defer gzw.Close() // tar writer writes to gzip tw := tar.NewWriter(gzw) defer tw.Close() + var err error if fileName != "" { hdr := &tar.Header{ Name: path.Join(root, fileName), @@ -163,26 +181,34 @@ func writeTarGzip(archName, root, fileName, data string) error { if err = gzw.Close(); err != nil { return err } - // Flush buffered data to file - if err = wr.Flush(); err != nil { - return err - } - // Close tar file - if err = archFile.Close(); err != nil { - return err - } return nil } -func writeZip(archName, root, fileName, data string) error { +func writeZipFile(archName, root, fileName, data string) error { archFile, err := os.Create(archName) if err != nil { return err } defer archFile.Close() - wr := bufio.NewWriter(archFile) + w := bufio.NewWriter(archFile) - zw := zip.NewWriter(wr) + err = writeZip(root, fileName, data, w) + if err != nil { + return err + } + // Flush buffered data to file + if err = w.Flush(); err != nil { + return err + } + // Close zip file + if err = archFile.Close(); err != nil { + return err + } + return nil +} + +func writeZip(root, fileName, data string, w io.Writer) error { + zw := zip.NewWriter(w) defer zw.Close() // Write file name @@ -200,13 +226,5 @@ func writeZip(archName, root, fileName, data string) error { if err = zw.Close(); err != nil { return err } - // Flush buffered data to file - if err = wr.Flush(); err != nil { - return err - } - // Close zip file - if err = archFile.Close(); err != nil { - return err - } return nil } diff --git a/repo/fsrepo/migrations/versions.go b/repo/fsrepo/migrations/versions.go index fd45f21804a..7d9fda8359f 100644 --- a/repo/fsrepo/migrations/versions.go +++ b/repo/fsrepo/migrations/versions.go @@ -18,17 +18,21 @@ const distVersions = "versions" // LatestDistVersion returns the latest version, of the specified distribution, // that is available on the distribution site. -func LatestDistVersion(ctx context.Context, dist string) (string, error) { - vs, err := DistVersions(ctx, dist, false) +func LatestDistVersion(ctx context.Context, fetcher Fetcher, dist string, stableOnly bool) (string, error) { + vs, err := DistVersions(ctx, fetcher, dist, false) if err != nil { return "", err } for i := len(vs) - 1; i >= 0; i-- { ver := vs[i] - if !strings.Contains(ver, "-dev") { - return ver, nil + if stableOnly && strings.Contains(ver, "-rc") { + continue + } + if strings.Contains(ver, "-dev") { + continue } + return ver, nil } return "", errors.New("could not find a non dev version") } @@ -36,8 +40,8 @@ func LatestDistVersion(ctx context.Context, dist string) (string, error) { // DistVersions returns all versions of the specified distribution, that are // available on the distriburion site. List is in ascending order, unless // sortDesc is true. -func DistVersions(ctx context.Context, dist string, sortDesc bool) ([]string, error) { - rc, err := fetch(ctx, path.Join(ipfsDistPath, dist, distVersions)) +func DistVersions(ctx context.Context, fetcher Fetcher, dist string, sortDesc bool) ([]string, error) { + rc, err := fetcher.Fetch(ctx, path.Join(dist, distVersions)) if err != nil { return nil, err } diff --git a/repo/fsrepo/migrations/versions_test.go b/repo/fsrepo/migrations/versions_test.go index a9725404999..af1b1150526 100644 --- a/repo/fsrepo/migrations/versions_test.go +++ b/repo/fsrepo/migrations/versions_test.go @@ -14,7 +14,12 @@ func TestDistVersions(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - vers, err := DistVersions(ctx, testDist, true) + fetcher := NewHttpFetcher() + ts := createTestServer() + defer ts.Close() + fetcher.SetGateway(ts.URL) + + vers, err := DistVersions(ctx, fetcher, testDist, true) if err != nil { t.Fatal(err) } @@ -29,7 +34,12 @@ func TestLatestDistVersion(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - latest, err := LatestDistVersion(ctx, testDist) + fetcher := NewHttpFetcher() + //ts := createTestServer() + //defer ts.Close() + //fetcher.SetGateway(ts.URL) + + latest, err := LatestDistVersion(ctx, fetcher, testDist, false) if err != nil { t.Fatal(err) } From 852dfab997f58d9c36765c2fae7e619390f44fdb Mon Sep 17 00:00:00 2001 From: gammazero Date: Fri, 26 Feb 2021 11:28:00 -0800 Subject: [PATCH 037/161] fix lint warnings --- go.mod | 1 - go.sum | 14 -------------- repo/fsrepo/migrations/fetch.go | 2 +- repo/fsrepo/migrations/fetch_test.go | 9 +++++++-- repo/fsrepo/migrations/ipfsdir.go | 4 +--- repo/fsrepo/migrations/migrations_test.go | 9 +++++++-- repo/fsrepo/migrations/versions_test.go | 5 ++++- 7 files changed, 20 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 4525aafa290..190ed2675c0 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,6 @@ require ( github.com/ipfs/go-filestore v0.0.3 github.com/ipfs/go-fs-lock v0.0.6 github.com/ipfs/go-graphsync v0.6.0 - github.com/ipfs/go-ipfs-api v0.2.0 github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 diff --git a/go.sum b/go.sum index 9dc230ba8dc..d1141d65172 100644 --- a/go.sum +++ b/go.sum @@ -87,8 +87,6 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= -github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= -github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -169,7 +167,6 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -322,8 +319,6 @@ github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0 github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0= github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= -github.com/ipfs/go-ipfs-api v0.2.0 h1:BXRctUU8YOUOQT/jW1s56d9wLa85ntOqK6bptvCKb8c= -github.com/ipfs/go-ipfs-api v0.2.0/go.mod h1:zCTyTl+BuyvUqoSmVb8vjezCJLVTW7G/HBZbCXpTgeM= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= @@ -461,7 +456,6 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -623,7 +617,6 @@ github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6n github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= -github.com/libp2p/go-libp2p-pubsub v0.4.0 h1:YNVRyXqBgv9i4RG88jzoTtkSOaSB45CqHkL29NNBZb4= github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDFhWj+8yy8= github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= @@ -994,7 +987,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -1033,7 +1025,6 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c/go.mod h1:xxcJeBb7SIUl/Wzkz1eVKJE/CB34YNrqX2TQI6jY9zs= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= @@ -1161,7 +1152,6 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1181,7 +1171,6 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1228,7 +1217,6 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1278,13 +1266,11 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3 h1:r3P/5xOq/dK1991B65Oy6E1fRF/2d/fSYZJ/fXGVfJc= golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 282978fe3dc..753c9b10b17 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -55,7 +55,7 @@ func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out s // out exists and is a directory, so compose final name out = path.Join(out, binName) // Check if the binary already exists in the directory - fi, err = os.Stat(out) + _, err = os.Stat(out) if !os.IsNotExist(err) { if err != nil { return "", err diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 694e22e2bad..c5fa9625f2c 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -105,7 +105,10 @@ func TestHttpFetch(t *testing.T) { fetcher := NewHttpFetcher() ts := createTestServer() defer ts.Close() - fetcher.SetGateway(ts.URL) + err := fetcher.SetGateway(ts.URL) + if err != nil { + panic(err) + } rc, err := fetcher.Fetch(ctx, "/versions") if err != nil { @@ -150,7 +153,9 @@ func TestFetchBinary(t *testing.T) { fetcher := NewHttpFetcher() ts := createTestServer() defer ts.Close() - fetcher.SetGateway(ts.URL) + if err = fetcher.SetGateway(ts.URL); err != nil { + panic(err) + } vers, err := DistVersions(ctx, fetcher, distFSRM, false) if err != nil { diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index cbc407ca2d0..9f107dbc28b 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -8,7 +8,6 @@ import ( "path" "strconv" "strings" - "time" "github.com/mitchellh/go-homedir" ) @@ -19,8 +18,7 @@ const ( versionFile = "version" // Local IPFS API - apiFile = "api" - shellUpTimeout = 2 * time.Second + apiFile = "api" ) func init() { diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 2293d775ad3..51e47610080 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -119,7 +119,10 @@ func TestFetchMigrations(t *testing.T) { fetcher.SetDistPath(CurrentIpfsDist) ts := createTestServer() defer ts.Close() - fetcher.SetGateway(ts.URL) + err := fetcher.SetGateway(ts.URL) + if err != nil { + panic(err) + } tmpDir, err := ioutil.TempDir("", "migratetest") if err != nil { @@ -170,7 +173,9 @@ func TestRunMigrations(t *testing.T) { fetcher.SetDistPath(CurrentIpfsDist) ts := createTestServer() defer ts.Close() - fetcher.SetGateway(ts.URL) + if err = fetcher.SetGateway(ts.URL); err != nil { + panic(err) + } targetVer := 9 diff --git a/repo/fsrepo/migrations/versions_test.go b/repo/fsrepo/migrations/versions_test.go index af1b1150526..984d70abd78 100644 --- a/repo/fsrepo/migrations/versions_test.go +++ b/repo/fsrepo/migrations/versions_test.go @@ -17,7 +17,10 @@ func TestDistVersions(t *testing.T) { fetcher := NewHttpFetcher() ts := createTestServer() defer ts.Close() - fetcher.SetGateway(ts.URL) + err := fetcher.SetGateway(ts.URL) + if err != nil { + panic(err) + } vers, err := DistVersions(ctx, fetcher, testDist, true) if err != nil { From dae7387584ed15beebac70e32b878113cdb904b6 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 27 Feb 2021 00:48:12 +0100 Subject: [PATCH 038/161] refactor: show error, delay redirect This implements error page that does not hide the problem, but still redirects to a valid path after short delay: https://github.com/ipfs/go-ipfs/pull/7930#issuecomment-786882748 --- core/corehttp/gateway_handler.go | 34 +++++++++++++++++++++++++++----- test/sharness/t0110-gateway.sh | 14 +++++++------ 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index cf5acf209de..289fdd725de 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -3,6 +3,7 @@ package corehttp import ( "context" "fmt" + "html/template" "io" "mime" "net/http" @@ -36,6 +37,16 @@ const ( var onlyAscii = regexp.MustCompile("[[:^ascii:]]") +// HTML-based redirect for errors which can be recovered from, but we want +// to provide hint to people that they should fix things on their end. +var redirectTemplate = template.Must(template.New("redirect").Parse(`
{{.ErrorMsg}}
(if a redirect does not happen in 10 seconds, use "{{.SuggestedPath}}" instead)
`)) + +type redirectTemplateData struct { + RedirectURL string + SuggestedPath string + ErrorMsg string +} + // gatewayHandler is a HTTP handler that serves IPFS objects (accessible by default at /ipfs/) // (it serves requests like GET /ipfs/QmVRzPKPzNtSrEzBFm2UZfxmPAgnaLke4DMcerbsGGSaFe/link) type gatewayHandler struct { @@ -216,19 +227,32 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request } parsedPath := ipath.New(urlPath) - if err := parsedPath.IsValid(); err != nil { - // Attempt to fix redundant /ipfs/ namespace as long resulting + if pathErr := parsedPath.IsValid(); pathErr != nil { + // Attempt to fix redundant /ipfs/ namespace as long as resulting // 'intended' path is valid. This is in case gremlins were tickled // wrong way and user ended up at /ipfs/ipfs/{cid} or /ipfs/ipns/{id} // like in bafybeien3m7mdn6imm425vc2s22erzyhbvk5n3ofzgikkhmdkh5cuqbpbq // :^)) intendedPath := ipath.New(strings.TrimPrefix(urlPath, "/ipfs")) - if err2 := intendedPath.IsValid(); err2 == nil { + if err := intendedPath.IsValid(); err == nil { intendedURL := strings.Replace(r.URL.String(), urlPath, intendedPath.String(), 1) - http.Redirect(w, r, intendedURL, http.StatusMovedPermanently) + // return HTML that + // - points at correct canonical path via header + // - displays error + // - redirects to intendedURL after a delay + err = redirectTemplate.Execute(w, redirectTemplateData{ + RedirectURL: intendedURL, + SuggestedPath: intendedPath.String(), + ErrorMsg: pathErr.Error(), + }) + if err != nil { + internalWebError(w, err) + return + } return } - webError(w, "invalid ipfs path", err, http.StatusBadRequest) + // unable to fix path, returning error + webError(w, "invalid ipfs path", pathErr, http.StatusBadRequest) return } diff --git a/test/sharness/t0110-gateway.sh b/test/sharness/t0110-gateway.sh index 45feca45e9b..84bc963410d 100755 --- a/test/sharness/t0110-gateway.sh +++ b/test/sharness/t0110-gateway.sh @@ -84,10 +84,11 @@ test_expect_success "GET IPFS nonexistent file returns code expected (404)" ' test_curl_resp_http_code "http://127.0.0.1:$port/ipfs/$HASH2/pleaseDontAddMe" "HTTP/1.1 404 Not Found" ' -test_expect_success "GET /ipfs/ipfs/{cid} returns redirect to the valid path" " - curl -sI -o response_with_double_ipfs_ns \"http://127.0.0.1:$port/ipfs/ipfs/bafkqaaa?query=to-remember\" && - test_should_contain \"Location: /ipfs/bafkqaaa?query=to-remember\" response_with_double_ipfs_ns -" +test_expect_success "GET /ipfs/ipfs/{cid} returns redirect to the valid path" ' + curl -sD - "http://127.0.0.1:$port/ipfs/ipfs/bafkqaaa?query=to-remember" > response_with_double_ipfs_ns && + test_should_contain "" response_with_double_ipfs_ns && + test_should_contain "" response_with_double_ipfs_ns +' test_expect_failure "GET IPNS path succeeds" ' ipfs name publish --allow-offline "$HASH" && @@ -102,8 +103,9 @@ test_expect_failure "GET IPNS path output looks good" ' test_expect_success "GET /ipfs/ipns/{peerid} returns redirect to the valid path" ' PEERID=$(ipfs config Identity.PeerID) && - curl -sI -o response_with_ipfs_ipns_ns "http://127.0.0.1:$port/ipfs/ipns/${PEERID}?query=to-remember" && - test_should_contain "Location: /ipns/${PEERID}?query=to-remember" response_with_ipfs_ipns_ns + curl -sD - "http://127.0.0.1:$port/ipfs/ipns/${PEERID}?query=to-remember" > response_with_ipfs_ipns_ns && + test_should_contain "" response_with_ipfs_ipns_ns && + test_should_contain "" response_with_ipfs_ipns_ns ' test_expect_success "GET invalid IPFS path errors" ' From d631204deeea7da9ee9f6212fd23ef7b67dcebe2 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 27 Feb 2021 18:33:13 +0800 Subject: [PATCH 039/161] fix race condition when logging requests --- commands/context.go | 1 - commands/reqlog.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/context.go b/commands/context.go index e306821e83c..e43672eee49 100644 --- a/commands/context.go +++ b/commands/context.go @@ -117,7 +117,6 @@ func (c *Context) LogRequest(req *cmds.Request) func() { Command: strings.Join(req.Path, "/"), Options: req.Options, Args: req.Arguments, - ID: c.ReqLog.nextID, log: c.ReqLog, } c.ReqLog.AddEntry(rle) diff --git a/commands/reqlog.go b/commands/reqlog.go index 55488ab3eee..cd52d75bf2f 100644 --- a/commands/reqlog.go +++ b/commands/reqlog.go @@ -38,6 +38,7 @@ func (rl *ReqLog) AddEntry(rle *ReqLogEntry) { rl.lock.Lock() defer rl.lock.Unlock() + rle.ID = rl.nextID rl.nextID++ rl.Requests = append(rl.Requests, rle) From 6e2b1667733c74ca25780d29829474a5cda15baa Mon Sep 17 00:00:00 2001 From: Will Scott Date: Wed, 10 Mar 2021 12:14:50 -0800 Subject: [PATCH 040/161] split core/commands/dag into individual files for different subcommands --- core/commands/dag/dag.go | 535 ++--------------------------------- core/commands/dag/export.go | 155 ++++++++++ core/commands/dag/get.go | 38 +++ core/commands/dag/import.go | 201 +++++++++++++ core/commands/dag/put.go | 80 ++++++ core/commands/dag/resolve.go | 25 ++ core/commands/dag/stat.go | 90 ++++++ 7 files changed, 606 insertions(+), 518 deletions(-) create mode 100644 core/commands/dag/export.go create mode 100644 core/commands/dag/get.go create mode 100644 core/commands/dag/import.go create mode 100644 core/commands/dag/put.go create mode 100644 core/commands/dag/resolve.go create mode 100644 core/commands/dag/stat.go diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index bee389673d8..005847039d7 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -1,37 +1,18 @@ package dagcmd import ( - "errors" "fmt" "io" - "math" - "os" - "strings" - "time" "github.com/ipfs/go-ipfs/core/commands/cmdenv" - "github.com/ipfs/go-ipfs/core/commands/e" - "github.com/ipfs/go-ipfs/core/coredag" - iface "github.com/ipfs/interface-go-ipfs-core" cid "github.com/ipfs/go-cid" cidenc "github.com/ipfs/go-cidutil/cidenc" cmds "github.com/ipfs/go-ipfs-cmds" - files "github.com/ipfs/go-ipfs-files" - ipld "github.com/ipfs/go-ipld-format" - mdag "github.com/ipfs/go-merkledag" - traverse "github.com/ipfs/go-merkledag/traverse" ipfspath "github.com/ipfs/go-path" - "github.com/ipfs/interface-go-ipfs-core/options" - path "github.com/ipfs/interface-go-ipfs-core/path" - mh "github.com/multiformats/go-multihash" - - gocar "github.com/ipld/go-car" //gipfree "github.com/ipld/go-ipld-prime/impl/free" //gipselector "github.com/ipld/go-ipld-prime/traversal/selector" //gipselectorbuilder "github.com/ipld/go-ipld-prime/traversal/selector/builder" - - "github.com/cheggaaa/pb" ) const ( @@ -40,6 +21,7 @@ const ( pinRootsOptionName = "pin-roots" ) +// DagCmd provides a subset of commands for interacting with ipld dag objects var DagCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Interact with ipld dag objects.", @@ -75,11 +57,14 @@ type ResolveOutput struct { type CarImportOutput struct { Root RootMeta } + +// RootMeta is the metadata for a root pinning response type RootMeta struct { Cid cid.Cid PinErrorMsg string } +// DagPutCmd is a command for adding a dag node var DagPutCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Add a dag node to ipfs.", @@ -97,71 +82,7 @@ into an object of the specified format. cmds.BoolOption("pin", "Pin this object when adding."), cmds.StringOption("hash", "Hash function to use").WithDefault(""), }, - Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - api, err := cmdenv.GetApi(env, req) - if err != nil { - return err - } - - ienc, _ := req.Options["input-enc"].(string) - format, _ := req.Options["format"].(string) - hash, _ := req.Options["hash"].(string) - dopin, _ := req.Options["pin"].(bool) - - // mhType tells inputParser which hash should be used. MaxUint64 means 'use - // default hash' (sha256 for cbor, sha1 for git..) - mhType := uint64(math.MaxUint64) - - if hash != "" { - var ok bool - mhType, ok = mh.Names[hash] - if !ok { - return fmt.Errorf("%s in not a valid multihash name", hash) - } - } - - var adder ipld.NodeAdder = api.Dag() - if dopin { - adder = api.Dag().Pinning() - } - b := ipld.NewBatch(req.Context, adder) - - it := req.Files.Entries() - for it.Next() { - file := files.FileFromEntry(it) - if file == nil { - return fmt.Errorf("expected a regular file") - } - nds, err := coredag.ParseInputs(ienc, format, file, mhType, -1) - if err != nil { - return err - } - if len(nds) == 0 { - return fmt.Errorf("no node returned from ParseInputs") - } - - for _, nd := range nds { - err := b.Add(req.Context, nd) - if err != nil { - return err - } - } - - cid := nds[0].Cid() - if err := res.Emit(&OutputObject{Cid: cid}); err != nil { - return err - } - } - if it.Err() != nil { - return it.Err() - } - - if err := b.Commit(); err != nil { - return err - } - - return nil - }, + Run: dagPut, Type: OutputObject{}, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *OutputObject) error { @@ -175,6 +96,7 @@ into an object of the specified format. }, } +// DagGetCmd is a command for getting a dag node from IPFS var DagGetCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Get a dag node from ipfs.", @@ -186,33 +108,7 @@ format. Arguments: []cmds.Argument{ cmds.StringArg("ref", true, false, "The object to get").EnableStdin(), }, - Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - api, err := cmdenv.GetApi(env, req) - if err != nil { - return err - } - - rp, err := api.ResolvePath(req.Context, path.New(req.Arguments[0])) - if err != nil { - return err - } - - obj, err := api.Dag().Get(req.Context, rp.Cid()) - if err != nil { - return err - } - - var out interface{} = obj - if len(rp.Remainder()) > 0 { - rem := strings.Split(rp.Remainder(), "/") - final, _, err := obj.Resolve(rem) - if err != nil { - return err - } - out = final - } - return cmds.EmitOnce(res, &out) - }, + Run: dagGet, } // DagResolveCmd returns address of highest block within a path and a path remainder @@ -226,22 +122,7 @@ var DagResolveCmd = &cmds.Command{ Arguments: []cmds.Argument{ cmds.StringArg("ref", true, false, "The path to resolve").EnableStdin(), }, - Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - api, err := cmdenv.GetApi(env, req) - if err != nil { - return err - } - - rp, err := api.ResolvePath(req.Context, path.New(req.Arguments[0])) - if err != nil { - return err - } - - return cmds.EmitOnce(res, &ResolveOutput{ - Cid: rp.Cid(), - RemPath: rp.Remainder(), - }) - }, + Run: dagResolve, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *ResolveOutput) error { var ( @@ -280,6 +161,7 @@ type importResult struct { err error } +// DagImportCmd is a command for importing a car to ipfs var DagImportCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Import the contents of .car files", @@ -312,107 +194,7 @@ Maximum supported CAR version: 1 cmds.BoolOption(pinRootsOptionName, "Pin optional roots listed in the .car headers after importing.").WithDefault(true), }, Type: CarImportOutput{}, - Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - - node, err := cmdenv.GetNode(env) - if err != nil { - return err - } - - api, err := cmdenv.GetApi(env, req) - if err != nil { - return err - } - - // on import ensure we do not reach out to the network for any reason - // if a pin based on what is imported + what is in the blockstore - // isn't possible: tough luck - api, err = api.WithOptions(options.Api.Offline(true)) - if err != nil { - return err - } - - // grab a pinlock ( which doubles as a GC lock ) so that regardless of the - // size of the streamed-in cars nothing will disappear on us before we had - // a chance to roots that may show up at the very end - // This is especially important for use cases like dagger: - // ipfs dag import $( ... | ipfs-dagger --stdout=carfifos ) - // - unlocker := node.Blockstore.PinLock() - defer unlocker.Unlock() - - doPinRoots, _ := req.Options[pinRootsOptionName].(bool) - - retCh := make(chan importResult, 1) - go importWorker(req, res, api, retCh) - - done := <-retCh - if done.err != nil { - return done.err - } - - // It is not guaranteed that a root in a header is actually present in the same ( or any ) - // .car file. This is the case in version 1, and ideally in further versions too - // Accumulate any root CID seen in a header, and supplement its actual node if/when encountered - // We will attempt a pin *only* at the end in case all car files were well formed - // - // The boolean value indicates whether we have encountered the root within the car file's - roots := done.roots - - // opportunistic pinning: try whatever sticks - if doPinRoots { - - var failedPins int - for c := range roots { - - // We need to re-retrieve a block, convert it to ipld, and feed it - // to the Pinning interface, sigh... - // - // If we didn't have the problem of inability to take multiple pinlocks, - // we could use the api directly like so (though internally it does the same): - // - // // not ideal, but the pinning api takes only paths :( - // rp := path.NewResolvedPath( - // ipfspath.FromCid(c), - // c, - // c, - // "", - // ) - // - // if err := api.Pin().Add(req.Context, rp, options.Pin.Recursive(true)); err != nil { - - ret := RootMeta{Cid: c} - - if block, err := node.Blockstore.Get(c); err != nil { - ret.PinErrorMsg = err.Error() - } else if nd, err := ipld.Decode(block); err != nil { - ret.PinErrorMsg = err.Error() - } else if err := node.Pinning.Pin(req.Context, nd, true); err != nil { - ret.PinErrorMsg = err.Error() - } else if err := node.Pinning.Flush(req.Context); err != nil { - ret.PinErrorMsg = err.Error() - } - - if ret.PinErrorMsg != "" { - failedPins++ - } - - if err := res.Emit(&CarImportOutput{Root: ret}); err != nil { - return err - } - } - - if failedPins > 0 { - return fmt.Errorf( - "unable to pin all roots: %d out of %d failed", - failedPins, - len(roots), - ) - } - } - - return nil - }, + Run: dagImport, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, event *CarImportOutput) error { @@ -443,88 +225,7 @@ Maximum supported CAR version: 1 }, } -func importWorker(req *cmds.Request, re cmds.ResponseEmitter, api iface.CoreAPI, ret chan importResult) { - - // this is *not* a transaction - // it is simply a way to relieve pressure on the blockstore - // similar to pinner.Pin/pinner.Flush - batch := ipld.NewBatch(req.Context, api.Dag()) - - roots := make(map[cid.Cid]struct{}) - - it := req.Files.Entries() - for it.Next() { - - file := files.FileFromEntry(it) - if file == nil { - ret <- importResult{err: errors.New("expected a file handle")} - return - } - - // wrap a defer-closer-scope - // - // every single file in it() is already open before we start - // just close here sooner rather than later for neatness - // and to surface potential errors writing on closed fifos - // this won't/can't help with not running out of handles - err := func() error { - defer file.Close() - - car, err := gocar.NewCarReader(file) - if err != nil { - return err - } - - // Be explicit here, until the spec is finished - if car.Header.Version != 1 { - return errors.New("only car files version 1 supported at present") - } - - for _, c := range car.Header.Roots { - roots[c] = struct{}{} - } - - for { - block, err := car.Next() - if err != nil && err != io.EOF { - return err - } else if block == nil { - break - } - - // the double-decode is suboptimal, but we need it for batching - nd, err := ipld.Decode(block) - if err != nil { - return err - } - - if err := batch.Add(req.Context, nd); err != nil { - return err - } - } - - return nil - }() - - if err != nil { - ret <- importResult{err: err} - return - } - } - - if err := it.Err(); err != nil { - ret <- importResult{err: err} - return - } - - if err := batch.Commit(); err != nil { - ret <- importResult{err: err} - return - } - - ret <- importResult{roots: roots} -} - +// DagExportCmd is a command for exporting an ipfs dag to a car var DagExportCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Streams the selected DAG as a .car stream on stdout.", @@ -540,145 +241,13 @@ The output of blocks happens in strict DAG-traversal, first-seen, order. Options: []cmds.Option{ cmds.BoolOption(progressOptionName, "p", "Display progress on CLI. Defaults to true when STDERR is a TTY."), }, - Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - - c, err := cid.Decode(req.Arguments[0]) - if err != nil { - return fmt.Errorf( - "unable to parse root specification (currently only bare CIDs are supported): %s", - err, - ) - } - - api, err := cmdenv.GetApi(env, req) - if err != nil { - return err - } - - // Code disabled until descent-issue in go-ipld-prime is fixed - // https://github.com/ribasushi/gip-muddle-up - // - // sb := gipselectorbuilder.NewSelectorSpecBuilder(gipfree.NodeBuilder()) - // car := gocar.NewSelectiveCar( - // req.Context, - // , - // []gocar.Dag{gocar.Dag{ - // Root: c, - // Selector: sb.ExploreRecursive( - // gipselector.RecursionLimitNone(), - // sb.ExploreAll(sb.ExploreRecursiveEdge()), - // ).Node(), - // }}, - // ) - // ... - // if err := car.Write(pipeW); err != nil {} - - pipeR, pipeW := io.Pipe() - - errCh := make(chan error, 2) // we only report the 1st error - go func() { - defer func() { - if err := pipeW.Close(); err != nil { - errCh <- fmt.Errorf("stream flush failed: %s", err) - } - close(errCh) - }() - - if err := gocar.WriteCar( - req.Context, - mdag.NewSession( - req.Context, - api.Dag(), - ), - []cid.Cid{c}, - pipeW, - ); err != nil { - errCh <- err - } - }() - - if err := res.Emit(pipeR); err != nil { - pipeR.Close() // ignore the error if any - return err - } - - err = <-errCh - - // minimal user friendliness - if err != nil && - err == ipld.ErrNotFound { - explicitOffline, _ := req.Options["offline"].(bool) - if explicitOffline { - err = fmt.Errorf("%s (currently offline, perhaps retry without the offline flag)", err) - } else { - node, envErr := cmdenv.GetNode(env) - if envErr == nil && !node.IsOnline { - err = fmt.Errorf("%s (currently offline, perhaps retry after attaching to the network)", err) - } - } - } - - return err - }, + Run: dagExport, PostRun: cmds.PostRunMap{ - cmds.CLI: func(res cmds.Response, re cmds.ResponseEmitter) error { - - var showProgress bool - val, specified := res.Request().Options[progressOptionName] - if !specified { - // default based on TTY availability - errStat, _ := os.Stderr.Stat() - if 0 != (errStat.Mode() & os.ModeCharDevice) { - showProgress = true - } - } else if val.(bool) { - showProgress = true - } - - // simple passthrough, no progress - if !showProgress { - return cmds.Copy(re, res) - } - - bar := pb.New64(0).SetUnits(pb.U_BYTES) - bar.Output = os.Stderr - bar.ShowSpeed = true - bar.ShowElapsedTime = true - bar.RefreshRate = 500 * time.Millisecond - bar.Start() - - var processedOneResponse bool - for { - v, err := res.Next() - if err == io.EOF { - - // We only write the final bar update on success - // On error it looks too weird - bar.Finish() - - return re.Close() - } else if err != nil { - return re.CloseWithError(err) - } else if processedOneResponse { - return re.CloseWithError(errors.New("unexpected multipart response during emit, please file a bugreport")) - } - - r, ok := v.(io.Reader) - if !ok { - // some sort of encoded response, this should not be happening - return errors.New("unexpected non-stream passed to PostRun: please file a bugreport") - } - - processedOneResponse = true - - if err := re.Emit(bar.NewProxyReader(r)); err != nil { - return err - } - } - }, + cmds.CLI: finishCLIExport, }, } +// DagStat is a dag stat command response type DagStat struct { Size uint64 NumBlocks int64 @@ -688,6 +257,7 @@ func (s *DagStat) String() string { return fmt.Sprintf("Size: %d, NumBlocks: %d", s.Size, s.NumBlocks) } +// DagStatCmd is a command for getting size information about an ipfs-stored dag var DagStatCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Gets stats for a DAG", @@ -704,81 +274,10 @@ Note: This command skips duplicate blocks in reporting both size and the number Options: []cmds.Option{ cmds.BoolOption(progressOptionName, "p", "Return progressive data while reading through the DAG").WithDefault(true), }, - Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { - progressive := req.Options[progressOptionName].(bool) - - api, err := cmdenv.GetApi(env, req) - if err != nil { - return err - } - - rp, err := api.ResolvePath(req.Context, path.New(req.Arguments[0])) - if err != nil { - return err - } - - if len(rp.Remainder()) > 0 { - return fmt.Errorf("cannot return size for anything other than a DAG with a root CID") - } - - nodeGetter := mdag.NewSession(req.Context, api.Dag()) - obj, err := nodeGetter.Get(req.Context, rp.Cid()) - if err != nil { - return err - } - - dagstats := &DagStat{} - err = traverse.Traverse(obj, traverse.Options{ - DAG: nodeGetter, - Order: traverse.DFSPre, - Func: func(current traverse.State) error { - dagstats.Size += uint64(len(current.Node.RawData())) - dagstats.NumBlocks++ - - if progressive { - if err := res.Emit(dagstats); err != nil { - return err - } - } - return nil - }, - ErrFunc: nil, - SkipDuplicates: true, - }) - if err != nil { - return fmt.Errorf("error traversing DAG: %w", err) - } - - if !progressive { - if err := res.Emit(dagstats); err != nil { - return err - } - } - - return nil - }, + Run: dagStat, Type: DagStat{}, PostRun: cmds.PostRunMap{ - cmds.CLI: func(res cmds.Response, re cmds.ResponseEmitter) error { - var dagStats *DagStat - for { - v, err := res.Next() - if err != nil { - if err == io.EOF { - break - } - return err - } - - out, ok := v.(*DagStat) - if !ok { - return e.TypeErr(out, v) - } - dagStats = out - fmt.Fprintf(os.Stderr, "%v\r", out) - } - return re.Emit(dagStats) - }, + cmds.CLI: finishCLIStat, }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, event *DagStat) error { diff --git a/core/commands/dag/export.go b/core/commands/dag/export.go new file mode 100644 index 00000000000..bff9dc47929 --- /dev/null +++ b/core/commands/dag/export.go @@ -0,0 +1,155 @@ +package dagcmd + +import ( + "errors" + "fmt" + "io" + "os" + "time" + + "github.com/cheggaaa/pb" + cid "github.com/ipfs/go-cid" + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + ipld "github.com/ipfs/go-ipld-format" + mdag "github.com/ipfs/go-merkledag" + + cmds "github.com/ipfs/go-ipfs-cmds" + gocar "github.com/ipld/go-car" +) + +func dagExport(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + + c, err := cid.Decode(req.Arguments[0]) + if err != nil { + return fmt.Errorf( + "unable to parse root specification (currently only bare CIDs are supported): %s", + err, + ) + } + + api, err := cmdenv.GetApi(env, req) + if err != nil { + return err + } + + // Code disabled until descent-issue in go-ipld-prime is fixed + // https://github.com/ribasushi/gip-muddle-up + // + // sb := gipselectorbuilder.NewSelectorSpecBuilder(gipfree.NodeBuilder()) + // car := gocar.NewSelectiveCar( + // req.Context, + // , + // []gocar.Dag{gocar.Dag{ + // Root: c, + // Selector: sb.ExploreRecursive( + // gipselector.RecursionLimitNone(), + // sb.ExploreAll(sb.ExploreRecursiveEdge()), + // ).Node(), + // }}, + // ) + // ... + // if err := car.Write(pipeW); err != nil {} + + pipeR, pipeW := io.Pipe() + + errCh := make(chan error, 2) // we only report the 1st error + go func() { + defer func() { + if err := pipeW.Close(); err != nil { + errCh <- fmt.Errorf("stream flush failed: %s", err) + } + close(errCh) + }() + + if err := gocar.WriteCar( + req.Context, + mdag.NewSession( + req.Context, + api.Dag(), + ), + []cid.Cid{c}, + pipeW, + ); err != nil { + errCh <- err + } + }() + + if err := res.Emit(pipeR); err != nil { + pipeR.Close() // ignore the error if any + return err + } + + err = <-errCh + + // minimal user friendliness + if err != nil && + err == ipld.ErrNotFound { + explicitOffline, _ := req.Options["offline"].(bool) + if explicitOffline { + err = fmt.Errorf("%s (currently offline, perhaps retry without the offline flag)", err) + } else { + node, envErr := cmdenv.GetNode(env) + if envErr == nil && !node.IsOnline { + err = fmt.Errorf("%s (currently offline, perhaps retry after attaching to the network)", err) + } + } + } + + return err +} + +func finishCLIExport(res cmds.Response, re cmds.ResponseEmitter) error { + + var showProgress bool + val, specified := res.Request().Options[progressOptionName] + if !specified { + // default based on TTY availability + errStat, _ := os.Stderr.Stat() + if 0 != (errStat.Mode() & os.ModeCharDevice) { + showProgress = true + } + } else if val.(bool) { + showProgress = true + } + + // simple passthrough, no progress + if !showProgress { + return cmds.Copy(re, res) + } + + bar := pb.New64(0).SetUnits(pb.U_BYTES) + bar.Output = os.Stderr + bar.ShowSpeed = true + bar.ShowElapsedTime = true + bar.RefreshRate = 500 * time.Millisecond + bar.Start() + + var processedOneResponse bool + for { + v, err := res.Next() + if err == io.EOF { + + // We only write the final bar update on success + // On error it looks too weird + bar.Finish() + + return re.Close() + } else if err != nil { + return re.CloseWithError(err) + } else if processedOneResponse { + return re.CloseWithError(errors.New("unexpected multipart response during emit, please file a bugreport")) + } + + r, ok := v.(io.Reader) + if !ok { + // some sort of encoded response, this should not be happening + return errors.New("unexpected non-stream passed to PostRun: please file a bugreport") + } + + processedOneResponse = true + + if err := re.Emit(bar.NewProxyReader(r)); err != nil { + return err + } + } +} diff --git a/core/commands/dag/get.go b/core/commands/dag/get.go new file mode 100644 index 00000000000..a5f92273ae3 --- /dev/null +++ b/core/commands/dag/get.go @@ -0,0 +1,38 @@ +package dagcmd + +import ( + "strings" + + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + "github.com/ipfs/interface-go-ipfs-core/path" + + cmds "github.com/ipfs/go-ipfs-cmds" +) + +func dagGet(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + api, err := cmdenv.GetApi(env, req) + if err != nil { + return err + } + + rp, err := api.ResolvePath(req.Context, path.New(req.Arguments[0])) + if err != nil { + return err + } + + obj, err := api.Dag().Get(req.Context, rp.Cid()) + if err != nil { + return err + } + + var out interface{} = obj + if len(rp.Remainder()) > 0 { + rem := strings.Split(rp.Remainder(), "/") + final, _, err := obj.Resolve(rem) + if err != nil { + return err + } + out = final + } + return cmds.EmitOnce(res, &out) +} diff --git a/core/commands/dag/import.go b/core/commands/dag/import.go new file mode 100644 index 00000000000..b83af8b911d --- /dev/null +++ b/core/commands/dag/import.go @@ -0,0 +1,201 @@ +package dagcmd + +import ( + "errors" + "fmt" + "io" + + cid "github.com/ipfs/go-cid" + files "github.com/ipfs/go-ipfs-files" + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + ipld "github.com/ipfs/go-ipld-format" + iface "github.com/ipfs/interface-go-ipfs-core" + "github.com/ipfs/interface-go-ipfs-core/options" + + cmds "github.com/ipfs/go-ipfs-cmds" + gocar "github.com/ipld/go-car" +) + +func dagImport(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + + node, err := cmdenv.GetNode(env) + if err != nil { + return err + } + + api, err := cmdenv.GetApi(env, req) + if err != nil { + return err + } + + // on import ensure we do not reach out to the network for any reason + // if a pin based on what is imported + what is in the blockstore + // isn't possible: tough luck + api, err = api.WithOptions(options.Api.Offline(true)) + if err != nil { + return err + } + + // grab a pinlock ( which doubles as a GC lock ) so that regardless of the + // size of the streamed-in cars nothing will disappear on us before we had + // a chance to roots that may show up at the very end + // This is especially important for use cases like dagger: + // ipfs dag import $( ... | ipfs-dagger --stdout=carfifos ) + // + unlocker := node.Blockstore.PinLock() + defer unlocker.Unlock() + + doPinRoots, _ := req.Options[pinRootsOptionName].(bool) + + retCh := make(chan importResult, 1) + go importWorker(req, res, api, retCh) + + done := <-retCh + if done.err != nil { + return done.err + } + + // It is not guaranteed that a root in a header is actually present in the same ( or any ) + // .car file. This is the case in version 1, and ideally in further versions too + // Accumulate any root CID seen in a header, and supplement its actual node if/when encountered + // We will attempt a pin *only* at the end in case all car files were well formed + // + // The boolean value indicates whether we have encountered the root within the car file's + roots := done.roots + + // opportunistic pinning: try whatever sticks + if doPinRoots { + + var failedPins int + for c := range roots { + + // We need to re-retrieve a block, convert it to ipld, and feed it + // to the Pinning interface, sigh... + // + // If we didn't have the problem of inability to take multiple pinlocks, + // we could use the api directly like so (though internally it does the same): + // + // // not ideal, but the pinning api takes only paths :( + // rp := path.NewResolvedPath( + // ipfspath.FromCid(c), + // c, + // c, + // "", + // ) + // + // if err := api.Pin().Add(req.Context, rp, options.Pin.Recursive(true)); err != nil { + + ret := RootMeta{Cid: c} + + if block, err := node.Blockstore.Get(c); err != nil { + ret.PinErrorMsg = err.Error() + } else if nd, err := ipld.Decode(block); err != nil { + ret.PinErrorMsg = err.Error() + } else if err := node.Pinning.Pin(req.Context, nd, true); err != nil { + ret.PinErrorMsg = err.Error() + } else if err := node.Pinning.Flush(req.Context); err != nil { + ret.PinErrorMsg = err.Error() + } + + if ret.PinErrorMsg != "" { + failedPins++ + } + + if err := res.Emit(&CarImportOutput{Root: ret}); err != nil { + return err + } + } + + if failedPins > 0 { + return fmt.Errorf( + "unable to pin all roots: %d out of %d failed", + failedPins, + len(roots), + ) + } + } + + return nil +} + +func importWorker(req *cmds.Request, re cmds.ResponseEmitter, api iface.CoreAPI, ret chan importResult) { + + // this is *not* a transaction + // it is simply a way to relieve pressure on the blockstore + // similar to pinner.Pin/pinner.Flush + batch := ipld.NewBatch(req.Context, api.Dag()) + + roots := make(map[cid.Cid]struct{}) + + it := req.Files.Entries() + for it.Next() { + + file := files.FileFromEntry(it) + if file == nil { + ret <- importResult{err: errors.New("expected a file handle")} + return + } + + // wrap a defer-closer-scope + // + // every single file in it() is already open before we start + // just close here sooner rather than later for neatness + // and to surface potential errors writing on closed fifos + // this won't/can't help with not running out of handles + err := func() error { + defer file.Close() + + car, err := gocar.NewCarReader(file) + if err != nil { + return err + } + + // Be explicit here, until the spec is finished + if car.Header.Version != 1 { + return errors.New("only car files version 1 supported at present") + } + + for _, c := range car.Header.Roots { + roots[c] = struct{}{} + } + + for { + block, err := car.Next() + if err != nil && err != io.EOF { + return err + } else if block == nil { + break + } + + // the double-decode is suboptimal, but we need it for batching + nd, err := ipld.Decode(block) + if err != nil { + return err + } + + if err := batch.Add(req.Context, nd); err != nil { + return err + } + } + + return nil + }() + + if err != nil { + ret <- importResult{err: err} + return + } + } + + if err := it.Err(); err != nil { + ret <- importResult{err: err} + return + } + + if err := batch.Commit(); err != nil { + ret <- importResult{err: err} + return + } + + ret <- importResult{roots: roots} +} diff --git a/core/commands/dag/put.go b/core/commands/dag/put.go new file mode 100644 index 00000000000..7f6e744c872 --- /dev/null +++ b/core/commands/dag/put.go @@ -0,0 +1,80 @@ +package dagcmd + +import ( + "fmt" + "math" + + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + "github.com/ipfs/go-ipfs/core/coredag" + + cmds "github.com/ipfs/go-ipfs-cmds" + files "github.com/ipfs/go-ipfs-files" + ipld "github.com/ipfs/go-ipld-format" + mh "github.com/multiformats/go-multihash" +) + +func dagPut(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + api, err := cmdenv.GetApi(env, req) + if err != nil { + return err + } + + ienc, _ := req.Options["input-enc"].(string) + format, _ := req.Options["format"].(string) + hash, _ := req.Options["hash"].(string) + dopin, _ := req.Options["pin"].(bool) + + // mhType tells inputParser which hash should be used. MaxUint64 means 'use + // default hash' (sha256 for cbor, sha1 for git..) + mhType := uint64(math.MaxUint64) + + if hash != "" { + var ok bool + mhType, ok = mh.Names[hash] + if !ok { + return fmt.Errorf("%s in not a valid multihash name", hash) + } + } + + var adder ipld.NodeAdder = api.Dag() + if dopin { + adder = api.Dag().Pinning() + } + b := ipld.NewBatch(req.Context, adder) + + it := req.Files.Entries() + for it.Next() { + file := files.FileFromEntry(it) + if file == nil { + return fmt.Errorf("expected a regular file") + } + nds, err := coredag.ParseInputs(ienc, format, file, mhType, -1) + if err != nil { + return err + } + if len(nds) == 0 { + return fmt.Errorf("no node returned from ParseInputs") + } + + for _, nd := range nds { + err := b.Add(req.Context, nd) + if err != nil { + return err + } + } + + cid := nds[0].Cid() + if err := res.Emit(&OutputObject{Cid: cid}); err != nil { + return err + } + } + if it.Err() != nil { + return it.Err() + } + + if err := b.Commit(); err != nil { + return err + } + + return nil +} diff --git a/core/commands/dag/resolve.go b/core/commands/dag/resolve.go new file mode 100644 index 00000000000..836138368b0 --- /dev/null +++ b/core/commands/dag/resolve.go @@ -0,0 +1,25 @@ +package dagcmd + +import ( + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + "github.com/ipfs/interface-go-ipfs-core/path" + + cmds "github.com/ipfs/go-ipfs-cmds" +) + +func dagResolve(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + api, err := cmdenv.GetApi(env, req) + if err != nil { + return err + } + + rp, err := api.ResolvePath(req.Context, path.New(req.Arguments[0])) + if err != nil { + return err + } + + return cmds.EmitOnce(res, &ResolveOutput{ + Cid: rp.Cid(), + RemPath: rp.Remainder(), + }) +} diff --git a/core/commands/dag/stat.go b/core/commands/dag/stat.go new file mode 100644 index 00000000000..3e3336f2322 --- /dev/null +++ b/core/commands/dag/stat.go @@ -0,0 +1,90 @@ +package dagcmd + +import ( + "fmt" + "io" + "os" + + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + "github.com/ipfs/go-ipfs/core/commands/e" + "github.com/ipfs/go-merkledag/traverse" + "github.com/ipfs/interface-go-ipfs-core/path" + + cmds "github.com/ipfs/go-ipfs-cmds" + mdag "github.com/ipfs/go-merkledag" +) + +func dagStat(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + progressive := req.Options[progressOptionName].(bool) + + api, err := cmdenv.GetApi(env, req) + if err != nil { + return err + } + + rp, err := api.ResolvePath(req.Context, path.New(req.Arguments[0])) + if err != nil { + return err + } + + if len(rp.Remainder()) > 0 { + return fmt.Errorf("cannot return size for anything other than a DAG with a root CID") + } + + nodeGetter := mdag.NewSession(req.Context, api.Dag()) + obj, err := nodeGetter.Get(req.Context, rp.Cid()) + if err != nil { + return err + } + + dagstats := &DagStat{} + err = traverse.Traverse(obj, traverse.Options{ + DAG: nodeGetter, + Order: traverse.DFSPre, + Func: func(current traverse.State) error { + dagstats.Size += uint64(len(current.Node.RawData())) + dagstats.NumBlocks++ + + if progressive { + if err := res.Emit(dagstats); err != nil { + return err + } + } + return nil + }, + ErrFunc: nil, + SkipDuplicates: true, + }) + if err != nil { + return fmt.Errorf("error traversing DAG: %w", err) + } + + if !progressive { + if err := res.Emit(dagstats); err != nil { + return err + } + } + + return nil +} + +func finishCLIStat(res cmds.Response, re cmds.ResponseEmitter) error { + var dagStats *DagStat + for { + v, err := res.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + out, ok := v.(*DagStat) + if !ok { + return e.TypeErr(out, v) + } + dagStats = out + fmt.Fprintf(os.Stderr, "%v\r", out) + } + return re.Emit(dagStats) +} From eb53fc7c3460f035bca4d62609a37c1f239bcebb Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 10 Mar 2021 17:34:13 -0800 Subject: [PATCH 041/161] test(sharness): pass correct timeout format to go-timeout It takes a number, not a duration. Unfortunately, it will _also_ exit with a status of 1 in this case so the test passes. --- test/sharness/t0275-cid-security.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sharness/t0275-cid-security.sh b/test/sharness/t0275-cid-security.sh index 34e6e3192f3..6bf3a90cabf 100755 --- a/test/sharness/t0275-cid-security.sh +++ b/test/sharness/t0275-cid-security.sh @@ -78,7 +78,7 @@ test_expect_success "add block linking to insecure" ' ' test_expect_success "ipfs cat fails with code 1 and not timeout" ' - test_expect_code 1 go-timeout 1s ipfs cat QmVpsktzNeJdfWEpyeix93QJdQaBSgRNxebSbYSo9SQPGx + test_expect_code 1 go-timeout 1 ipfs cat QmVpsktzNeJdfWEpyeix93QJdQaBSgRNxebSbYSo9SQPGx ' test_kill_ipfs_daemon From 98ee5abe5f3073c6dd35110134fea6412276b6ff Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 11 Mar 2021 11:20:47 -0800 Subject: [PATCH 042/161] fix: return an error if repo verify is canceled fixes #7957 --- core/commands/repo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/commands/repo.go b/core/commands/repo.go index 0a91648a88c..307b4ffc58f 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -313,6 +313,10 @@ var repoVerifyCmd = &cmds.Command{ } } + if err := req.Context.Err(); err != nil { + return err + } + if fails != 0 { return errors.New("verify complete, some blocks were corrupt") } From 3db9551f7948809e6f9104651412557fbde08af0 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 19 Feb 2021 00:33:43 +0100 Subject: [PATCH 043/161] Extract the namesys and the keystore submodules Namesys is a very useful submodule. Given a ValueStore and a Datastore it can resolve and publish /ipns/ paths. This functionality does not need to be sequestered inside go-ipfs as it can and should be used without IPFS, for example, for implementing lightweight IPNS publishing services or for resolving /ipns/ paths. "keystore" extraction was necessary, as there is a dependency to it in namesys. Keystore is also a useful module by itself within the stack. Fixes #6537 --- cmd/ipfs/init.go | 2 +- core/commands/dht_test.go | 2 +- core/commands/dns.go | 2 +- core/commands/name/ipns.go | 2 +- core/commands/resolve.go | 2 +- core/core.go | 4 +- core/coreapi/coreapi.go | 2 +- core/coreapi/name.go | 4 +- core/coreapi/path.go | 2 +- core/coreapi/test/api_test.go | 2 +- core/corehttp/gateway_test.go | 2 +- core/corehttp/hostname.go | 2 +- core/node/ipns.go | 4 +- fuse/ipns/common.go | 2 +- go.mod | 8 +- go.sum | 96 ++++++- keystore/keystore.go | 189 -------------- keystore/keystore_test.go | 278 -------------------- keystore/memkeystore.go | 64 ----- keystore/memkeystore_test.go | 99 -------- namesys/base.go | 120 --------- namesys/cache.go | 62 ----- namesys/dns.go | 159 ------------ namesys/dns_test.go | 172 ------------- namesys/interface.go | 106 -------- namesys/ipns_resolver_validation_test.go | 206 --------------- namesys/namesys.go | 238 ----------------- namesys/namesys_test.go | 169 ------------- namesys/proquint.go | 32 --- namesys/publisher.go | 309 ----------------------- namesys/publisher_test.go | 155 ------------ namesys/republisher/repub.go | 168 ------------ namesys/republisher/repub_test.go | 245 ------------------ namesys/resolve/resolve.go | 52 ---- namesys/resolve_test.go | 123 --------- namesys/routing.go | 148 ----------- repo/fsrepo/fsrepo.go | 2 +- repo/mock.go | 2 +- repo/repo.go | 2 +- 39 files changed, 114 insertions(+), 3124 deletions(-) delete mode 100644 keystore/keystore.go delete mode 100644 keystore/keystore_test.go delete mode 100644 keystore/memkeystore.go delete mode 100644 keystore/memkeystore_test.go delete mode 100644 namesys/base.go delete mode 100644 namesys/cache.go delete mode 100644 namesys/dns.go delete mode 100644 namesys/dns_test.go delete mode 100644 namesys/interface.go delete mode 100644 namesys/ipns_resolver_validation_test.go delete mode 100644 namesys/namesys.go delete mode 100644 namesys/namesys_test.go delete mode 100644 namesys/proquint.go delete mode 100644 namesys/publisher.go delete mode 100644 namesys/publisher_test.go delete mode 100644 namesys/republisher/repub.go delete mode 100644 namesys/republisher/repub_test.go delete mode 100644 namesys/resolve/resolve.go delete mode 100644 namesys/resolve_test.go delete mode 100644 namesys/routing.go diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index f419604f2e3..fe252e8cbf4 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -14,8 +14,8 @@ import ( oldcmds "github.com/ipfs/go-ipfs/commands" core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/commands" - namesys "github.com/ipfs/go-ipfs/namesys" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" + namesys "github.com/ipfs/go-namesys" cmds "github.com/ipfs/go-ipfs-cmds" config "github.com/ipfs/go-ipfs-config" diff --git a/core/commands/dht_test.go b/core/commands/dht_test.go index b32190a12e0..4c31a4b5c7b 100644 --- a/core/commands/dht_test.go +++ b/core/commands/dht_test.go @@ -3,7 +3,7 @@ package commands import ( "testing" - "github.com/ipfs/go-ipfs/namesys" + "github.com/ipfs/go-namesys" ipns "github.com/ipfs/go-ipns" "github.com/libp2p/go-libp2p-core/test" diff --git a/core/commands/dns.go b/core/commands/dns.go index d5dea4cf1d6..43c5f3d78bf 100644 --- a/core/commands/dns.go +++ b/core/commands/dns.go @@ -6,7 +6,7 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" ncmd "github.com/ipfs/go-ipfs/core/commands/name" - namesys "github.com/ipfs/go-ipfs/namesys" + namesys "github.com/ipfs/go-namesys" nsopts "github.com/ipfs/interface-go-ipfs-core/options/namesys" cmds "github.com/ipfs/go-ipfs-cmds" diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index 57cf68b2ae5..885c469247a 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -8,7 +8,7 @@ import ( "time" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" - namesys "github.com/ipfs/go-ipfs/namesys" + namesys "github.com/ipfs/go-namesys" cmds "github.com/ipfs/go-ipfs-cmds" logging "github.com/ipfs/go-log" diff --git a/core/commands/resolve.go b/core/commands/resolve.go index 63d17504807..fb87d1c02aa 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -9,7 +9,7 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" ncmd "github.com/ipfs/go-ipfs/core/commands/name" - ns "github.com/ipfs/go-ipfs/namesys" + ns "github.com/ipfs/go-namesys" cidenc "github.com/ipfs/go-cidutil/cidenc" cmds "github.com/ipfs/go-ipfs-cmds" diff --git a/core/core.go b/core/core.go index d422a1aa80c..7c8737a6a41 100644 --- a/core/core.go +++ b/core/core.go @@ -45,11 +45,11 @@ import ( "github.com/ipfs/go-ipfs/core/node" "github.com/ipfs/go-ipfs/core/node/libp2p" "github.com/ipfs/go-ipfs/fuse/mount" - "github.com/ipfs/go-ipfs/namesys" - ipnsrp "github.com/ipfs/go-ipfs/namesys/republisher" "github.com/ipfs/go-ipfs/p2p" "github.com/ipfs/go-ipfs/peering" "github.com/ipfs/go-ipfs/repo" + "github.com/ipfs/go-namesys" + ipnsrp "github.com/ipfs/go-namesys/republisher" ) var log = logging.Logger("core") diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 5b638826b45..672b426456f 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -39,8 +39,8 @@ import ( "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/node" - "github.com/ipfs/go-ipfs/namesys" "github.com/ipfs/go-ipfs/repo" + "github.com/ipfs/go-namesys" ) type CoreAPI struct { diff --git a/core/coreapi/name.go b/core/coreapi/name.go index c9c3dedf36e..babb7c4a8b7 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/ipfs/go-ipfs/keystore" - "github.com/ipfs/go-ipfs/namesys" + "github.com/ipfs/go-ipfs-keystore" + "github.com/ipfs/go-namesys" ipath "github.com/ipfs/go-path" coreiface "github.com/ipfs/interface-go-ipfs-core" diff --git a/core/coreapi/path.go b/core/coreapi/path.go index 314d1b5fd55..598f5d11581 100644 --- a/core/coreapi/path.go +++ b/core/coreapi/path.go @@ -5,7 +5,7 @@ import ( "fmt" gopath "path" - "github.com/ipfs/go-ipfs/namesys/resolve" + "github.com/ipfs/go-namesys/resolve" "github.com/ipfs/go-cid" ipld "github.com/ipfs/go-ipld-format" diff --git a/core/coreapi/test/api_test.go b/core/coreapi/test/api_test.go index 153a8c7cf31..e5ccb62dd6f 100644 --- a/core/coreapi/test/api_test.go +++ b/core/coreapi/test/api_test.go @@ -9,12 +9,12 @@ import ( "testing" "github.com/ipfs/go-filestore" + "github.com/ipfs/go-ipfs-keystore" "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/bootstrap" "github.com/ipfs/go-ipfs/core/coreapi" mock "github.com/ipfs/go-ipfs/core/mock" "github.com/ipfs/go-ipfs/core/node/libp2p" - "github.com/ipfs/go-ipfs/keystore" "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-datastore" diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index a05e456ab6c..053c22f9a8d 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -14,8 +14,8 @@ import ( version "github.com/ipfs/go-ipfs" core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/coreapi" - namesys "github.com/ipfs/go-ipfs/namesys" repo "github.com/ipfs/go-ipfs/repo" + namesys "github.com/ipfs/go-namesys" datastore "github.com/ipfs/go-datastore" syncds "github.com/ipfs/go-datastore/sync" diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index da133f7abe1..6d2955e49c4 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -12,7 +12,7 @@ import ( cid "github.com/ipfs/go-cid" core "github.com/ipfs/go-ipfs/core" coreapi "github.com/ipfs/go-ipfs/core/coreapi" - namesys "github.com/ipfs/go-ipfs/namesys" + namesys "github.com/ipfs/go-namesys" isd "github.com/jbenet/go-is-domain" "github.com/libp2p/go-libp2p-core/peer" mbase "github.com/multiformats/go-multibase" diff --git a/core/node/ipns.go b/core/node/ipns.go index 11769d97f92..4b2c1738923 100644 --- a/core/node/ipns.go +++ b/core/node/ipns.go @@ -11,9 +11,9 @@ import ( "github.com/libp2p/go-libp2p-core/routing" "github.com/libp2p/go-libp2p-record" - "github.com/ipfs/go-ipfs/namesys" - "github.com/ipfs/go-ipfs/namesys/republisher" "github.com/ipfs/go-ipfs/repo" + "github.com/ipfs/go-namesys" + "github.com/ipfs/go-namesys/republisher" ) const DefaultIpnsCacheSize = 128 diff --git a/fuse/ipns/common.go b/fuse/ipns/common.go index 48129a92e98..1b810eaa990 100644 --- a/fuse/ipns/common.go +++ b/fuse/ipns/common.go @@ -4,7 +4,7 @@ import ( "context" "github.com/ipfs/go-ipfs/core" - nsys "github.com/ipfs/go-ipfs/namesys" + nsys "github.com/ipfs/go-namesys" path "github.com/ipfs/go-path" ft "github.com/ipfs/go-unixfs" ci "github.com/libp2p/go-libp2p-core/crypto" diff --git a/go.mod b/go.mod index 9178cca5fe0..8a0d5e11b62 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ require ( bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc contrib.go.opencensus.io/exporter/prometheus v0.2.0 github.com/blang/semver/v4 v4.0.0 - github.com/bren2010/proquint v0.0.0-20201027163346-95122a84635f github.com/cheggaaa/pb v1.0.29 github.com/coreos/go-systemd/v22 v22.1.0 github.com/dustin/go-humanize v1.0.0 @@ -12,9 +11,7 @@ require ( github.com/fsnotify/fsnotify v1.4.9 github.com/gabriel-vasile/mimetype v1.1.2 github.com/go-bindata/go-bindata/v3 v3.1.3 - github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-multierror v1.1.0 - github.com/hashicorp/golang-lru v0.5.4 github.com/ipfs/go-bitswap v0.3.3 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-blockservice v0.1.4 @@ -33,10 +30,10 @@ require ( github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 github.com/ipfs/go-ipfs-config v0.12.0 - github.com/ipfs/go-ipfs-ds-help v0.1.1 github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-offline v0.0.1 github.com/ipfs/go-ipfs-files v0.0.8 + github.com/ipfs/go-ipfs-keystore v0.0.2 github.com/ipfs/go-ipfs-pinner v0.1.1 github.com/ipfs/go-ipfs-posinfo v0.0.1 github.com/ipfs/go-ipfs-provider v0.4.3 @@ -51,6 +48,7 @@ require ( github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 github.com/ipfs/go-mfs v0.1.2 + github.com/ipfs/go-namesys v0.0.1 github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 github.com/ipfs/go-unixfs v0.2.4 @@ -86,7 +84,6 @@ require ( github.com/libp2p/go-tcp-transport v0.2.1 github.com/libp2p/go-ws-transport v0.4.0 github.com/lucas-clemente/quic-go v0.19.3 - github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/multiformats/go-multiaddr v0.3.1 github.com/multiformats/go-multiaddr-dns v0.2.0 @@ -97,7 +94,6 @@ require ( github.com/prometheus/client_golang v1.9.0 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.0 - github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b diff --git a/go.sum b/go.sum index 273db1cd0dc..b30a5ac5e5b 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,7 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/Stebalien/go-bitfield v0.0.0-20180330043415-076a62f9ce6e/go.mod h1:3oM7gXIttpYDAJXpVNnSCiUMYBLIZ6cb1t+Ip982MRo= github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -73,11 +74,13 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/bren2010/proquint v0.0.0-20201027163346-95122a84635f h1:aYq2dAS53HXEmxlI9AAggLbqJS4DML1/H0+r59TH/vw= -github.com/bren2010/proquint v0.0.0-20201027163346-95122a84635f/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI= +github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d h1:QgeLLoPD3kRVmeu/1al9iIpIANMi9O1zXFm8BnYGCJg= +github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= @@ -171,6 +174,7 @@ github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:Jp github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6E= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= @@ -181,6 +185,7 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/gabriel-vasile/mimetype v1.1.1/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/gabriel-vasile/mimetype v1.1.2 h1:gaPnPcNor5aZSVCJVSGipcpbgMWiAAj9z182ocSGbHU= github.com/gabriel-vasile/mimetype v1.1.2/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -285,6 +290,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpg github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= +github.com/gxed/pubsub v0.0.0-20180201040156-26ebdf44f824/go.mod h1:OiEWyHgK+CWrmOlVquHaIK1vhpUJydC9m0Je6mhaiNE= github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= @@ -316,6 +322,7 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -325,17 +332,20 @@ github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= +github.com/ipfs/go-bitswap v0.0.3/go.mod h1:jadAZYsP/tcRMl47ZhFxhaNuDQoXawT8iHMg+iFoQbg= github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3UPrwvis= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.1.3/go.mod h1:YEQlFy0kkxops5Vy+OxWdRSEZIoS7I7KDIwoa5Chkps= github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= +github.com/ipfs/go-bitswap v0.2.20/go.mod h1:C7TwBgHnu89Q8sHsTJP7IhUqF9XYLe71P4tT5adgmYo= github.com/ipfs/go-bitswap v0.3.3 h1:CrTO3OiOYFBcdliw074/C7T2QYHEOsPClgvR6RIYcO4= github.com/ipfs/go-bitswap v0.3.3/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= +github.com/ipfs/go-blockservice v0.0.3/go.mod h1:/NNihwTi6V2Yr6g8wBI+BSwPuURpBRMtYNGrlxZ8KuI= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= github.com/ipfs/go-blockservice v0.1.1/go.mod h1:t+411r7psEUhLueM8C7aPA7cxCclv4O3VsUVxt9kz2I= @@ -371,6 +381,7 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= +github.com/ipfs/go-ds-badger v0.2.4/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.2.6 h1:Hy8jw4rifxtRDrqpvC1yh36oIyE37KDzsUzlHUPOFiU= github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= github.com/ipfs/go-ds-flatfs v0.4.5 h1:4QceuKEbH+HVZ2ZommstJMi3o3II+dWS3IhLaD7IGHs= @@ -386,8 +397,10 @@ github.com/ipfs/go-filestore v0.0.3 h1:MhZ1jT5K3NewZwim6rS/akcJLm1xM+r6nz6foeB9E github.com/ipfs/go-filestore v0.0.3/go.mod h1:dvXRykFzyyXN2CdNlRGzDAkXMDPyI+D7JE066SiKLSE= github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= +github.com/ipfs/go-graphsync v0.1.1/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= github.com/ipfs/go-graphsync v0.7.0 h1:ZdyU2otZYPjcvduAPwVjCdijmkPtHI1mm1VyZbRQ5KI= github.com/ipfs/go-graphsync v0.7.0/go.mod h1:YRQg0TyvD2HzFansAZdMcUFBJ8zIJ4K+32kNdnHfHZc= +github.com/ipfs/go-ipfs v0.7.0/go.mod h1:4UNBZMgbAZ6/+xUZDlMkGxMFPiu1RB67+TaNVvKV7ZQ= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= @@ -397,8 +410,10 @@ github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtL github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= +github.com/ipfs/go-ipfs-cmds v0.4.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw= github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= +github.com/ipfs/go-ipfs-config v0.9.0/go.mod h1:GQUxqb0NfkZmEU92PxqqqLVVFTLpoGGUlBaTyDaAqrE= github.com/ipfs/go-ipfs-config v0.12.0 h1:wxqN3ohBlis1EkhkzIKuF+XLx4YNn9rNpiSOYw3DFZc= github.com/ipfs/go-ipfs-config v0.12.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -411,9 +426,14 @@ github.com/ipfs/go-ipfs-exchange-interface v0.0.1 h1:LJXIo9W7CAmugqI+uofioIpRb6r github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-offline v0.0.1 h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= +github.com/ipfs/go-ipfs-files v0.0.2/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.8 h1:8o0oFJkJ8UkO/ABl8T6ac6tKF3+NIpj67aAB6ZpusRg= github.com/ipfs/go-ipfs-files v0.0.8/go.mod h1:wiN/jSG8FKyk7N0WyctKSvq3ljIa2NNTiZB55kpTdOs= +github.com/ipfs/go-ipfs-flags v0.0.1/go.mod h1:RnXBb9WV53GSfTrSDVK61NLTFKvWc60n+K9EgCDh+rA= +github.com/ipfs/go-ipfs-keystore v0.0.2 h1:Fa9xg9IFD1VbiZtrNLzsD0GuELVHUFXCWF64kCPfEXU= +github.com/ipfs/go-ipfs-keystore v0.0.2/go.mod h1:H49tRmibOEs7gLMgbOsjC4dqh1u5e0R/SWuc2ScfgSo= +github.com/ipfs/go-ipfs-pinner v0.0.4/go.mod h1:s4kFZWLWGDudN8Jyd/GTpt222A12C2snA2+OTdy/7p8= github.com/ipfs/go-ipfs-pinner v0.1.1 h1:iJd1gwILGQJSZhhI0jn6yFOLg34Ua7fdKcB6mXp6k/M= github.com/ipfs/go-ipfs-pinner v0.1.1/go.mod h1:EzyyaWCWeZJ/he9cDBH6QrEkSuRqTRWMmCoyNkylTTg= github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= @@ -429,6 +449,7 @@ github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42 github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= +github.com/ipfs/go-ipld-cbor v0.0.1/go.mod h1:RXHr8s4k0NE0TKhnrxqZC9M888QfsBN9rhS5NjfKzY8= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= @@ -454,6 +475,7 @@ github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBW github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= +github.com/ipfs/go-merkledag v0.0.3/go.mod h1:Oc5kIXLHokkE1hWGMBHw+oxehkAaTOqtEb7Zbh6BhLA= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.1.0/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= @@ -467,7 +489,11 @@ github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZa github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= +github.com/ipfs/go-namesys v0.0.1 h1:HmhgHDA2hyfVtFtbvPR92IdmKbUFRmlbU0Lv1IwmDas= +github.com/ipfs/go-namesys v0.0.1/go.mod h1:I33kVZixNRWXe5FN1mpWBXsAeJj0t+kxcVDgbIkgE2E= +github.com/ipfs/go-path v0.0.3/go.mod h1:zIRQUez3LuQIU25zFjC2hpBTHimWx7VK5bjZgRLbbdo= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= +github.com/ipfs/go-path v0.0.8/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= @@ -477,19 +503,25 @@ github.com/ipfs/go-peertaskqueue v0.2.0 h1:2cSr7exUGKYyDeUyQ7P/nHPs9P7Ht/B+ROrpN github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUnr+P7jivavs9lY= github.com/ipfs/go-pinning-service-http-client v0.1.0 h1:Au0P4NglL5JfzhNSZHlZ1qra+IcJyO3RWMd9EYCwqSY= github.com/ipfs/go-pinning-service-http-client v0.1.0/go.mod h1:tcCKmlkWWH9JUUkKs8CrOZBanacNc1dmKLfjlyXAMu4= +github.com/ipfs/go-unixfs v0.0.4/go.mod h1:eIo/p9ADu/MFOuyxzwU+Th8D6xoxU//r590vUpWyfz8= github.com/ipfs/go-unixfs v0.1.0/go.mod h1:lysk5ELhOso8+Fed9U1QTGey2ocsfaZ18h0NCO2Fj9s= github.com/ipfs/go-unixfs v0.2.4 h1:6NwppOXefWIyysZ4LR/qUBPvXd5//8J3jiMdvpbw6Lo= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= +github.com/ipfs/interface-go-ipfs-core v0.3.0/go.mod h1:Tihp8zxGpUeE3Tokr94L6zWZZdkRQvG5TL6i9MuNE+s= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= +github.com/ipld/go-car v0.1.1-0.20200429200904-c222d793c339/go.mod h1:eajxljm6I8o3LitnFeVEmucwZmz7+yLSiKce9yYMefg= github.com/ipld/go-car v0.2.0 h1:WwP83IdXdEuaW4fkCj+DWmdWygcFXpixramvItqFo1A= github.com/ipld/go-car v0.2.0/go.mod h1:pPb7hzVBHBoRqU3GkPy1d6FZKQoGQ56yd3MyPGzZ0Xs= +github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime v0.7.0 h1:eigF1ZpaL1prbsKYVMqPLoPJqD/pzkQOe2j1uzvVg7w= github.com/ipld/go-ipld-prime v0.7.0/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= +github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipld/go-ipld-prime-proto v0.1.1 h1:EX4yWYaIqSLwtVE30nxEcZDcvsWDtx1vImSG+XCJebY= github.com/ipld/go-ipld-prime-proto v0.1.1/go.mod h1:cI9NwYAUKCLUwqufoUjChISxuTEkaY2yvNYCRCuhRck= +github.com/jackpal/gateway v1.0.4/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= @@ -556,6 +588,7 @@ github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoR github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= +github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= @@ -567,35 +600,45 @@ github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZ github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= +github.com/libp2p/go-libp2p v0.0.2/go.mod h1:Qu8bWqFXiocPloabFGUcVG4kk94fLvfC8mWTDdFC9wE= github.com/libp2p/go-libp2p v0.0.30/go.mod h1:XWT8FGHlhptAv1+3V/+J5mEpzyui/5bvFsNuWYs611A= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= +github.com/libp2p/go-libp2p v0.6.0/go.mod h1:mfKWI7Soz3ABX+XEBR61lGbg+ewyMtJHVt043oWeqwg= github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= +github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= +github.com/libp2p/go-libp2p v0.11.0/go.mod h1:3/ogJDXsbbepEfqtZKBR/DedzxJXCeK17t2Z9RE9bEE= github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= github.com/libp2p/go-libp2p v0.13.0 h1:tDdrXARSghmusdm0nf1U/4M8aj8Rr0V2IzQOXmbzQ3s= github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= +github.com/libp2p/go-libp2p-autonat v0.0.2/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= +github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= +github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= +github.com/libp2p/go-libp2p-circuit v0.0.1/go.mod h1:Dqm0s/BiV63j8EEAs8hr1H5HudqvCAeXxDyic59lCwE= github.com/libp2p/go-libp2p-circuit v0.0.9/go.mod h1:uU+IBvEQzCu953/ps7bYzC/D/R0Ho2A9LfKVVCatlqU= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= +github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= +github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= github.com/libp2p/go-libp2p-circuit v0.4.0 h1:eqQ3sEYkGTtybWgr6JLqJY6QLtPWRErvFjFDfAOO1wc= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= @@ -613,6 +656,7 @@ github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUh github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= +github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= @@ -628,22 +672,27 @@ github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJB github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= +github.com/libp2p/go-libp2p-discovery v0.0.1/go.mod h1:ZkkF9xIFRLA1xCc7bstYFkd80gBGK8Fc1JqGoU2i+zI= github.com/libp2p/go-libp2p-discovery v0.0.5/go.mod h1:YtF20GUxjgoKZ4zmXj8j3Nb2TUSBHFlOCetzYdbZL5I= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= +github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-gostream v0.2.1/go.mod h1:1Mjp3LDmkqICe5tH9yLVNCqFaRTy6OwBvuJV6j1b9Nk= github.com/libp2p/go-libp2p-gostream v0.3.0 h1:rnas//vRdHYCr7bjraZJISPwZV8OGMjeX5k5fN5Ax44= github.com/libp2p/go-libp2p-gostream v0.3.0/go.mod h1:pLBQu8db7vBMNINGsAwLL/ZCE8wng5V1FThoaE5rNjc= github.com/libp2p/go-libp2p-host v0.0.1/go.mod h1:qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go= github.com/libp2p/go-libp2p-host v0.0.3/go.mod h1:Y/qPyA6C8j2coYyos1dfRm0I8+nvd4TGrDGt4tA7JR8= +github.com/libp2p/go-libp2p-http v0.1.5/go.mod h1:2YfPjsQxUlBGFQl2u461unkQ7ukwiSs7NX2eSslOJiU= github.com/libp2p/go-libp2p-http v0.2.0 h1:GYeVd+RZzkRa8XFLITqOpcrIQG6KbFLPJqII6HHBHzY= github.com/libp2p/go-libp2p-http v0.2.0/go.mod h1:GlNKFqDZHe25LVy2CvnZKx75/jLtMaD3VxZV6N39X7E= github.com/libp2p/go-libp2p-interface-connmgr v0.0.1/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= +github.com/libp2p/go-libp2p-kad-dht v0.9.0/go.mod h1:LEKcCFHxnvypOPaqZ0m6h0fLQ9Y8t1iZMOg7a0aQDD4= github.com/libp2p/go-libp2p-kad-dht v0.11.1 h1:FsriVQhOUZpCotWIjyFSjEDNJmUzuMma/RyyTDZanwc= github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= @@ -657,10 +706,12 @@ github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3 github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= +github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1 h1:/pyhkP1nLwjG3OM+VuaNJkQT/Pqq73WzB3aDN3Fx1sc= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= +github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= @@ -684,17 +735,23 @@ github.com/libp2p/go-libp2p-peerstore v0.1.4/go.mod h1:+4BDbDiiKf4PzpANZDAT+knVd github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= +github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= +github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= +github.com/libp2p/go-libp2p-pubsub v0.3.2/go.mod h1:Uss7/Cfz872KggNb+doCVPHeCDmXB7z500m/R8DaAUk= +github.com/libp2p/go-libp2p-pubsub v0.3.5/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDFhWj+8yy8= github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= +github.com/libp2p/go-libp2p-pubsub-router v0.3.2/go.mod h1:G4MAvYzPxhoR0LEBluS9Ow+Nnr/8iDalUN+RNwVgNkY= github.com/libp2p/go-libp2p-pubsub-router v0.4.0 h1:KjzTLIOBCt0+/4wH6epTxD/Qu4Up/IyeKHlj9MhWRJI= github.com/libp2p/go-libp2p-pubsub-router v0.4.0/go.mod h1:hs0j0ugcBjMOMgJ6diOlZM2rZEId/w5Gg86E+ac4SmQ= +github.com/libp2p/go-libp2p-quic-transport v0.8.0/go.mod h1:F2FG/6Bzz0U6essUVxDzE0s9CrY4XGLbl7QEmDNvU7A= github.com/libp2p/go-libp2p-quic-transport v0.10.0 h1:koDCbWD9CCHwcHZL3/WEvP2A+e/o5/W5L3QS/2SPMA0= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= @@ -706,15 +763,18 @@ github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ github.com/libp2p/go-libp2p-routing v0.0.1/go.mod h1:N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys= github.com/libp2p/go-libp2p-routing-helpers v0.2.3 h1:xY61alxJ6PurSi+MXbywZpelvuU4U4p/gPTxjqCqTzY= github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= +github.com/libp2p/go-libp2p-secio v0.0.1/go.mod h1:IdG6iQybdcYmbTzxp4J5dwtUEDTOvZrT0opIDVNPrJs= github.com/libp2p/go-libp2p-secio v0.0.3/go.mod h1:hS7HQ00MgLhRO/Wyu1bTX6ctJKhVpm+j2/S2A5UqYb0= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= +github.com/libp2p/go-libp2p-swarm v0.0.1/go.mod h1:mh+KZxkbd3lQnveQ3j2q60BM1Cw2mX36XXQqwfPOShs= github.com/libp2p/go-libp2p-swarm v0.0.6/go.mod h1:s5GZvzg9xXe8sbeESuFpjt8CJPTCa8mhEusweJqyFy8= github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= +github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h/GGZes8Wku/M5Y= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= @@ -728,13 +788,16 @@ github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MB github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= +github.com/libp2p/go-libp2p-testing v0.2.0/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-testing v0.4.0 h1:PrwHRi0IGqOwVQWR3xzgigSlhlLfxgfXgkHxr77EghQ= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= +github.com/libp2p/go-libp2p-transport v0.0.4/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= github.com/libp2p/go-libp2p-transport v0.0.5/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= +github.com/libp2p/go-libp2p-transport-upgrader v0.0.1/go.mod h1:NJpUAgQab/8K6K0m+JmZCe5RUXG10UMEx4kWe9Ipj5c= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= @@ -757,6 +820,7 @@ github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9 github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUhgnKqNEmIAz/bPU= +github.com/libp2p/go-mplex v0.0.1/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.4/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= @@ -765,6 +829,7 @@ github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3 github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-mplex v0.3.0 h1:U1T+vmCYJaEoDJPV1aq31N56hS+lJgb397GsylNSgrU= github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= +github.com/libp2p/go-msgio v0.0.1/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= @@ -786,6 +851,7 @@ github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= +github.com/libp2p/go-reuseport-transport v0.0.1/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= @@ -800,6 +866,7 @@ github.com/libp2p/go-stream-muxer-multistream v0.1.1/go.mod h1:zmGdfkQ1AzOECIAcc github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DXdvDSiLHQidKKUGZtiOY= github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= +github.com/libp2p/go-tcp-transport v0.0.1/go.mod h1:mnjg0o0O5TmXUaUIanYPUqkW4+u6mK0en8rlpA6BBTs= github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19K427vCzQ+xHKH/o= github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= @@ -808,6 +875,7 @@ github.com/libp2p/go-tcp-transport v0.2.1 h1:ExZiVQV+h+qL16fzCWtd1HSzPsqWottJ8KX github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= github.com/libp2p/go-testutil v0.0.1/go.mod h1:iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= +github.com/libp2p/go-ws-transport v0.0.1/go.mod h1:p3bKjDWHEgtuKKj+2OdPYs5dAPIjtpQGHF2tJfGz7Ww= github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= @@ -829,6 +897,7 @@ github.com/libp2p/go-yamux/v2 v2.0.0 h1:vSGhAy5u6iHBq11ZDcyHH4Blcf9xlBhT4WQDoOE9 github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lucas-clemente/quic-go v0.18.0/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= @@ -836,9 +905,11 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= +github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -862,6 +933,7 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1f github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo= @@ -925,10 +997,12 @@ github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysj github.com/multiformats/go-multiaddr-net v0.2.0 h1:MSXRGN0mFymt6B1yo/6BPnIRpLPEnKgQNvVfCX5VDJk= github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= +github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= +github.com/multiformats/go-multihash v0.0.7/go.mod h1:XuKXPp8VHcTygube3OWZC+aZrA+H1IhmjoCDtJc7PXM= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= @@ -939,6 +1013,7 @@ github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= +github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -1004,6 +1079,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= +github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -1090,6 +1166,7 @@ github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHei github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= @@ -1145,6 +1222,7 @@ github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvS github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= +github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 h1:bsUlNhdmbtlfdLVXAVfuvKQ01RnWAM09TVrJkI7NZs4= github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= @@ -1155,6 +1233,10 @@ github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h1:cZNvX9cFybI01GriPRMXDtczuvUhgbcYr9iCGaNlRv8= +github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible/go.mod h1:34LEDbeKFZInPUrAG+bjuJmUXONGdEFW7XL0SpTY1y4= +github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible/go.mod h1:dRWHHvc4HDQSHh9gbKEBbUZ+f2Q8iZTPG3UOGYODxSQ= +github.com/whyrusleeping/go-smux-yamux v2.0.8+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI= +github.com/whyrusleeping/go-smux-yamux v2.0.9+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI= github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 h1:ctS9Anw/KozviCCtK6VWMz5kPL9nbQzbQY4yfqlIV4M= github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1/go.mod h1:tKH72zYNt/exx6/5IQO6L9LoQ0rEjd5SbbWaDTs9Zso= github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= @@ -1163,10 +1245,12 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= +github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c/go.mod h1:xxcJeBb7SIUl/Wzkz1eVKJE/CB34YNrqX2TQI6jY9zs= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= +github.com/whyrusleeping/yamux v1.1.5/go.mod h1:E8LnQQ8HKx5KD29HZFUwM1PxCOdPRzGwur1mcYhXcD8= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1237,6 +1321,7 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= @@ -1261,6 +1346,7 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -1272,6 +1358,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1327,7 +1414,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1378,11 +1464,11 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1438,6 +1524,7 @@ golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 h1:g3QwFWCjsUzBtcQIcI+CYmiL/0i0BxTJjQp54GGDLEM= @@ -1523,6 +1610,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= diff --git a/keystore/keystore.go b/keystore/keystore.go deleted file mode 100644 index 9b2109ccdf2..00000000000 --- a/keystore/keystore.go +++ /dev/null @@ -1,189 +0,0 @@ -package keystore - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - - base32 "encoding/base32" - - logging "github.com/ipfs/go-log" - ci "github.com/libp2p/go-libp2p-core/crypto" -) - -var log = logging.Logger("keystore") - -var codec = base32.StdEncoding.WithPadding(base32.NoPadding) - -// Keystore provides a key management interface -type Keystore interface { - // Has returns whether or not a key exists in the Keystore - Has(string) (bool, error) - // Put stores a key in the Keystore, if a key with the same name already exists, returns ErrKeyExists - Put(string, ci.PrivKey) error - // Get retrieves a key from the Keystore if it exists, and returns ErrNoSuchKey - // otherwise. - Get(string) (ci.PrivKey, error) - // Delete removes a key from the Keystore - Delete(string) error - // List returns a list of key identifier - List() ([]string, error) -} - -// ErrNoSuchKey is an error message returned when no key of a given name was found. -var ErrNoSuchKey = fmt.Errorf("no key by the given name was found") - -// ErrKeyExists is an error message returned when a key already exists -var ErrKeyExists = fmt.Errorf("key by that name already exists, refusing to overwrite") - -const keyFilenamePrefix = "key_" - -// FSKeystore is a keystore backed by files in a given directory stored on disk. -type FSKeystore struct { - dir string -} - -// NewFSKeystore returns a new filesystem-backed keystore. -func NewFSKeystore(dir string) (*FSKeystore, error) { - err := os.Mkdir(dir, 0700) - switch { - case os.IsExist(err): - case err == nil: - default: - return nil, err - } - return &FSKeystore{dir}, nil -} - -// Has returns whether or not a key exists in the Keystore -func (ks *FSKeystore) Has(name string) (bool, error) { - name, err := encode(name) - if err != nil { - return false, err - } - - kp := filepath.Join(ks.dir, name) - - _, err = os.Stat(kp) - - if os.IsNotExist(err) { - return false, nil - } - return err == nil, err -} - -// Put stores a key in the Keystore, if a key with the same name already exists, returns ErrKeyExists -func (ks *FSKeystore) Put(name string, k ci.PrivKey) error { - name, err := encode(name) - if err != nil { - return err - } - - b, err := ci.MarshalPrivateKey(k) - if err != nil { - return err - } - - kp := filepath.Join(ks.dir, name) - - fi, err := os.OpenFile(kp, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0400) - if err != nil { - if os.IsExist(err) { - err = ErrKeyExists - } - return err - } - defer fi.Close() - - _, err = fi.Write(b) - - return err -} - -// Get retrieves a key from the Keystore if it exists, and returns ErrNoSuchKey -// otherwise. -func (ks *FSKeystore) Get(name string) (ci.PrivKey, error) { - name, err := encode(name) - if err != nil { - return nil, err - } - - kp := filepath.Join(ks.dir, name) - - data, err := ioutil.ReadFile(kp) - if err != nil { - if os.IsNotExist(err) { - return nil, ErrNoSuchKey - } - return nil, err - } - - return ci.UnmarshalPrivateKey(data) -} - -// Delete removes a key from the Keystore -func (ks *FSKeystore) Delete(name string) error { - name, err := encode(name) - if err != nil { - return err - } - - kp := filepath.Join(ks.dir, name) - - return os.Remove(kp) -} - -// List return a list of key identifier -func (ks *FSKeystore) List() ([]string, error) { - dir, err := os.Open(ks.dir) - if err != nil { - return nil, err - } - - dirs, err := dir.Readdirnames(0) - if err != nil { - return nil, err - } - - list := make([]string, 0, len(dirs)) - - for _, name := range dirs { - decodedName, err := decode(name) - if err == nil { - list = append(list, decodedName) - } else { - log.Errorf("Ignoring keyfile with invalid encoded filename: %s", name) - } - } - - return list, nil -} - -func encode(name string) (string, error) { - if name == "" { - return "", fmt.Errorf("key name must be at least one character") - } - - encodedName := codec.EncodeToString([]byte(name)) - log.Debugf("Encoded key name: %s to: %s", name, encodedName) - - return keyFilenamePrefix + strings.ToLower(encodedName), nil -} - -func decode(name string) (string, error) { - if !strings.HasPrefix(name, keyFilenamePrefix) { - return "", fmt.Errorf("key's filename has unexpected format") - } - - nameWithoutPrefix := strings.ToUpper(name[len(keyFilenamePrefix):]) - decodedName, err := codec.DecodeString(nameWithoutPrefix) - if err != nil { - return "", err - } - - log.Debugf("Decoded key name: %s to: %s", name, decodedName) - - return string(decodedName), nil -} diff --git a/keystore/keystore_test.go b/keystore/keystore_test.go deleted file mode 100644 index 06f2fccc533..00000000000 --- a/keystore/keystore_test.go +++ /dev/null @@ -1,278 +0,0 @@ -package keystore - -import ( - "fmt" - "io/ioutil" - "math/rand" - "os" - "path/filepath" - "sort" - "testing" - - ci "github.com/libp2p/go-libp2p-core/crypto" -) - -type rr struct{} - -func (rr rr) Read(b []byte) (int, error) { - return rand.Read(b) -} - -func privKeyOrFatal(t *testing.T) ci.PrivKey { - priv, _, err := ci.GenerateEd25519Key(rr{}) - if err != nil { - t.Fatal(err) - } - return priv -} - -func TestKeystoreBasics(t *testing.T) { - tdir, err := ioutil.TempDir("", "keystore-test") - if err != nil { - t.Fatal(err) - } - - ks, err := NewFSKeystore(tdir) - if err != nil { - t.Fatal(err) - } - - l, err := ks.List() - if err != nil { - t.Fatal(err) - } - - if len(l) != 0 { - t.Fatal("expected no keys") - } - - k1 := privKeyOrFatal(t) - k2 := privKeyOrFatal(t) - k3 := privKeyOrFatal(t) - k4 := privKeyOrFatal(t) - - err = ks.Put("foo", k1) - if err != nil { - t.Fatal(err) - } - - err = ks.Put("bar", k2) - if err != nil { - t.Fatal(err) - } - - l, err = ks.List() - if err != nil { - t.Fatal(err) - } - - sort.Strings(l) - if l[0] != "bar" || l[1] != "foo" { - t.Fatal("wrong entries listed") - } - - if err := assertDirContents(tdir, []string{"foo", "bar"}); err != nil { - t.Fatal(err) - } - - err = ks.Put("foo", k3) - if err == nil { - t.Fatal("should not be able to overwrite key") - } - - if err := assertDirContents(tdir, []string{"foo", "bar"}); err != nil { - t.Fatal(err) - } - - exist, err := ks.Has("foo") - if !exist { - t.Fatal("should know it has a key named foo") - } - if err != nil { - t.Fatal(err) - } - - exist, err = ks.Has("nonexistingkey") - if exist { - t.Fatal("should know it doesn't have a key named nonexistingkey") - } - if err != nil { - t.Fatal(err) - } - - if err := ks.Delete("bar"); err != nil { - t.Fatal(err) - } - - if err := assertDirContents(tdir, []string{"foo"}); err != nil { - t.Fatal(err) - } - - if err := ks.Put("beep", k3); err != nil { - t.Fatal(err) - } - - if err := ks.Put("boop", k4); err != nil { - t.Fatal(err) - } - - if err := assertDirContents(tdir, []string{"foo", "beep", "boop"}); err != nil { - t.Fatal(err) - } - - if err := assertGetKey(ks, "foo", k1); err != nil { - t.Fatal(err) - } - - if err := assertGetKey(ks, "beep", k3); err != nil { - t.Fatal(err) - } - - if err := assertGetKey(ks, "boop", k4); err != nil { - t.Fatal(err) - } - - if err := ks.Put("..///foo/", k1); err != nil { - t.Fatal(err) - } - - if err := ks.Put("", k1); err == nil { - t.Fatal("shouldn't be able to put a key with no name") - } - - if err := ks.Put(".foo", k1); err != nil { - t.Fatal(err) - } -} - -func TestInvalidKeyFiles(t *testing.T) { - tdir, err := ioutil.TempDir("", "keystore-test") - - if err != nil { - t.Fatal(err) - } - - defer os.RemoveAll(tdir) - - ks, err := NewFSKeystore(tdir) - if err != nil { - t.Fatal(err) - } - - key := privKeyOrFatal(t) - - bytes, err := key.Bytes() - if err != nil { - t.Fatal(err) - } - - encodedName, err := encode("valid") - if err != nil { - t.Fatal(err) - } - - err = ioutil.WriteFile(filepath.Join(ks.dir, encodedName), bytes, 0644) - if err != nil { - t.Fatal(err) - } - - err = ioutil.WriteFile(filepath.Join(ks.dir, "z.invalid"), bytes, 0644) - if err != nil { - t.Fatal(err) - } - - l, err := ks.List() - if err != nil { - t.Fatal(err) - } - - sort.Strings(l) - if len(l) != 1 { - t.Fatal("wrong entry count") - } - - if l[0] != "valid" { - t.Fatal("wrong entries listed") - } - - exist, err := ks.Has("valid") - if !exist { - t.Fatal("should know it has a key named valid") - } - if err != nil { - t.Fatal(err) - } -} - -func TestNonExistingKey(t *testing.T) { - tdir, err := ioutil.TempDir("", "keystore-test") - if err != nil { - t.Fatal(err) - } - - ks, err := NewFSKeystore(tdir) - if err != nil { - t.Fatal(err) - } - - k, err := ks.Get("does-it-exist") - if err != ErrNoSuchKey { - t.Fatalf("expected: %s, got %s", ErrNoSuchKey, err) - } - if k != nil { - t.Fatalf("Get on nonexistant key should give nil") - } -} - -func TestMakeKeystoreNoDir(t *testing.T) { - _, err := NewFSKeystore("/this/is/not/a/real/dir") - if err == nil { - t.Fatal("shouldnt be able to make a keystore in a nonexistant directory") - } -} - -func assertGetKey(ks Keystore, name string, exp ci.PrivKey) error { - outK, err := ks.Get(name) - if err != nil { - return err - } - - if !outK.Equals(exp) { - return fmt.Errorf("key we got out didn't match expectation") - } - - return nil -} - -func assertDirContents(dir string, exp []string) error { - finfos, err := ioutil.ReadDir(dir) - if err != nil { - return err - } - - if len(finfos) != len(exp) { - return fmt.Errorf("expected %d directory entries", len(exp)) - } - - var names []string - for _, fi := range finfos { - decodedName, err := decode(fi.Name()) - if err != nil { - return err - } - names = append(names, decodedName) - } - - sort.Strings(names) - sort.Strings(exp) - if len(names) != len(exp) { - return fmt.Errorf("directory had wrong number of entries in it") - } - - for i, v := range names { - if v != exp[i] { - return fmt.Errorf("had wrong entry in directory") - } - } - return nil -} diff --git a/keystore/memkeystore.go b/keystore/memkeystore.go deleted file mode 100644 index 94411144d4c..00000000000 --- a/keystore/memkeystore.go +++ /dev/null @@ -1,64 +0,0 @@ -package keystore - -import ( - "errors" - - ci "github.com/libp2p/go-libp2p-core/crypto" -) - -// MemKeystore is an in memory keystore implementation that is not persisted to -// any backing storage. -type MemKeystore struct { - keys map[string]ci.PrivKey -} - -// NewMemKeystore creates a MemKeystore. -func NewMemKeystore() *MemKeystore { - return &MemKeystore{make(map[string]ci.PrivKey)} -} - -// Has return whether or not a key exists in the Keystore -func (mk *MemKeystore) Has(name string) (bool, error) { - _, ok := mk.keys[name] - return ok, nil -} - -// Put store a key in the Keystore -func (mk *MemKeystore) Put(name string, k ci.PrivKey) error { - if name == "" { - return errors.New("key name must be at least one character") - } - - _, ok := mk.keys[name] - if ok { - return ErrKeyExists - } - - mk.keys[name] = k - return nil -} - -// Get retrieve a key from the Keystore -func (mk *MemKeystore) Get(name string) (ci.PrivKey, error) { - k, ok := mk.keys[name] - if !ok { - return nil, ErrNoSuchKey - } - - return k, nil -} - -// Delete remove a key from the Keystore -func (mk *MemKeystore) Delete(name string) error { - delete(mk.keys, name) - return nil -} - -// List return a list of key identifier -func (mk *MemKeystore) List() ([]string, error) { - out := make([]string, 0, len(mk.keys)) - for k := range mk.keys { - out = append(out, k) - } - return out, nil -} diff --git a/keystore/memkeystore_test.go b/keystore/memkeystore_test.go deleted file mode 100644 index 907cbbd0e7e..00000000000 --- a/keystore/memkeystore_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package keystore - -import ( - "sort" - "testing" -) - -func TestMemKeyStoreBasics(t *testing.T) { - ks := NewMemKeystore() - - l, err := ks.List() - if err != nil { - t.Fatal(err) - } - - if len(l) != 0 { - t.Fatal("expected no keys") - } - - k1 := privKeyOrFatal(t) - k2 := privKeyOrFatal(t) - k3 := privKeyOrFatal(t) - k4 := privKeyOrFatal(t) - - err = ks.Put("foo", k1) - if err != nil { - t.Fatal(err) - } - - err = ks.Put("bar", k2) - if err != nil { - t.Fatal(err) - } - - l, err = ks.List() - if err != nil { - t.Fatal(err) - } - - sort.Strings(l) - if l[0] != "bar" || l[1] != "foo" { - t.Fatal("wrong entries listed") - } - - err = ks.Put("foo", k3) - if err == nil { - t.Fatal("should not be able to overwrite key") - } - - exist, err := ks.Has("foo") - if !exist { - t.Fatal("should know it has a key named foo") - } - if err != nil { - t.Fatal(err) - } - - exist, err = ks.Has("nonexistingkey") - if exist { - t.Fatal("should know it doesn't have a key named nonexistingkey") - } - if err != nil { - t.Fatal(err) - } - - if err := ks.Delete("bar"); err != nil { - t.Fatal(err) - } - if err := ks.Put("beep", k3); err != nil { - t.Fatal(err) - } - - if err := ks.Put("boop", k4); err != nil { - t.Fatal(err) - } - if err := assertGetKey(ks, "foo", k1); err != nil { - t.Fatal(err) - } - - if err := assertGetKey(ks, "beep", k3); err != nil { - t.Fatal(err) - } - - if err := assertGetKey(ks, "boop", k4); err != nil { - t.Fatal(err) - } - - if err := ks.Put("..///foo/", k1); err != nil { - t.Fatal(err) - } - - if err := ks.Put("", k1); err == nil { - t.Fatal("shouldn't be able to put a key with no name") - } - - if err := ks.Put(".foo", k1); err != nil { - t.Fatal(err) - } -} diff --git a/namesys/base.go b/namesys/base.go deleted file mode 100644 index 27cc38f8885..00000000000 --- a/namesys/base.go +++ /dev/null @@ -1,120 +0,0 @@ -package namesys - -import ( - "context" - "strings" - "time" - - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" -) - -type onceResult struct { - value path.Path - ttl time.Duration - err error -} - -type resolver interface { - resolveOnceAsync(ctx context.Context, name string, options opts.ResolveOpts) <-chan onceResult -} - -// resolve is a helper for implementing Resolver.ResolveN using resolveOnce. -func resolve(ctx context.Context, r resolver, name string, options opts.ResolveOpts) (path.Path, error) { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - err := ErrResolveFailed - var p path.Path - - resCh := resolveAsync(ctx, r, name, options) - - for res := range resCh { - p, err = res.Path, res.Err - if err != nil { - break - } - } - - return p, err -} - -func resolveAsync(ctx context.Context, r resolver, name string, options opts.ResolveOpts) <-chan Result { - resCh := r.resolveOnceAsync(ctx, name, options) - depth := options.Depth - outCh := make(chan Result, 1) - - go func() { - defer close(outCh) - var subCh <-chan Result - var cancelSub context.CancelFunc - defer func() { - if cancelSub != nil { - cancelSub() - } - }() - - for { - select { - case res, ok := <-resCh: - if !ok { - resCh = nil - break - } - - if res.err != nil { - emitResult(ctx, outCh, Result{Err: res.err}) - return - } - log.Debugf("resolved %s to %s", name, res.value.String()) - if !strings.HasPrefix(res.value.String(), ipnsPrefix) { - emitResult(ctx, outCh, Result{Path: res.value}) - break - } - - if depth == 1 { - emitResult(ctx, outCh, Result{Path: res.value, Err: ErrResolveRecursion}) - break - } - - subopts := options - if subopts.Depth > 1 { - subopts.Depth-- - } - - var subCtx context.Context - if cancelSub != nil { - // Cancel previous recursive resolve since it won't be used anyways - cancelSub() - } - subCtx, cancelSub = context.WithCancel(ctx) - _ = cancelSub - - p := strings.TrimPrefix(res.value.String(), ipnsPrefix) - subCh = resolveAsync(subCtx, r, p, subopts) - case res, ok := <-subCh: - if !ok { - subCh = nil - break - } - - // We don't bother returning here in case of context timeout as there is - // no good reason to do that, and we may still be able to emit a result - emitResult(ctx, outCh, res) - case <-ctx.Done(): - return - } - if resCh == nil && subCh == nil { - return - } - } - }() - return outCh -} - -func emitResult(ctx context.Context, outCh chan<- Result, r Result) { - select { - case outCh <- r: - case <-ctx.Done(): - } -} diff --git a/namesys/cache.go b/namesys/cache.go deleted file mode 100644 index b2b1f43a8d8..00000000000 --- a/namesys/cache.go +++ /dev/null @@ -1,62 +0,0 @@ -package namesys - -import ( - "time" - - path "github.com/ipfs/go-path" -) - -func (ns *mpns) cacheGet(name string) (path.Path, bool) { - // existence of optional mapping defined via IPFS_NS_MAP is checked first - if ns.staticMap != nil { - val, ok := ns.staticMap[name] - if ok { - return val, true - } - } - - if ns.cache == nil { - return "", false - } - - ientry, ok := ns.cache.Get(name) - if !ok { - return "", false - } - - entry, ok := ientry.(cacheEntry) - if !ok { - // should never happen, purely for sanity - log.Panicf("unexpected type %T in cache for %q.", ientry, name) - } - - if time.Now().Before(entry.eol) { - return entry.val, true - } - - ns.cache.Remove(name) - - return "", false -} - -func (ns *mpns) cacheSet(name string, val path.Path, ttl time.Duration) { - if ns.cache == nil || ttl <= 0 { - return - } - ns.cache.Add(name, cacheEntry{ - val: val, - eol: time.Now().Add(ttl), - }) -} - -func (ns *mpns) cacheInvalidate(name string) { - if ns.cache == nil { - return - } - ns.cache.Remove(name) -} - -type cacheEntry struct { - val path.Path - eol time.Time -} diff --git a/namesys/dns.go b/namesys/dns.go deleted file mode 100644 index 738612f46b2..00000000000 --- a/namesys/dns.go +++ /dev/null @@ -1,159 +0,0 @@ -package namesys - -import ( - "context" - "errors" - "fmt" - "net" - "strings" - - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" - isd "github.com/jbenet/go-is-domain" -) - -const ethTLD = "eth" -const linkTLD = "link" - -type LookupTXTFunc func(name string) (txt []string, err error) - -// DNSResolver implements a Resolver on DNS domains -type DNSResolver struct { - lookupTXT LookupTXTFunc - // TODO: maybe some sort of caching? - // cache would need a timeout -} - -// NewDNSResolver constructs a name resolver using DNS TXT records. -func NewDNSResolver() *DNSResolver { - return &DNSResolver{lookupTXT: net.LookupTXT} -} - -// Resolve implements Resolver. -func (r *DNSResolver) Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (path.Path, error) { - return resolve(ctx, r, name, opts.ProcessOpts(options)) -} - -// ResolveAsync implements Resolver. -func (r *DNSResolver) ResolveAsync(ctx context.Context, name string, options ...opts.ResolveOpt) <-chan Result { - return resolveAsync(ctx, r, name, opts.ProcessOpts(options)) -} - -type lookupRes struct { - path path.Path - error error -} - -// resolveOnce implements resolver. -// TXT records for a given domain name should contain a b58 -// encoded multihash. -func (r *DNSResolver) resolveOnceAsync(ctx context.Context, name string, options opts.ResolveOpts) <-chan onceResult { - var fqdn string - out := make(chan onceResult, 1) - segments := strings.SplitN(name, "/", 2) - domain := segments[0] - - if !isd.IsDomain(domain) { - out <- onceResult{err: fmt.Errorf("not a valid domain name: %s", domain)} - close(out) - return out - } - log.Debugf("DNSResolver resolving %s", domain) - - if strings.HasSuffix(domain, ".") { - fqdn = domain - } else { - fqdn = domain + "." - } - - if strings.HasSuffix(fqdn, "."+ethTLD+".") { - // This is an ENS name. As we're resolving via an arbitrary DNS server - // that may not know about .eth we need to add our link domain suffix. - fqdn += linkTLD + "." - } - - rootChan := make(chan lookupRes, 1) - go workDomain(r, fqdn, rootChan) - - subChan := make(chan lookupRes, 1) - go workDomain(r, "_dnslink."+fqdn, subChan) - - appendPath := func(p path.Path) (path.Path, error) { - if len(segments) > 1 { - return path.FromSegments("", strings.TrimRight(p.String(), "/"), segments[1]) - } - return p, nil - } - - go func() { - defer close(out) - for { - select { - case subRes, ok := <-subChan: - if !ok { - subChan = nil - break - } - if subRes.error == nil { - p, err := appendPath(subRes.path) - emitOnceResult(ctx, out, onceResult{value: p, err: err}) - return - } - case rootRes, ok := <-rootChan: - if !ok { - rootChan = nil - break - } - if rootRes.error == nil { - p, err := appendPath(rootRes.path) - emitOnceResult(ctx, out, onceResult{value: p, err: err}) - } - case <-ctx.Done(): - return - } - if subChan == nil && rootChan == nil { - return - } - } - }() - - return out -} - -func workDomain(r *DNSResolver, name string, res chan lookupRes) { - defer close(res) - - txt, err := r.lookupTXT(name) - if err != nil { - // Error is != nil - res <- lookupRes{"", err} - return - } - - for _, t := range txt { - p, err := parseEntry(t) - if err == nil { - res <- lookupRes{p, nil} - return - } - } - res <- lookupRes{"", ErrResolveFailed} -} - -func parseEntry(txt string) (path.Path, error) { - p, err := path.ParseCidToPath(txt) // bare IPFS multihashes - if err == nil { - return p, nil - } - - return tryParseDnsLink(txt) -} - -func tryParseDnsLink(txt string) (path.Path, error) { - parts := strings.SplitN(txt, "=", 2) - if len(parts) == 2 && parts[0] == "dnslink" { - return path.ParsePath(parts[1]) - } - - return "", errors.New("not a valid dnslink entry") -} diff --git a/namesys/dns_test.go b/namesys/dns_test.go deleted file mode 100644 index 5a0e2a7d2ff..00000000000 --- a/namesys/dns_test.go +++ /dev/null @@ -1,172 +0,0 @@ -package namesys - -import ( - "fmt" - "testing" - - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" -) - -type mockDNS struct { - entries map[string][]string -} - -func (m *mockDNS) lookupTXT(name string) (txt []string, err error) { - txt, ok := m.entries[name] - if !ok { - return nil, fmt.Errorf("no TXT entry for %s", name) - } - return txt, nil -} - -func TestDnsEntryParsing(t *testing.T) { - - goodEntries := []string{ - "QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - "dnslink=/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo", - "dnslink=/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/bar", - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo/bar/baz", - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo/bar/baz/", - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - } - - badEntries := []string{ - "QmYhE8xgFCjGcz6PHgnvJz5NOTCORRECT", - "quux=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - "dnslink=", - "dnslink=/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo", - "dnslink=ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/bar", - } - - for _, e := range goodEntries { - _, err := parseEntry(e) - if err != nil { - t.Log("expected entry to parse correctly!") - t.Log(e) - t.Fatal(err) - } - } - - for _, e := range badEntries { - _, err := parseEntry(e) - if err == nil { - t.Log("expected entry parse to fail!") - t.Fatal(err) - } - } -} - -func newMockDNS() *mockDNS { - return &mockDNS{ - entries: map[string][]string{ - "multihash.example.com.": { - "dnslink=QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - }, - "ipfs.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - }, - "_dnslink.dipfs.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - }, - "dns1.example.com.": { - "dnslink=/ipns/ipfs.example.com", - }, - "dns2.example.com.": { - "dnslink=/ipns/dns1.example.com", - }, - "multi.example.com.": { - "some stuff", - "dnslink=/ipns/dns1.example.com", - "masked dnslink=/ipns/example.invalid", - }, - "equals.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/=equals", - }, - "loop1.example.com.": { - "dnslink=/ipns/loop2.example.com", - }, - "loop2.example.com.": { - "dnslink=/ipns/loop1.example.com", - }, - "_dnslink.dloop1.example.com.": { - "dnslink=/ipns/loop2.example.com", - }, - "_dnslink.dloop2.example.com.": { - "dnslink=/ipns/loop1.example.com", - }, - "bad.example.com.": { - "dnslink=", - }, - "withsegment.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment", - }, - "withrecsegment.example.com.": { - "dnslink=/ipns/withsegment.example.com/subsub", - }, - "withtrailing.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/", - }, - "withtrailingrec.example.com.": { - "dnslink=/ipns/withtrailing.example.com/segment/", - }, - "double.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - }, - "_dnslink.double.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - }, - "double.conflict.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", - }, - "_dnslink.conflict.example.com.": { - "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjE", - }, - "fqdn.example.com.": { - "dnslink=/ipfs/QmYvMB9yrsSf7RKBghkfwmHJkzJhW2ZgVwq3LxBXXPasFr", - }, - "www.wealdtech.eth.link.": { - "dnslink=/ipns/ipfs.example.com", - }, - }, - } -} - -func TestDNSResolution(t *testing.T) { - mock := newMockDNS() - r := &DNSResolver{lookupTXT: mock.lookupTXT} - testResolution(t, r, "multihash.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "ipfs.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "dipfs.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "dns1.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "dns1.example.com", 1, "/ipns/ipfs.example.com", ErrResolveRecursion) - testResolution(t, r, "dns2.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "dns2.example.com", 1, "/ipns/dns1.example.com", ErrResolveRecursion) - testResolution(t, r, "dns2.example.com", 2, "/ipns/ipfs.example.com", ErrResolveRecursion) - testResolution(t, r, "multi.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "multi.example.com", 1, "/ipns/dns1.example.com", ErrResolveRecursion) - testResolution(t, r, "multi.example.com", 2, "/ipns/ipfs.example.com", ErrResolveRecursion) - testResolution(t, r, "equals.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/=equals", nil) - testResolution(t, r, "loop1.example.com", 1, "/ipns/loop2.example.com", ErrResolveRecursion) - testResolution(t, r, "loop1.example.com", 2, "/ipns/loop1.example.com", ErrResolveRecursion) - testResolution(t, r, "loop1.example.com", 3, "/ipns/loop2.example.com", ErrResolveRecursion) - testResolution(t, r, "loop1.example.com", opts.DefaultDepthLimit, "/ipns/loop1.example.com", ErrResolveRecursion) - testResolution(t, r, "dloop1.example.com", 1, "/ipns/loop2.example.com", ErrResolveRecursion) - testResolution(t, r, "dloop1.example.com", 2, "/ipns/loop1.example.com", ErrResolveRecursion) - testResolution(t, r, "dloop1.example.com", 3, "/ipns/loop2.example.com", ErrResolveRecursion) - testResolution(t, r, "dloop1.example.com", opts.DefaultDepthLimit, "/ipns/loop1.example.com", ErrResolveRecursion) - testResolution(t, r, "bad.example.com", opts.DefaultDepthLimit, "", ErrResolveFailed) - testResolution(t, r, "withsegment.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment", nil) - testResolution(t, r, "withrecsegment.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment/subsub", nil) - testResolution(t, r, "withsegment.example.com/test1", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment/test1", nil) - testResolution(t, r, "withrecsegment.example.com/test2", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment/subsub/test2", nil) - testResolution(t, r, "withrecsegment.example.com/test3/", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment/subsub/test3/", nil) - testResolution(t, r, "withtrailingrec.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment/", nil) - testResolution(t, r, "double.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "conflict.example.com", opts.DefaultDepthLimit, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjE", nil) - testResolution(t, r, "fqdn.example.com.", opts.DefaultDepthLimit, "/ipfs/QmYvMB9yrsSf7RKBghkfwmHJkzJhW2ZgVwq3LxBXXPasFr", nil) - testResolution(t, r, "www.wealdtech.eth", 1, "/ipns/ipfs.example.com", ErrResolveRecursion) - testResolution(t, r, "www.wealdtech.eth", 2, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) - testResolution(t, r, "www.wealdtech.eth.link", 2, "/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", nil) -} diff --git a/namesys/interface.go b/namesys/interface.go deleted file mode 100644 index ecd80943be8..00000000000 --- a/namesys/interface.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Package namesys implements resolvers and publishers for the IPFS -naming system (IPNS). - -The core of IPFS is an immutable, content-addressable Merkle graph. -That works well for many use cases, but doesn't allow you to answer -questions like "what is Alice's current homepage?". The mutable name -system allows Alice to publish information like: - - The current homepage for alice.example.com is - /ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj - -or: - - The current homepage for node - QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy - is - /ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj - -The mutable name system also allows users to resolve those references -to find the immutable IPFS object currently referenced by a given -mutable name. - -For command-line bindings to this functionality, see: - - ipfs name - ipfs dns - ipfs resolve -*/ -package namesys - -import ( - "errors" - "time" - - context "context" - - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" - ci "github.com/libp2p/go-libp2p-core/crypto" -) - -// ErrResolveFailed signals an error when attempting to resolve. -var ErrResolveFailed = errors.New("could not resolve name") - -// ErrResolveRecursion signals a recursion-depth limit. -var ErrResolveRecursion = errors.New( - "could not resolve name (recursion limit exceeded)") - -// ErrPublishFailed signals an error when attempting to publish. -var ErrPublishFailed = errors.New("could not publish name") - -// Namesys represents a cohesive name publishing and resolving system. -// -// Publishing a name is the process of establishing a mapping, a key-value -// pair, according to naming rules and databases. -// -// Resolving a name is the process of looking up the value associated with the -// key (name). -type NameSystem interface { - Resolver - Publisher -} - -// Result is the return type for Resolver.ResolveAsync. -type Result struct { - Path path.Path - Err error -} - -// Resolver is an object capable of resolving names. -type Resolver interface { - - // Resolve performs a recursive lookup, returning the dereferenced - // path. For example, if ipfs.io has a DNS TXT record pointing to - // /ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy - // and there is a DHT IPNS entry for - // QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy - // -> /ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj - // then - // Resolve(ctx, "/ipns/ipfs.io") - // will resolve both names, returning - // /ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj - // - // There is a default depth-limit to avoid infinite recursion. Most - // users will be fine with this default limit, but if you need to - // adjust the limit you can specify it as an option. - Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (value path.Path, err error) - - // ResolveAsync performs recursive name lookup, like Resolve, but it returns - // entries as they are discovered in the DHT. Each returned result is guaranteed - // to be "better" (which usually means newer) than the previous one. - ResolveAsync(ctx context.Context, name string, options ...opts.ResolveOpt) <-chan Result -} - -// Publisher is an object capable of publishing particular names. -type Publisher interface { - - // Publish establishes a name-value mapping. - // TODO make this not PrivKey specific. - Publish(ctx context.Context, name ci.PrivKey, value path.Path) error - - // TODO: to be replaced by a more generic 'PublishWithValidity' type - // call once the records spec is implemented - PublishWithEOL(ctx context.Context, name ci.PrivKey, value path.Path, eol time.Time) error -} diff --git a/namesys/ipns_resolver_validation_test.go b/namesys/ipns_resolver_validation_test.go deleted file mode 100644 index 5dbfabf9cd3..00000000000 --- a/namesys/ipns_resolver_validation_test.go +++ /dev/null @@ -1,206 +0,0 @@ -package namesys - -import ( - "context" - "testing" - "time" - - ds "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - mockrouting "github.com/ipfs/go-ipfs-routing/mock" - offline "github.com/ipfs/go-ipfs-routing/offline" - ipns "github.com/ipfs/go-ipns" - ipns_pb "github.com/ipfs/go-ipns/pb" - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" - ci "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" - pstore "github.com/libp2p/go-libp2p-core/peerstore" - routing "github.com/libp2p/go-libp2p-core/routing" - "github.com/libp2p/go-libp2p-core/test" - pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" - record "github.com/libp2p/go-libp2p-record" - testutil "github.com/libp2p/go-libp2p-testing/net" -) - -func TestResolverValidation(t *testing.T) { - t.Run("RSA", - func(t *testing.T) { - testResolverValidation(t, ci.RSA) - }) - t.Run("Ed25519", - func(t *testing.T) { - testResolverValidation(t, ci.Ed25519) - }) - t.Run("ECDSA", - func(t *testing.T) { - testResolverValidation(t, ci.ECDSA) - }) - t.Run("Secp256k1", - func(t *testing.T) { - testResolverValidation(t, ci.Secp256k1) - }) -} - -func testResolverValidation(t *testing.T, keyType int) { - ctx := context.Background() - rid := testutil.RandIdentityOrFatal(t) - dstore := dssync.MutexWrap(ds.NewMapDatastore()) - peerstore := pstoremem.NewPeerstore() - - vstore := newMockValueStore(rid, dstore, peerstore) - resolver := NewIpnsResolver(vstore) - - nvVstore := offline.NewOfflineRouter(dstore, mockrouting.MockValidator{}) - - // Create entry with expiry in one hour - priv, id, _, ipnsDHTPath := genKeys(t, keyType) - ts := time.Now() - p := []byte("/ipfs/QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG") - entry, err := createIPNSRecordWithEmbeddedPublicKey(priv, p, 1, ts.Add(time.Hour)) - if err != nil { - t.Fatal(err) - } - - // Publish entry - err = PublishEntry(ctx, vstore, ipnsDHTPath, entry) - if err != nil { - t.Fatal(err) - } - - // Resolve entry - resp, err := resolve(ctx, resolver, id.Pretty(), opts.DefaultResolveOpts()) - if err != nil { - t.Fatal(err) - } - if resp != path.Path(p) { - t.Fatalf("Mismatch between published path %s and resolved path %s", p, resp) - } - // Create expired entry - expiredEntry, err := createIPNSRecordWithEmbeddedPublicKey(priv, p, 1, ts.Add(-1*time.Hour)) - if err != nil { - t.Fatal(err) - } - - // Publish entry - err = PublishEntry(ctx, nvVstore, ipnsDHTPath, expiredEntry) - if err != nil { - t.Fatal(err) - } - - // Record should fail validation because entry is expired - _, err = resolve(ctx, resolver, id.Pretty(), opts.DefaultResolveOpts()) - if err == nil { - t.Fatal("ValidateIpnsRecord should have returned error") - } - - // Create IPNS record path with a different private key - priv2, id2, _, ipnsDHTPath2 := genKeys(t, keyType) - - // Publish entry - err = PublishEntry(ctx, nvVstore, ipnsDHTPath2, entry) - if err != nil { - t.Fatal(err) - } - - // Record should fail validation because public key defined by - // ipns path doesn't match record signature - _, err = resolve(ctx, resolver, id2.Pretty(), opts.DefaultResolveOpts()) - if err == nil { - t.Fatal("ValidateIpnsRecord should have failed signature verification") - } - - // Try embedding the incorrect private key inside the entry - if err := ipns.EmbedPublicKey(priv2.GetPublic(), entry); err != nil { - t.Fatal(err) - } - - // Publish entry - err = PublishEntry(ctx, nvVstore, ipnsDHTPath2, entry) - if err != nil { - t.Fatal(err) - } - - // Record should fail validation because public key defined by - // ipns path doesn't match record signature - _, err = resolve(ctx, resolver, id2.Pretty(), opts.DefaultResolveOpts()) - if err == nil { - t.Fatal("ValidateIpnsRecord should have failed signature verification") - } -} - -func genKeys(t *testing.T, keyType int) (ci.PrivKey, peer.ID, string, string) { - bits := 0 - if keyType == ci.RSA { - bits = 2048 - } - - sk, pk, err := test.RandTestKeyPair(keyType, bits) - if err != nil { - t.Fatal(err) - } - id, err := peer.IDFromPublicKey(pk) - if err != nil { - t.Fatal(err) - } - return sk, id, PkKeyForID(id), ipns.RecordKey(id) -} - -func createIPNSRecordWithEmbeddedPublicKey(sk ci.PrivKey, val []byte, seq uint64, eol time.Time) (*ipns_pb.IpnsEntry, error) { - entry, err := ipns.Create(sk, val, seq, eol) - if err != nil { - return nil, err - } - if err := ipns.EmbedPublicKey(sk.GetPublic(), entry); err != nil { - return nil, err - } - - return entry, nil -} - -type mockValueStore struct { - r routing.ValueStore - kbook pstore.KeyBook -} - -func newMockValueStore(id testutil.Identity, dstore ds.Datastore, kbook pstore.KeyBook) *mockValueStore { - return &mockValueStore{ - r: offline.NewOfflineRouter(dstore, record.NamespacedValidator{ - "ipns": ipns.Validator{KeyBook: kbook}, - "pk": record.PublicKeyValidator{}, - }), - kbook: kbook, - } -} - -func (m *mockValueStore) GetValue(ctx context.Context, k string, opts ...routing.Option) ([]byte, error) { - return m.r.GetValue(ctx, k, opts...) -} - -func (m *mockValueStore) SearchValue(ctx context.Context, k string, opts ...routing.Option) (<-chan []byte, error) { - return m.r.SearchValue(ctx, k, opts...) -} - -func (m *mockValueStore) GetPublicKey(ctx context.Context, p peer.ID) (ci.PubKey, error) { - pk := m.kbook.PubKey(p) - if pk != nil { - return pk, nil - } - - pkkey := routing.KeyForPublicKey(p) - val, err := m.GetValue(ctx, pkkey) - if err != nil { - return nil, err - } - - pk, err = ci.UnmarshalPublicKey(val) - if err != nil { - return nil, err - } - - return pk, m.kbook.AddPubKey(p, pk) -} - -func (m *mockValueStore) PutValue(ctx context.Context, k string, d []byte, opts ...routing.Option) error { - return m.r.PutValue(ctx, k, d, opts...) -} diff --git a/namesys/namesys.go b/namesys/namesys.go deleted file mode 100644 index 760d04c1788..00000000000 --- a/namesys/namesys.go +++ /dev/null @@ -1,238 +0,0 @@ -package namesys - -import ( - "context" - "fmt" - "os" - "strings" - "time" - - lru "github.com/hashicorp/golang-lru" - cid "github.com/ipfs/go-cid" - ds "github.com/ipfs/go-datastore" - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" - isd "github.com/jbenet/go-is-domain" - ci "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" - routing "github.com/libp2p/go-libp2p-core/routing" -) - -// mpns (a multi-protocol NameSystem) implements generic IPFS naming. -// -// Uses several Resolvers: -// (a) IPFS routing naming: SFS-like PKI names. -// (b) dns domains: resolves using links in DNS TXT records -// (c) proquints: interprets string as the raw byte data. -// -// It can only publish to: (a) IPFS routing naming. -// -type mpns struct { - dnsResolver, proquintResolver, ipnsResolver resolver - ipnsPublisher Publisher - - staticMap map[string]path.Path - cache *lru.Cache -} - -// NewNameSystem will construct the IPFS naming system based on Routing -func NewNameSystem(r routing.ValueStore, ds ds.Datastore, cachesize int) NameSystem { - var ( - cache *lru.Cache - staticMap map[string]path.Path - ) - if cachesize > 0 { - cache, _ = lru.New(cachesize) - } - - // Prewarm namesys cache with static records for deterministic tests and debugging. - // Useful for testing things like DNSLink without real DNS lookup. - // Example: - // IPFS_NS_MAP="dnslink-test.example.com:/ipfs/bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am" - if list := os.Getenv("IPFS_NS_MAP"); list != "" { - staticMap = make(map[string]path.Path) - for _, pair := range strings.Split(list, ",") { - mapping := strings.SplitN(pair, ":", 2) - key := mapping[0] - value := path.FromString(mapping[1]) - staticMap[key] = value - } - } - - return &mpns{ - dnsResolver: NewDNSResolver(), - proquintResolver: new(ProquintResolver), - ipnsResolver: NewIpnsResolver(r), - ipnsPublisher: NewIpnsPublisher(r, ds), - staticMap: staticMap, - cache: cache, - } -} - -// DefaultResolverCacheTTL defines max ttl of a record placed in namesys cache. -const DefaultResolverCacheTTL = time.Minute - -// Resolve implements Resolver. -func (ns *mpns) Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (path.Path, error) { - if strings.HasPrefix(name, "/ipfs/") { - return path.ParsePath(name) - } - - if !strings.HasPrefix(name, "/") { - return path.ParsePath("/ipfs/" + name) - } - - return resolve(ctx, ns, name, opts.ProcessOpts(options)) -} - -func (ns *mpns) ResolveAsync(ctx context.Context, name string, options ...opts.ResolveOpt) <-chan Result { - if strings.HasPrefix(name, "/ipfs/") { - p, err := path.ParsePath(name) - res := make(chan Result, 1) - res <- Result{p, err} - close(res) - return res - } - - if !strings.HasPrefix(name, "/") { - p, err := path.ParsePath("/ipfs/" + name) - res := make(chan Result, 1) - res <- Result{p, err} - close(res) - return res - } - - return resolveAsync(ctx, ns, name, opts.ProcessOpts(options)) -} - -// resolveOnce implements resolver. -func (ns *mpns) resolveOnceAsync(ctx context.Context, name string, options opts.ResolveOpts) <-chan onceResult { - out := make(chan onceResult, 1) - - if !strings.HasPrefix(name, ipnsPrefix) { - name = ipnsPrefix + name - } - segments := strings.SplitN(name, "/", 4) - if len(segments) < 3 || segments[0] != "" { - log.Debugf("invalid name syntax for %s", name) - out <- onceResult{err: ErrResolveFailed} - close(out) - return out - } - - key := segments[2] - - // Resolver selection: - // 1. if it is a PeerID/CID/multihash resolve through "ipns". - // 2. if it is a domain name, resolve through "dns" - // 3. otherwise resolve through the "proquint" resolver - - var res resolver - ipnsKey, err := peer.Decode(key) - - // CIDs in IPNS are expected to have libp2p-key multicodec - // We ease the transition by returning a more meaningful error with a valid CID - if err != nil && err.Error() == "can't convert CID of type protobuf to a peer ID" { - ipnsCid, cidErr := cid.Decode(key) - if cidErr == nil && ipnsCid.Version() == 1 && ipnsCid.Type() != cid.Libp2pKey { - fixedCid := cid.NewCidV1(cid.Libp2pKey, ipnsCid.Hash()).String() - codecErr := fmt.Errorf("peer ID represented as CIDv1 require libp2p-key multicodec: retry with /ipns/%s", fixedCid) - log.Debugf("RoutingResolver: could not convert public key hash %s to peer ID: %s\n", key, codecErr) - out <- onceResult{err: codecErr} - close(out) - return out - } - } - - cacheKey := key - if err == nil { - cacheKey = string(ipnsKey) - } - - if p, ok := ns.cacheGet(cacheKey); ok { - var err error - if len(segments) > 3 { - p, err = path.FromSegments("", strings.TrimRight(p.String(), "/"), segments[3]) - } - - out <- onceResult{value: p, err: err} - close(out) - return out - } - - if err == nil { - res = ns.ipnsResolver - } else if isd.IsDomain(key) { - res = ns.dnsResolver - } else { - res = ns.proquintResolver - } - - resCh := res.resolveOnceAsync(ctx, key, options) - var best onceResult - go func() { - defer close(out) - for { - select { - case res, ok := <-resCh: - if !ok { - if best != (onceResult{}) { - ns.cacheSet(cacheKey, best.value, best.ttl) - } - return - } - if res.err == nil { - best = res - } - p := res.value - err := res.err - ttl := res.ttl - - // Attach rest of the path - if len(segments) > 3 { - p, err = path.FromSegments("", strings.TrimRight(p.String(), "/"), segments[3]) - } - - emitOnceResult(ctx, out, onceResult{value: p, ttl: ttl, err: err}) - case <-ctx.Done(): - return - } - } - }() - - return out -} - -func emitOnceResult(ctx context.Context, outCh chan<- onceResult, r onceResult) { - select { - case outCh <- r: - case <-ctx.Done(): - } -} - -// Publish implements Publisher -func (ns *mpns) Publish(ctx context.Context, name ci.PrivKey, value path.Path) error { - return ns.PublishWithEOL(ctx, name, value, time.Now().Add(DefaultRecordEOL)) -} - -func (ns *mpns) PublishWithEOL(ctx context.Context, name ci.PrivKey, value path.Path, eol time.Time) error { - id, err := peer.IDFromPrivateKey(name) - if err != nil { - return err - } - if err := ns.ipnsPublisher.PublishWithEOL(ctx, name, value, eol); err != nil { - // Invalidate the cache. Publishing may _partially_ succeed but - // still return an error. - ns.cacheInvalidate(string(id)) - return err - } - ttl := DefaultResolverCacheTTL - if setTTL, ok := checkCtxTTL(ctx); ok { - ttl = setTTL - } - if ttEol := time.Until(eol); ttEol < ttl { - ttl = ttEol - } - ns.cacheSet(string(id), value, ttl) - return nil -} diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go deleted file mode 100644 index cc0ca69590c..00000000000 --- a/namesys/namesys_test.go +++ /dev/null @@ -1,169 +0,0 @@ -package namesys - -import ( - "context" - "fmt" - "testing" - "time" - - ds "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - offroute "github.com/ipfs/go-ipfs-routing/offline" - ipns "github.com/ipfs/go-ipns" - path "github.com/ipfs/go-path" - unixfs "github.com/ipfs/go-unixfs" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" - ci "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" - pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" - record "github.com/libp2p/go-libp2p-record" -) - -type mockResolver struct { - entries map[string]string -} - -func testResolution(t *testing.T, resolver Resolver, name string, depth uint, expected string, expError error) { - t.Helper() - p, err := resolver.Resolve(context.Background(), name, opts.Depth(depth)) - if err != expError { - t.Fatal(fmt.Errorf( - "expected %s with a depth of %d to have a '%s' error, but got '%s'", - name, depth, expError, err)) - } - if p.String() != expected { - t.Fatal(fmt.Errorf( - "%s with depth %d resolved to %s != %s", - name, depth, p.String(), expected)) - } -} - -func (r *mockResolver) resolveOnceAsync(ctx context.Context, name string, options opts.ResolveOpts) <-chan onceResult { - p, err := path.ParsePath(r.entries[name]) - out := make(chan onceResult, 1) - out <- onceResult{value: p, err: err} - close(out) - return out -} - -func mockResolverOne() *mockResolver { - return &mockResolver{ - entries: map[string]string{ - "QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy": "/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", - "QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n": "/ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy", - "QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD": "/ipns/ipfs.io", - "QmQ4QZh8nrsczdUEwTyfBope4THUhqxqc1fx6qYhhzZQei": "/ipfs/QmP3ouCnU8NNLsW6261pAx2pNLV2E4dQoisB1sgda12Act", - "12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5": "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", // ed25519+identity multihash - "bafzbeickencdqw37dpz3ha36ewrh4undfjt2do52chtcky4rxkj447qhdm": "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", // cidv1 in base32 with libp2p-key multicodec - }, - } -} - -func mockResolverTwo() *mockResolver { - return &mockResolver{ - entries: map[string]string{ - "ipfs.io": "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", - }, - } -} - -func TestNamesysResolution(t *testing.T) { - r := &mpns{ - ipnsResolver: mockResolverOne(), - dnsResolver: mockResolverTwo(), - } - - testResolution(t, r, "Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", opts.DefaultDepthLimit, "/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", nil) - testResolution(t, r, "/ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy", opts.DefaultDepthLimit, "/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", nil) - testResolution(t, r, "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", opts.DefaultDepthLimit, "/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", nil) - testResolution(t, r, "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", 1, "/ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy", ErrResolveRecursion) - testResolution(t, r, "/ipns/ipfs.io", opts.DefaultDepthLimit, "/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", nil) - testResolution(t, r, "/ipns/ipfs.io", 1, "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", ErrResolveRecursion) - testResolution(t, r, "/ipns/ipfs.io", 2, "/ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy", ErrResolveRecursion) - testResolution(t, r, "/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", opts.DefaultDepthLimit, "/ipfs/Qmcqtw8FfrVSBaRmbWwHxt3AuySBhJLcvmFYi3Lbc4xnwj", nil) - testResolution(t, r, "/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", 1, "/ipns/ipfs.io", ErrResolveRecursion) - testResolution(t, r, "/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", 2, "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", ErrResolveRecursion) - testResolution(t, r, "/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", 3, "/ipns/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy", ErrResolveRecursion) - testResolution(t, r, "/ipns/12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5", 1, "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", ErrResolveRecursion) - testResolution(t, r, "/ipns/bafzbeickencdqw37dpz3ha36ewrh4undfjt2do52chtcky4rxkj447qhdm", 1, "/ipns/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", ErrResolveRecursion) -} - -func TestPublishWithCache0(t *testing.T) { - dst := dssync.MutexWrap(ds.NewMapDatastore()) - priv, _, err := ci.GenerateKeyPair(ci.RSA, 2048) - if err != nil { - t.Fatal(err) - } - ps := pstoremem.NewPeerstore() - pid, err := peer.IDFromPrivateKey(priv) - if err != nil { - t.Fatal(err) - } - err = ps.AddPrivKey(pid, priv) - if err != nil { - t.Fatal(err) - } - - routing := offroute.NewOfflineRouter(dst, record.NamespacedValidator{ - "ipns": ipns.Validator{KeyBook: ps}, - "pk": record.PublicKeyValidator{}, - }) - - nsys := NewNameSystem(routing, dst, 0) - p, err := path.ParsePath(unixfs.EmptyDirNode().Cid().String()) - if err != nil { - t.Fatal(err) - } - err = nsys.Publish(context.Background(), priv, p) - if err != nil { - t.Fatal(err) - } -} - -func TestPublishWithTTL(t *testing.T) { - dst := dssync.MutexWrap(ds.NewMapDatastore()) - priv, _, err := ci.GenerateKeyPair(ci.RSA, 2048) - if err != nil { - t.Fatal(err) - } - ps := pstoremem.NewPeerstore() - pid, err := peer.IDFromPrivateKey(priv) - if err != nil { - t.Fatal(err) - } - err = ps.AddPrivKey(pid, priv) - if err != nil { - t.Fatal(err) - } - - routing := offroute.NewOfflineRouter(dst, record.NamespacedValidator{ - "ipns": ipns.Validator{KeyBook: ps}, - "pk": record.PublicKeyValidator{}, - }) - - nsys := NewNameSystem(routing, dst, 128) - p, err := path.ParsePath(unixfs.EmptyDirNode().Cid().String()) - if err != nil { - t.Fatal(err) - } - - ttl := 1 * time.Second - eol := time.Now().Add(2 * time.Second) - - ctx := context.WithValue(context.Background(), "ipns-publish-ttl", ttl) - err = nsys.Publish(ctx, priv, p) - if err != nil { - t.Fatal(err) - } - ientry, ok := nsys.(*mpns).cache.Get(string(pid)) - if !ok { - t.Fatal("cache get failed") - } - entry, ok := ientry.(cacheEntry) - if !ok { - t.Fatal("bad cache item returned") - } - if entry.eol.Sub(eol) > 10*time.Millisecond { - t.Fatalf("bad cache ttl: expected %s, got %s", eol, entry.eol) - } -} diff --git a/namesys/proquint.go b/namesys/proquint.go deleted file mode 100644 index 63cb62a0476..00000000000 --- a/namesys/proquint.go +++ /dev/null @@ -1,32 +0,0 @@ -package namesys - -import ( - "context" - "errors" - - proquint "github.com/bren2010/proquint" - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" -) - -type ProquintResolver struct{} - -// Resolve implements Resolver. -func (r *ProquintResolver) Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (path.Path, error) { - return resolve(ctx, r, name, opts.ProcessOpts(options)) -} - -// resolveOnce implements resolver. Decodes the proquint string. -func (r *ProquintResolver) resolveOnceAsync(ctx context.Context, name string, options opts.ResolveOpts) <-chan onceResult { - out := make(chan onceResult, 1) - defer close(out) - - ok, err := proquint.IsProquint(name) - if err != nil || !ok { - out <- onceResult{err: errors.New("not a valid proquint string")} - return out - } - // Return a 0 TTL as caching this result is pointless. - out <- onceResult{value: path.FromString(string(proquint.Decode(name)))} - return out -} diff --git a/namesys/publisher.go b/namesys/publisher.go deleted file mode 100644 index f558eaf2885..00000000000 --- a/namesys/publisher.go +++ /dev/null @@ -1,309 +0,0 @@ -package namesys - -import ( - "context" - "strings" - "sync" - "time" - - proto "github.com/gogo/protobuf/proto" - ds "github.com/ipfs/go-datastore" - dsquery "github.com/ipfs/go-datastore/query" - pin "github.com/ipfs/go-ipfs-pinner" - ipns "github.com/ipfs/go-ipns" - pb "github.com/ipfs/go-ipns/pb" - path "github.com/ipfs/go-path" - ft "github.com/ipfs/go-unixfs" - ci "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" - routing "github.com/libp2p/go-libp2p-core/routing" - base32 "github.com/whyrusleeping/base32" -) - -const ipnsPrefix = "/ipns/" - -const DefaultRecordEOL = 24 * time.Hour - -// IpnsPublisher is capable of publishing and resolving names to the IPFS -// routing system. -type IpnsPublisher struct { - routing routing.ValueStore - ds ds.Datastore - - // Used to ensure we assign IPNS records *sequential* sequence numbers. - mu sync.Mutex -} - -// NewIpnsPublisher constructs a publisher for the IPFS Routing name system. -func NewIpnsPublisher(route routing.ValueStore, ds ds.Datastore) *IpnsPublisher { - if ds == nil { - panic("nil datastore") - } - return &IpnsPublisher{routing: route, ds: ds} -} - -// Publish implements Publisher. Accepts a keypair and a value, -// and publishes it out to the routing system -func (p *IpnsPublisher) Publish(ctx context.Context, k ci.PrivKey, value path.Path) error { - log.Debugf("Publish %s", value) - return p.PublishWithEOL(ctx, k, value, time.Now().Add(DefaultRecordEOL)) -} - -func IpnsDsKey(id peer.ID) ds.Key { - return ds.NewKey("/ipns/" + base32.RawStdEncoding.EncodeToString([]byte(id))) -} - -// PublishedNames returns the latest IPNS records published by this node and -// their expiration times. -// -// This method will not search the routing system for records published by other -// nodes. -func (p *IpnsPublisher) ListPublished(ctx context.Context) (map[peer.ID]*pb.IpnsEntry, error) { - query, err := p.ds.Query(dsquery.Query{ - Prefix: ipnsPrefix, - }) - if err != nil { - return nil, err - } - defer query.Close() - - records := make(map[peer.ID]*pb.IpnsEntry) - for { - select { - case result, ok := <-query.Next(): - if !ok { - return records, nil - } - if result.Error != nil { - return nil, result.Error - } - e := new(pb.IpnsEntry) - if err := proto.Unmarshal(result.Value, e); err != nil { - // Might as well return what we can. - log.Error("found an invalid IPNS entry:", err) - continue - } - if !strings.HasPrefix(result.Key, ipnsPrefix) { - log.Errorf("datastore query for keys with prefix %s returned a key: %s", ipnsPrefix, result.Key) - continue - } - k := result.Key[len(ipnsPrefix):] - pid, err := base32.RawStdEncoding.DecodeString(k) - if err != nil { - log.Errorf("ipns ds key invalid: %s", result.Key) - continue - } - records[peer.ID(pid)] = e - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} - -// GetPublished returns the record this node has published corresponding to the -// given peer ID. -// -// If `checkRouting` is true and we have no existing record, this method will -// check the routing system for any existing records. -func (p *IpnsPublisher) GetPublished(ctx context.Context, id peer.ID, checkRouting bool) (*pb.IpnsEntry, error) { - ctx, cancel := context.WithTimeout(ctx, time.Second*30) - defer cancel() - - value, err := p.ds.Get(IpnsDsKey(id)) - switch err { - case nil: - case ds.ErrNotFound: - if !checkRouting { - return nil, nil - } - ipnskey := ipns.RecordKey(id) - value, err = p.routing.GetValue(ctx, ipnskey) - if err != nil { - // Not found or other network issue. Can't really do - // anything about this case. - if err != routing.ErrNotFound { - log.Debugf("error when determining the last published IPNS record for %s: %s", id, err) - } - - return nil, nil - } - default: - return nil, err - } - e := new(pb.IpnsEntry) - if err := proto.Unmarshal(value, e); err != nil { - return nil, err - } - return e, nil -} - -func (p *IpnsPublisher) updateRecord(ctx context.Context, k ci.PrivKey, value path.Path, eol time.Time) (*pb.IpnsEntry, error) { - id, err := peer.IDFromPrivateKey(k) - if err != nil { - return nil, err - } - - p.mu.Lock() - defer p.mu.Unlock() - - // get previous records sequence number - rec, err := p.GetPublished(ctx, id, true) - if err != nil { - return nil, err - } - - seqno := rec.GetSequence() // returns 0 if rec is nil - if rec != nil && value != path.Path(rec.GetValue()) { - // Don't bother incrementing the sequence number unless the - // value changes. - seqno++ - } - - // Create record - entry, err := ipns.Create(k, []byte(value), seqno, eol) - if err != nil { - return nil, err - } - - // Set the TTL - // TODO: Make this less hacky. - ttl, ok := checkCtxTTL(ctx) - if ok { - entry.Ttl = proto.Uint64(uint64(ttl.Nanoseconds())) - } - - data, err := proto.Marshal(entry) - if err != nil { - return nil, err - } - - // Put the new record. - key := IpnsDsKey(id) - if err := p.ds.Put(key, data); err != nil { - return nil, err - } - if err := p.ds.Sync(key); err != nil { - return nil, err - } - return entry, nil -} - -// PublishWithEOL is a temporary stand in for the ipns records implementation -// see here for more details: https://github.com/ipfs/specs/tree/master/records -func (p *IpnsPublisher) PublishWithEOL(ctx context.Context, k ci.PrivKey, value path.Path, eol time.Time) error { - record, err := p.updateRecord(ctx, k, value, eol) - if err != nil { - return err - } - - return PutRecordToRouting(ctx, p.routing, k.GetPublic(), record) -} - -// setting the TTL on published records is an experimental feature. -// as such, i'm using the context to wire it through to avoid changing too -// much code along the way. -func checkCtxTTL(ctx context.Context) (time.Duration, bool) { - v := ctx.Value("ipns-publish-ttl") - if v == nil { - return 0, false - } - - d, ok := v.(time.Duration) - return d, ok -} - -func PutRecordToRouting(ctx context.Context, r routing.ValueStore, k ci.PubKey, entry *pb.IpnsEntry) error { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - errs := make(chan error, 2) // At most two errors (IPNS, and public key) - - if err := ipns.EmbedPublicKey(k, entry); err != nil { - return err - } - - id, err := peer.IDFromPublicKey(k) - if err != nil { - return err - } - - go func() { - errs <- PublishEntry(ctx, r, ipns.RecordKey(id), entry) - }() - - // Publish the public key if a public key cannot be extracted from the ID - // TODO: once v0.4.16 is widespread enough, we can stop doing this - // and at that point we can even deprecate the /pk/ namespace in the dht - // - // NOTE: This check actually checks if the public key has been embedded - // in the IPNS entry. This check is sufficient because we embed the - // public key in the IPNS entry if it can't be extracted from the ID. - if entry.PubKey != nil { - go func() { - errs <- PublishPublicKey(ctx, r, PkKeyForID(id), k) - }() - - if err := waitOnErrChan(ctx, errs); err != nil { - return err - } - } - - return waitOnErrChan(ctx, errs) -} - -func waitOnErrChan(ctx context.Context, errs chan error) error { - select { - case err := <-errs: - return err - case <-ctx.Done(): - return ctx.Err() - } -} - -func PublishPublicKey(ctx context.Context, r routing.ValueStore, k string, pubk ci.PubKey) error { - log.Debugf("Storing pubkey at: %s", k) - pkbytes, err := pubk.Bytes() - if err != nil { - return err - } - - // Store associated public key - return r.PutValue(ctx, k, pkbytes) -} - -func PublishEntry(ctx context.Context, r routing.ValueStore, ipnskey string, rec *pb.IpnsEntry) error { - data, err := proto.Marshal(rec) - if err != nil { - return err - } - - log.Debugf("Storing ipns entry at: %s", ipnskey) - // Store ipns entry at "/ipns/"+h(pubkey) - return r.PutValue(ctx, ipnskey, data) -} - -// InitializeKeyspace sets the ipns record for the given key to -// point to an empty directory. -// TODO: this doesnt feel like it belongs here -func InitializeKeyspace(ctx context.Context, pub Publisher, pins pin.Pinner, key ci.PrivKey) error { - emptyDir := ft.EmptyDirNode() - - // pin recursively because this might already be pinned - // and doing a direct pin would throw an error in that case - err := pins.Pin(ctx, emptyDir, true) - if err != nil { - return err - } - - err = pins.Flush(ctx) - if err != nil { - return err - } - - return pub.Publish(ctx, key, path.FromCid(emptyDir.Cid())) -} - -// PkKeyForID returns the public key routing key for the given peer ID. -func PkKeyForID(id peer.ID) string { - return "/pk/" + string(id) -} diff --git a/namesys/publisher_test.go b/namesys/publisher_test.go deleted file mode 100644 index 62510338353..00000000000 --- a/namesys/publisher_test.go +++ /dev/null @@ -1,155 +0,0 @@ -package namesys - -import ( - "context" - "crypto/rand" - "github.com/ipfs/go-path" - "testing" - "time" - - ds "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - dshelp "github.com/ipfs/go-ipfs-ds-help" - mockrouting "github.com/ipfs/go-ipfs-routing/mock" - ipns "github.com/ipfs/go-ipns" - ci "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" - testutil "github.com/libp2p/go-libp2p-testing/net" - ma "github.com/multiformats/go-multiaddr" -) - -type identity struct { - testutil.PeerNetParams -} - -func (p *identity) ID() peer.ID { - return p.PeerNetParams.ID -} - -func (p *identity) Address() ma.Multiaddr { - return p.Addr -} - -func (p *identity) PrivateKey() ci.PrivKey { - return p.PrivKey -} - -func (p *identity) PublicKey() ci.PubKey { - return p.PubKey -} - -func testNamekeyPublisher(t *testing.T, keyType int, expectedErr error, expectedExistence bool) { - // Context - ctx := context.Background() - - // Private key - privKey, pubKey, err := ci.GenerateKeyPairWithReader(keyType, 2048, rand.Reader) - if err != nil { - t.Fatal(err) - } - - // ID - id, err := peer.IDFromPublicKey(pubKey) - if err != nil { - t.Fatal(err) - } - - // Value - value := []byte("ipfs/TESTING") - - // Seqnum - seqnum := uint64(0) - - // Eol - eol := time.Now().Add(24 * time.Hour) - - // Routing value store - p := testutil.PeerNetParams{ - ID: id, - PrivKey: privKey, - PubKey: pubKey, - Addr: testutil.ZeroLocalTCPAddress, - } - - dstore := dssync.MutexWrap(ds.NewMapDatastore()) - serv := mockrouting.NewServer() - r := serv.ClientWithDatastore(context.Background(), &identity{p}, dstore) - - entry, err := ipns.Create(privKey, value, seqnum, eol) - if err != nil { - t.Fatal(err) - } - - err = PutRecordToRouting(ctx, r, pubKey, entry) - if err != nil { - t.Fatal(err) - } - - // Check for namekey existence in value store - namekey := PkKeyForID(id) - _, err = r.GetValue(ctx, namekey) - if err != expectedErr { - t.Fatal(err) - } - - // Also check datastore for completeness - key := dshelp.NewKeyFromBinary([]byte(namekey)) - exists, err := dstore.Has(key) - if err != nil { - t.Fatal(err) - } - - if exists != expectedExistence { - t.Fatal("Unexpected key existence in datastore") - } -} - -func TestRSAPublisher(t *testing.T) { - testNamekeyPublisher(t, ci.RSA, nil, true) -} - -func TestEd22519Publisher(t *testing.T) { - testNamekeyPublisher(t, ci.Ed25519, ds.ErrNotFound, false) -} - -func TestAsyncDS(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - rt := mockrouting.NewServer().Client(testutil.RandIdentityOrFatal(t)) - ds := &checkSyncDS{ - Datastore: ds.NewMapDatastore(), - syncKeys: make(map[ds.Key]struct{}), - } - publisher := NewIpnsPublisher(rt, ds) - - ipnsFakeID := testutil.RandIdentityOrFatal(t) - ipnsVal, err := path.ParsePath("/ipns/foo.bar") - if err != nil { - t.Fatal(err) - } - - if err := publisher.Publish(ctx, ipnsFakeID.PrivateKey(), ipnsVal); err != nil { - t.Fatal(err) - } - - ipnsKey := IpnsDsKey(ipnsFakeID.ID()) - - for k := range ds.syncKeys { - if k.IsAncestorOf(ipnsKey) || k.Equal(ipnsKey) { - return - } - } - - t.Fatal("ipns key not synced") -} - -type checkSyncDS struct { - ds.Datastore - syncKeys map[ds.Key]struct{} -} - -func (d *checkSyncDS) Sync(prefix ds.Key) error { - d.syncKeys[prefix] = struct{}{} - return d.Datastore.Sync(prefix) -} diff --git a/namesys/republisher/repub.go b/namesys/republisher/repub.go deleted file mode 100644 index 84dcc911cf4..00000000000 --- a/namesys/republisher/repub.go +++ /dev/null @@ -1,168 +0,0 @@ -package republisher - -import ( - "context" - "errors" - "time" - - keystore "github.com/ipfs/go-ipfs/keystore" - namesys "github.com/ipfs/go-ipfs/namesys" - path "github.com/ipfs/go-path" - - proto "github.com/gogo/protobuf/proto" - ds "github.com/ipfs/go-datastore" - ipns "github.com/ipfs/go-ipns" - pb "github.com/ipfs/go-ipns/pb" - logging "github.com/ipfs/go-log" - goprocess "github.com/jbenet/goprocess" - gpctx "github.com/jbenet/goprocess/context" - ic "github.com/libp2p/go-libp2p-core/crypto" - peer "github.com/libp2p/go-libp2p-core/peer" -) - -var errNoEntry = errors.New("no previous entry") - -var log = logging.Logger("ipns-repub") - -// DefaultRebroadcastInterval is the default interval at which we rebroadcast IPNS records -var DefaultRebroadcastInterval = time.Hour * 4 - -// InitialRebroadcastDelay is the delay before first broadcasting IPNS records on start -var InitialRebroadcastDelay = time.Minute * 1 - -// FailureRetryInterval is the interval at which we retry IPNS records broadcasts (when they fail) -var FailureRetryInterval = time.Minute * 5 - -// DefaultRecordLifetime is the default lifetime for IPNS records -const DefaultRecordLifetime = time.Hour * 24 - -type Republisher struct { - ns namesys.Publisher - ds ds.Datastore - self ic.PrivKey - ks keystore.Keystore - - Interval time.Duration - - // how long records that are republished should be valid for - RecordLifetime time.Duration -} - -// NewRepublisher creates a new Republisher -func NewRepublisher(ns namesys.Publisher, ds ds.Datastore, self ic.PrivKey, ks keystore.Keystore) *Republisher { - return &Republisher{ - ns: ns, - ds: ds, - self: self, - ks: ks, - Interval: DefaultRebroadcastInterval, - RecordLifetime: DefaultRecordLifetime, - } -} - -func (rp *Republisher) Run(proc goprocess.Process) { - timer := time.NewTimer(InitialRebroadcastDelay) - defer timer.Stop() - if rp.Interval < InitialRebroadcastDelay { - timer.Reset(rp.Interval) - } - - for { - select { - case <-timer.C: - timer.Reset(rp.Interval) - err := rp.republishEntries(proc) - if err != nil { - log.Info("republisher failed to republish: ", err) - if FailureRetryInterval < rp.Interval { - timer.Reset(FailureRetryInterval) - } - } - case <-proc.Closing(): - return - } - } -} - -func (rp *Republisher) republishEntries(p goprocess.Process) error { - ctx, cancel := context.WithCancel(gpctx.OnClosingContext(p)) - defer cancel() - - // TODO: Use rp.ipns.ListPublished(). We can't currently *do* that - // because: - // 1. There's no way to get keys from the keystore by ID. - // 2. We don't actually have access to the IPNS publisher. - err := rp.republishEntry(ctx, rp.self) - if err != nil { - return err - } - - if rp.ks != nil { - keyNames, err := rp.ks.List() - if err != nil { - return err - } - for _, name := range keyNames { - priv, err := rp.ks.Get(name) - if err != nil { - return err - } - err = rp.republishEntry(ctx, priv) - if err != nil { - return err - } - - } - } - - return nil -} - -func (rp *Republisher) republishEntry(ctx context.Context, priv ic.PrivKey) error { - id, err := peer.IDFromPrivateKey(priv) - if err != nil { - return err - } - - log.Debugf("republishing ipns entry for %s", id) - - // Look for it locally only - e, err := rp.getLastIPNSEntry(id) - if err != nil { - if err == errNoEntry { - return nil - } - return err - } - - p := path.Path(e.GetValue()) - prevEol, err := ipns.GetEOL(e) - if err != nil { - return err - } - - // update record with same sequence number - eol := time.Now().Add(rp.RecordLifetime) - if prevEol.After(eol) { - eol = prevEol - } - return rp.ns.PublishWithEOL(ctx, priv, p, eol) -} - -func (rp *Republisher) getLastIPNSEntry(id peer.ID) (*pb.IpnsEntry, error) { - // Look for it locally only - val, err := rp.ds.Get(namesys.IpnsDsKey(id)) - switch err { - case nil: - case ds.ErrNotFound: - return nil, errNoEntry - default: - return nil, err - } - - e := new(pb.IpnsEntry) - if err := proto.Unmarshal(val, e); err != nil { - return nil, err - } - return e, nil -} diff --git a/namesys/republisher/repub_test.go b/namesys/republisher/repub_test.go deleted file mode 100644 index c75d7faa9be..00000000000 --- a/namesys/republisher/repub_test.go +++ /dev/null @@ -1,245 +0,0 @@ -package republisher_test - -import ( - "context" - "errors" - "testing" - "time" - - "github.com/gogo/protobuf/proto" - - goprocess "github.com/jbenet/goprocess" - peer "github.com/libp2p/go-libp2p-core/peer" - mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" - - ds "github.com/ipfs/go-datastore" - "github.com/ipfs/go-ipns" - "github.com/ipfs/go-ipns/pb" - path "github.com/ipfs/go-path" - - "github.com/ipfs/go-ipfs/core" - "github.com/ipfs/go-ipfs/core/bootstrap" - mock "github.com/ipfs/go-ipfs/core/mock" - namesys "github.com/ipfs/go-ipfs/namesys" - . "github.com/ipfs/go-ipfs/namesys/republisher" -) - -func TestRepublish(t *testing.T) { - // set cache life to zero for testing low-period repubs - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - // create network - mn := mocknet.New(ctx) - - var nodes []*core.IpfsNode - for i := 0; i < 10; i++ { - nd, err := mock.MockPublicNode(ctx, mn) - if err != nil { - t.Fatal(err) - } - - nd.Namesys = namesys.NewNameSystem(nd.Routing, nd.Repo.Datastore(), 0) - - nodes = append(nodes, nd) - } - - if err := mn.LinkAll(); err != nil { - t.Fatal(err) - } - - bsinf := bootstrap.BootstrapConfigWithPeers( - []peer.AddrInfo{ - nodes[0].Peerstore.PeerInfo(nodes[0].Identity), - }, - ) - - for _, n := range nodes[1:] { - if err := n.Bootstrap(bsinf); err != nil { - t.Fatal(err) - } - } - - // have one node publish a record that is valid for 1 second - publisher := nodes[3] - p := path.FromString("/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn") // does not need to be valid - rp := namesys.NewIpnsPublisher(publisher.Routing, publisher.Repo.Datastore()) - name := "/ipns/" + publisher.Identity.Pretty() - - // Retry in case the record expires before we can fetch it. This can - // happen when running the test on a slow machine. - var expiration time.Time - timeout := time.Second - for { - expiration = time.Now().Add(time.Second) - err := rp.PublishWithEOL(ctx, publisher.PrivateKey, p, expiration) - if err != nil { - t.Fatal(err) - } - - err = verifyResolution(nodes, name, p) - if err == nil { - break - } - - if time.Now().After(expiration) { - timeout *= 2 - continue - } - t.Fatal(err) - } - - // Now wait a second, the records will be invalid and we should fail to resolve - time.Sleep(timeout) - if err := verifyResolutionFails(nodes, name); err != nil { - t.Fatal(err) - } - - // The republishers that are contained within the nodes have their timeout set - // to 12 hours. Instead of trying to tweak those, we're just going to pretend - // they don't exist and make our own. - repub := NewRepublisher(rp, publisher.Repo.Datastore(), publisher.PrivateKey, publisher.Repo.Keystore()) - repub.Interval = time.Second - repub.RecordLifetime = time.Second * 5 - - proc := goprocess.Go(repub.Run) - defer proc.Close() - - // now wait a couple seconds for it to fire - time.Sleep(time.Second * 2) - - // we should be able to resolve them now - if err := verifyResolution(nodes, name, p); err != nil { - t.Fatal(err) - } -} - -func TestLongEOLRepublish(t *testing.T) { - // set cache life to zero for testing low-period repubs - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - // create network - mn := mocknet.New(ctx) - - var nodes []*core.IpfsNode - for i := 0; i < 10; i++ { - nd, err := mock.MockPublicNode(ctx, mn) - if err != nil { - t.Fatal(err) - } - - nd.Namesys = namesys.NewNameSystem(nd.Routing, nd.Repo.Datastore(), 0) - - nodes = append(nodes, nd) - } - - if err := mn.LinkAll(); err != nil { - t.Fatal(err) - } - - bsinf := bootstrap.BootstrapConfigWithPeers( - []peer.AddrInfo{ - nodes[0].Peerstore.PeerInfo(nodes[0].Identity), - }, - ) - - for _, n := range nodes[1:] { - if err := n.Bootstrap(bsinf); err != nil { - t.Fatal(err) - } - } - - // have one node publish a record that is valid for 1 second - publisher := nodes[3] - p := path.FromString("/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn") // does not need to be valid - rp := namesys.NewIpnsPublisher(publisher.Routing, publisher.Repo.Datastore()) - name := "/ipns/" + publisher.Identity.Pretty() - - expiration := time.Now().Add(time.Hour) - err := rp.PublishWithEOL(ctx, publisher.PrivateKey, p, expiration) - if err != nil { - t.Fatal(err) - } - - err = verifyResolution(nodes, name, p) - if err != nil { - t.Fatal(err) - } - - // The republishers that are contained within the nodes have their timeout set - // to 12 hours. Instead of trying to tweak those, we're just going to pretend - // they don't exist and make our own. - repub := NewRepublisher(rp, publisher.Repo.Datastore(), publisher.PrivateKey, publisher.Repo.Keystore()) - repub.Interval = time.Millisecond * 500 - repub.RecordLifetime = time.Second - - proc := goprocess.Go(repub.Run) - defer proc.Close() - - // now wait a couple seconds for it to fire a few times - time.Sleep(time.Second * 2) - - err = verifyResolution(nodes, name, p) - if err != nil { - t.Fatal(err) - } - - entry, err := getLastIPNSEntry(publisher.Repo.Datastore(), publisher.Identity) - if err != nil { - t.Fatal(err) - } - - finalEol, err := ipns.GetEOL(entry) - if err != nil { - t.Fatal(err) - } - - if !finalEol.Equal(expiration) { - t.Fatal("expiration time modified") - } -} - -func getLastIPNSEntry(dstore ds.Datastore, id peer.ID) (*ipns_pb.IpnsEntry, error) { - // Look for it locally only - val, err := dstore.Get(namesys.IpnsDsKey(id)) - if err != nil { - return nil, err - } - - e := new(ipns_pb.IpnsEntry) - if err := proto.Unmarshal(val, e); err != nil { - return nil, err - } - return e, nil -} - -func verifyResolution(nodes []*core.IpfsNode, key string, exp path.Path) error { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - for _, n := range nodes { - val, err := n.Namesys.Resolve(ctx, key) - if err != nil { - return err - } - - if val != exp { - return errors.New("resolved wrong record") - } - } - return nil -} - -func verifyResolutionFails(nodes []*core.IpfsNode, key string) error { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - for _, n := range nodes { - _, err := n.Namesys.Resolve(ctx, key) - if err == nil { - return errors.New("expected resolution to fail") - } - } - return nil -} diff --git a/namesys/resolve/resolve.go b/namesys/resolve/resolve.go deleted file mode 100644 index f838a6611f7..00000000000 --- a/namesys/resolve/resolve.go +++ /dev/null @@ -1,52 +0,0 @@ -package resolve - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/ipfs/go-path" - - "github.com/ipfs/go-ipfs/namesys" -) - -// ErrNoNamesys is an explicit error for when an IPFS node doesn't -// (yet) have a name system -var ErrNoNamesys = errors.New( - "core/resolve: no Namesys on IpfsNode - can't resolve ipns entry") - -// ResolveIPNS resolves /ipns paths -func ResolveIPNS(ctx context.Context, nsys namesys.NameSystem, p path.Path) (path.Path, error) { - if strings.HasPrefix(p.String(), "/ipns/") { - // TODO(cryptix): we should be able to query the local cache for the path - if nsys == nil { - return "", ErrNoNamesys - } - - seg := p.Segments() - - if len(seg) < 2 || seg[1] == "" { // just "/" without further segments - err := fmt.Errorf("invalid path %q: ipns path missing IPNS ID", p) - return "", err - } - - extensions := seg[2:] - resolvable, err := path.FromSegments("/", seg[0], seg[1]) - if err != nil { - return "", err - } - - respath, err := nsys.Resolve(ctx, resolvable.String()) - if err != nil { - return "", err - } - - segments := append(respath.Segments(), extensions...) - p, err = path.FromSegments("/", segments...) - if err != nil { - return "", err - } - } - return p, nil -} diff --git a/namesys/resolve_test.go b/namesys/resolve_test.go deleted file mode 100644 index 4f92a2d0d0e..00000000000 --- a/namesys/resolve_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package namesys - -import ( - "context" - "errors" - "testing" - "time" - - ds "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - mockrouting "github.com/ipfs/go-ipfs-routing/mock" - ipns "github.com/ipfs/go-ipns" - path "github.com/ipfs/go-path" - testutil "github.com/libp2p/go-libp2p-testing/net" - tnet "github.com/libp2p/go-libp2p-testing/net" -) - -func TestRoutingResolve(t *testing.T) { - dstore := dssync.MutexWrap(ds.NewMapDatastore()) - serv := mockrouting.NewServer() - id := testutil.RandIdentityOrFatal(t) - d := serv.ClientWithDatastore(context.Background(), id, dstore) - - resolver := NewIpnsResolver(d) - publisher := NewIpnsPublisher(d, dstore) - - identity := tnet.RandIdentityOrFatal(t) - - h := path.FromString("/ipfs/QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN") - err := publisher.Publish(context.Background(), identity.PrivateKey(), h) - if err != nil { - t.Fatal(err) - } - - res, err := resolver.Resolve(context.Background(), identity.ID().Pretty()) - if err != nil { - t.Fatal(err) - } - - if res != h { - t.Fatal("Got back incorrect value.") - } -} - -func TestPrexistingExpiredRecord(t *testing.T) { - dstore := dssync.MutexWrap(ds.NewMapDatastore()) - d := mockrouting.NewServer().ClientWithDatastore(context.Background(), testutil.RandIdentityOrFatal(t), dstore) - - resolver := NewIpnsResolver(d) - publisher := NewIpnsPublisher(d, dstore) - - identity := tnet.RandIdentityOrFatal(t) - - // Make an expired record and put it in the datastore - h := path.FromString("/ipfs/QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN") - eol := time.Now().Add(time.Hour * -1) - - entry, err := ipns.Create(identity.PrivateKey(), []byte(h), 0, eol) - if err != nil { - t.Fatal(err) - } - err = PutRecordToRouting(context.Background(), d, identity.PublicKey(), entry) - if err != nil { - t.Fatal(err) - } - - // Now, with an old record in the system already, try and publish a new one - err = publisher.Publish(context.Background(), identity.PrivateKey(), h) - if err != nil { - t.Fatal(err) - } - - err = verifyCanResolve(resolver, identity.ID().Pretty(), h) - if err != nil { - t.Fatal(err) - } -} - -func TestPrexistingRecord(t *testing.T) { - dstore := dssync.MutexWrap(ds.NewMapDatastore()) - d := mockrouting.NewServer().ClientWithDatastore(context.Background(), testutil.RandIdentityOrFatal(t), dstore) - - resolver := NewIpnsResolver(d) - publisher := NewIpnsPublisher(d, dstore) - - identity := tnet.RandIdentityOrFatal(t) - - // Make a good record and put it in the datastore - h := path.FromString("/ipfs/QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN") - eol := time.Now().Add(time.Hour) - entry, err := ipns.Create(identity.PrivateKey(), []byte(h), 0, eol) - if err != nil { - t.Fatal(err) - } - err = PutRecordToRouting(context.Background(), d, identity.PublicKey(), entry) - if err != nil { - t.Fatal(err) - } - - // Now, with an old record in the system already, try and publish a new one - err = publisher.Publish(context.Background(), identity.PrivateKey(), h) - if err != nil { - t.Fatal(err) - } - - err = verifyCanResolve(resolver, identity.ID().Pretty(), h) - if err != nil { - t.Fatal(err) - } -} - -func verifyCanResolve(r Resolver, name string, exp path.Path) error { - res, err := r.Resolve(context.Background(), name) - if err != nil { - return err - } - - if res != exp { - return errors.New("got back wrong record") - } - - return nil -} diff --git a/namesys/routing.go b/namesys/routing.go deleted file mode 100644 index 8bdfe21e65b..00000000000 --- a/namesys/routing.go +++ /dev/null @@ -1,148 +0,0 @@ -package namesys - -import ( - "context" - "strings" - "time" - - proto "github.com/gogo/protobuf/proto" - cid "github.com/ipfs/go-cid" - ipns "github.com/ipfs/go-ipns" - pb "github.com/ipfs/go-ipns/pb" - logging "github.com/ipfs/go-log" - path "github.com/ipfs/go-path" - opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" - peer "github.com/libp2p/go-libp2p-core/peer" - routing "github.com/libp2p/go-libp2p-core/routing" - dht "github.com/libp2p/go-libp2p-kad-dht" - mh "github.com/multiformats/go-multihash" -) - -var log = logging.Logger("namesys") - -// IpnsResolver implements NSResolver for the main IPFS SFS-like naming -type IpnsResolver struct { - routing routing.ValueStore -} - -// NewIpnsResolver constructs a name resolver using the IPFS Routing system -// to implement SFS-like naming on top. -func NewIpnsResolver(route routing.ValueStore) *IpnsResolver { - if route == nil { - panic("attempt to create resolver with nil routing system") - } - return &IpnsResolver{ - routing: route, - } -} - -// Resolve implements Resolver. -func (r *IpnsResolver) Resolve(ctx context.Context, name string, options ...opts.ResolveOpt) (path.Path, error) { - return resolve(ctx, r, name, opts.ProcessOpts(options)) -} - -// ResolveAsync implements Resolver. -func (r *IpnsResolver) ResolveAsync(ctx context.Context, name string, options ...opts.ResolveOpt) <-chan Result { - return resolveAsync(ctx, r, name, opts.ProcessOpts(options)) -} - -// resolveOnce implements resolver. Uses the IPFS routing system to -// resolve SFS-like names. -func (r *IpnsResolver) resolveOnceAsync(ctx context.Context, name string, options opts.ResolveOpts) <-chan onceResult { - out := make(chan onceResult, 1) - log.Debugf("RoutingResolver resolving %s", name) - cancel := func() {} - - if options.DhtTimeout != 0 { - // Resolution must complete within the timeout - ctx, cancel = context.WithTimeout(ctx, options.DhtTimeout) - } - - name = strings.TrimPrefix(name, "/ipns/") - - pid, err := peer.Decode(name) - if err != nil { - log.Debugf("RoutingResolver: could not convert public key hash %s to peer ID: %s\n", name, err) - out <- onceResult{err: err} - close(out) - cancel() - return out - } - - // Use the routing system to get the name. - // Note that the DHT will call the ipns validator when retrieving - // the value, which in turn verifies the ipns record signature - ipnsKey := ipns.RecordKey(pid) - - vals, err := r.routing.SearchValue(ctx, ipnsKey, dht.Quorum(int(options.DhtRecordCount))) - if err != nil { - log.Debugf("RoutingResolver: dht get for name %s failed: %s", name, err) - out <- onceResult{err: err} - close(out) - cancel() - return out - } - - go func() { - defer cancel() - defer close(out) - for { - select { - case val, ok := <-vals: - if !ok { - return - } - - entry := new(pb.IpnsEntry) - err = proto.Unmarshal(val, entry) - if err != nil { - log.Debugf("RoutingResolver: could not unmarshal value for name %s: %s", name, err) - emitOnceResult(ctx, out, onceResult{err: err}) - return - } - - var p path.Path - // check for old style record: - if valh, err := mh.Cast(entry.GetValue()); err == nil { - // Its an old style multihash record - log.Debugf("encountered CIDv0 ipns entry: %s", valh) - p = path.FromCid(cid.NewCidV0(valh)) - } else { - // Not a multihash, probably a new style record - p, err = path.ParsePath(string(entry.GetValue())) - if err != nil { - emitOnceResult(ctx, out, onceResult{err: err}) - return - } - } - - ttl := DefaultResolverCacheTTL - if entry.Ttl != nil { - ttl = time.Duration(*entry.Ttl) - } - switch eol, err := ipns.GetEOL(entry); err { - case ipns.ErrUnrecognizedValidity: - // No EOL. - case nil: - ttEol := time.Until(eol) - if ttEol < 0 { - // It *was* valid when we first resolved it. - ttl = 0 - } else if ttEol < ttl { - ttl = ttEol - } - default: - log.Errorf("encountered error when parsing EOL: %s", err) - emitOnceResult(ctx, out, onceResult{err: err}) - return - } - - emitOnceResult(ctx, out, onceResult{value: p, ttl: ttl}) - case <-ctx.Done(): - return - } - } - }() - - return out -} diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 011c47a1d7c..56526e2e687 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -11,7 +11,7 @@ import ( "sync" filestore "github.com/ipfs/go-filestore" - keystore "github.com/ipfs/go-ipfs/keystore" + keystore "github.com/ipfs/go-ipfs-keystore" repo "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-ipfs/repo/common" mfsr "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" diff --git a/repo/mock.go b/repo/mock.go index f39fe6f1795..298a49a298d 100644 --- a/repo/mock.go +++ b/repo/mock.go @@ -4,7 +4,7 @@ import ( "errors" filestore "github.com/ipfs/go-filestore" - keystore "github.com/ipfs/go-ipfs/keystore" + keystore "github.com/ipfs/go-ipfs-keystore" config "github.com/ipfs/go-ipfs-config" ma "github.com/multiformats/go-multiaddr" diff --git a/repo/repo.go b/repo/repo.go index 5c2557c6a82..614bfa5beda 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -5,7 +5,7 @@ import ( "io" filestore "github.com/ipfs/go-filestore" - keystore "github.com/ipfs/go-ipfs/keystore" + keystore "github.com/ipfs/go-ipfs-keystore" ds "github.com/ipfs/go-datastore" config "github.com/ipfs/go-ipfs-config" From 077266d3bd1912be5f6335c94ea69ecae25aad04 Mon Sep 17 00:00:00 2001 From: gammazero Date: Mon, 15 Mar 2021 17:13:45 -0700 Subject: [PATCH 044/161] Review changes --- cmd/ipfs/daemon.go | 3 +- repo/fsrepo/migrations/fetch_test.go | 72 +++++++++++++---------- repo/fsrepo/migrations/fetcher.go | 13 ---- repo/fsrepo/migrations/httpfetcher.go | 55 +++++++++-------- repo/fsrepo/migrations/ipfsdir.go | 27 --------- repo/fsrepo/migrations/ipfsdir_test.go | 55 ----------------- repo/fsrepo/migrations/migrations_test.go | 19 ++---- repo/fsrepo/migrations/versions.go | 18 ------ repo/fsrepo/migrations/versions_test.go | 33 ++--------- 9 files changed, 79 insertions(+), 216 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index c9b05497b1e..874c367c23b 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -288,9 +288,8 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment return fmt.Errorf("fs-repo requires migration") } - fetcher := migrations.NewHttpFetcher() // Fetch migrations from current distribution, or location from environ - fetcher.SetDistPath(migrations.GetDistPathEnv(migrations.CurrentIpfsDist)) + fetcher := migrations.NewHttpFetcher(migrations.GetDistPathEnv(migrations.CurrentIpfsDist), "", "go-ipfs", 0) err = migrations.RunMigration(cctx.Context(), fetcher, fsrepo.RepoVersion, "", false) if err != nil { fmt.Println("The migrations of fs-repo failed:") diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index c5fa9625f2c..7441e248e7c 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -52,14 +52,10 @@ func createFakeArchive(name string, archZip bool, w io.Writer) { } } -func TestSetDistPath(t *testing.T) { - f1 := NewHttpFetcher() - f2 := NewHttpFetcher() - mf := NewMultiFetcher(f1, f2) - +func TestGetDistPath(t *testing.T) { os.Unsetenv(envIpfsDistPath) - mf.SetDistPath(GetDistPathEnv("")) - if f1.distPath != IpnsIpfsDist { + distPath := GetDistPathEnv("") + if distPath != IpnsIpfsDist { t.Error("did not set default dist path") } @@ -72,28 +68,18 @@ func TestSetDistPath(t *testing.T) { os.Unsetenv(envIpfsDistPath) }() - mf.SetDistPath(GetDistPathEnv("")) - if f1.distPath != testDist { + distPath = GetDistPathEnv("") + if distPath != testDist { t.Error("did not set dist path from environ") } - if f2.distPath != testDist { - t.Error("did not set dist path from environ") - } - - mf.SetDistPath(GetDistPathEnv("ignored")) - if f1.distPath != testDist { - t.Error("did not set dist path from environ") - } - if f2.distPath != testDist { + distPath = GetDistPathEnv("ignored") + if distPath != testDist { t.Error("did not set dist path from environ") } testDist = "/unit/test/dist2" - mf.SetDistPath(testDist) - if f1.distPath != testDist { - t.Error("did not set dist path") - } - if f2.distPath != testDist { + fetcher := NewHttpFetcher(testDist, "", "", 0) + if fetcher.distPath != testDist { t.Error("did not set dist path") } } @@ -102,13 +88,10 @@ func TestHttpFetch(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - fetcher := NewHttpFetcher() ts := createTestServer() defer ts.Close() - err := fetcher.SetGateway(ts.URL) - if err != nil { - panic(err) - } + + fetcher := NewHttpFetcher("", ts.URL, "", 0) rc, err := fetcher.Fetch(ctx, "/versions") if err != nil { @@ -150,12 +133,10 @@ func TestFetchBinary(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - fetcher := NewHttpFetcher() ts := createTestServer() defer ts.Close() - if err = fetcher.SetGateway(ts.URL); err != nil { - panic(err) - } + + fetcher := NewHttpFetcher("", ts.URL, "", 0) vers, err := DistVersions(ctx, fetcher, distFSRM, false) if err != nil { @@ -234,3 +215,30 @@ func TestFetchBinary(t *testing.T) { t.Error("expected 'no binary found in archive' error") } } + +func TestMultiFetcher(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ts := createTestServer() + defer ts.Close() + + badFetcher := NewHttpFetcher("", "bad-url", "", 0) + fetcher := NewHttpFetcher("", ts.URL, "", 0) + + mf := NewMultiFetcher(badFetcher, fetcher) + + rc, err := mf.Fetch(ctx, "/versions") + if err != nil { + t.Fatal(err) + } + defer rc.Close() + + vers, err := ioutil.ReadAll(rc) + if err != nil { + t.Fatal("could not read versions:", err) + } + if len(vers) < 45 { + fmt.Println("unexpected more data") + } +} diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index 6338b75fc11..23a2370ce9f 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -4,7 +4,6 @@ import ( "context" "io" "os" - "strings" ) const ( @@ -21,8 +20,6 @@ type Fetcher interface { // Fetch attempts to fetch the file at the given ipfs path. // Returns io.ReadCloser on success, which caller must close. Fetch(ctx context.Context, filePath string) (io.ReadCloser, error) - // SetDistPath sets the path to the distribution site for a Fetcher - SetDistPath(distPath string) } // MultiFetcher holds multiple Fetchers and provides a Fetch that tries each @@ -59,16 +56,6 @@ func (f *MultiFetcher) Fetch(ctx context.Context, ipfsPath string) (rc io.ReadCl return } -// SetDistPath sets the path to the distribution site for all fetchers -func (f *MultiFetcher) SetDistPath(distPath string) { - if !strings.HasPrefix(distPath, "/") { - distPath = "/" + distPath - } - for _, fetcher := range f.fetchers { - fetcher.SetDistPath(distPath) - } -} - // NewLimitReadCloser returns a new io.ReadCloser with the reader wrappen in a // io.LimitedReader limited to reading the amount specified. func NewLimitReadCloser(rc io.ReadCloser, limit int64) io.ReadCloser { diff --git a/repo/fsrepo/migrations/httpfetcher.go b/repo/fsrepo/migrations/httpfetcher.go index 72374702594..efc43bef6bb 100644 --- a/repo/fsrepo/migrations/httpfetcher.go +++ b/repo/fsrepo/migrations/httpfetcher.go @@ -6,7 +6,6 @@ import ( "io" "io/ioutil" "net/http" - "net/url" "path" "strings" ) @@ -18,43 +17,45 @@ const ( // HttpFetcher fetches files over HTTP type HttpFetcher struct { - gateway string - distPath string - limit int64 + distPath string + gateway string + limit int64 + userAgent string } var _ Fetcher = (*HttpFetcher)(nil) // NewHttpFetcher creates a new HttpFetcher -func NewHttpFetcher() *HttpFetcher { - return &HttpFetcher{ - gateway: defaultGatewayURL, +// +// Specifying "" for distPath sets the default IPNS path. +// Specifying "" for gateway sets the default. +// Specifying 0 for fetchLimit sets the default, -1 means no limit. +func NewHttpFetcher(distPath, gateway, userAgent string, fetchLimit int64) *HttpFetcher { + f := &HttpFetcher{ distPath: IpnsIpfsDist, + gateway: defaultGatewayURL, limit: defaultFetchLimit, } -} -// SetGateway sets the gateway URL -func (f *HttpFetcher) SetGateway(gatewayURL string) error { - gwURL, err := url.Parse(gatewayURL) - if err != nil { - return err + if distPath != "" { + if !strings.HasPrefix(distPath, "/") { + distPath = "/" + distPath + } + f.distPath = distPath } - f.gateway = gwURL.String() - return nil -} -// SetDistPath sets the path to the distribution site. -func (f *HttpFetcher) SetDistPath(distPath string) { - if !strings.HasPrefix(distPath, "/") { - distPath = "/" + distPath + if gateway != "" { + f.gateway = strings.TrimRight(gateway, "/") } - f.distPath = distPath -} -// SetFetchLimit sets the download size limit. A value of 0 means no limit. -func (f *HttpFetcher) SetFetchLimit(limit int64) { - f.limit = limit + if fetchLimit != 0 { + if fetchLimit == -1 { + fetchLimit = 0 + } + f.limit = fetchLimit + } + + return f } // Fetch attempts to fetch the file at the given path, from the distribution @@ -68,7 +69,9 @@ func (f *HttpFetcher) Fetch(ctx context.Context, filePath string) (io.ReadCloser return nil, fmt.Errorf("http.NewRequest error: %s", err) } - req.Header.Set("User-Agent", "go-ipfs") + if f.userAgent != "" { + req.Header.Set("User-Agent", f.userAgent) + } resp, err := http.DefaultClient.Do(req) if err != nil { diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index 9f107dbc28b..ef1a65800ca 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -16,39 +16,12 @@ const ( envIpfsPath = "IPFS_PATH" defIpfsDir = ".ipfs" versionFile = "version" - - // Local IPFS API - apiFile = "api" ) func init() { homedir.DisableCache = true } -// ApiEndpoint reads the api file from the local ipfs install directory and -// returns the address:port read from the file. If the ipfs directory is not -// specified then the default location is used. -func ApiEndpoint(ipfsDir string) (string, error) { - ipfsDir, err := CheckIpfsDir(ipfsDir) - if err != nil { - return "", err - } - apiPath := path.Join(ipfsDir, apiFile) - - apiData, err := ioutil.ReadFile(apiPath) - if err != nil { - return "", err - } - - val := strings.TrimSpace(string(apiData)) - parts := strings.Split(val, "/") - if len(parts) != 5 { - return "", fmt.Errorf("incorrectly formatted api string: %q", val) - } - - return parts[2] + ":" + parts[4], nil -} - // IpfsDir returns the path of the ipfs directory. If dir specified, then // returns the expanded version dir. If dir is "", then return the directory // set by IPFS_PATH, or if IPFS_PATH is not set, then return the default diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go index a1003bc7dac..2ccd507e335 100644 --- a/repo/fsrepo/migrations/ipfsdir_test.go +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -158,58 +158,3 @@ func testRepoVersion(t *testing.T) { t.Fatal(err) } } - -func TestApiEndpoint(t *testing.T) { - var err error - fakeHome, err = ioutil.TempDir("", "testhome") - if err != nil { - panic(err) - } - defer os.RemoveAll(fakeHome) - defer os.Unsetenv("HOME") - - os.Setenv("HOME", fakeHome) - fakeIpfs = path.Join(fakeHome, ".ipfs") - - err = os.Mkdir(fakeIpfs, os.ModePerm) - if err != nil { - panic(err) - } - - _, err = ApiEndpoint("") - if err == nil { - t.Fatal("expected error when missing api file") - } - - apiPath := path.Join(fakeIpfs, apiFile) - err = ioutil.WriteFile(apiPath, []byte("bad-data"), 0644) - if err != nil { - panic(err) - } - - _, err = ApiEndpoint("") - if err == nil { - t.Fatal("expected error when bad data") - } - - err = ioutil.WriteFile(apiPath, []byte("/ip4/127.0.0.1/tcp/5001"), 0644) - if err != nil { - panic(err) - } - - val, err := ApiEndpoint("") - if err != nil { - t.Fatal(err) - } - if val != "127.0.0.1:5001" { - t.Fatal("got unexpected value:", val) - } - - val2, err := ApiEndpoint(fakeIpfs) - if err != nil { - t.Fatal(err) - } - if val2 != val { - t.Fatal("expected", val, "got", val2) - } -} diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 51e47610080..089eaa8d83f 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -115,14 +115,9 @@ func TestFetchMigrations(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - fetcher := NewHttpFetcher() - fetcher.SetDistPath(CurrentIpfsDist) ts := createTestServer() defer ts.Close() - err := fetcher.SetGateway(ts.URL) - if err != nil { - panic(err) - } + fetcher := NewHttpFetcher(CurrentIpfsDist, ts.URL, "", 0) tmpDir, err := ioutil.TempDir("", "migratetest") if err != nil { @@ -166,16 +161,12 @@ func TestRunMigrations(t *testing.T) { t.Fatal(err) } - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - fetcher := NewHttpFetcher() - fetcher.SetDistPath(CurrentIpfsDist) ts := createTestServer() defer ts.Close() - if err = fetcher.SetGateway(ts.URL); err != nil { - panic(err) - } + fetcher := NewHttpFetcher(CurrentIpfsDist, ts.URL, "", 0) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() targetVer := 9 diff --git a/repo/fsrepo/migrations/versions.go b/repo/fsrepo/migrations/versions.go index 7d9fda8359f..508e1e01fcc 100644 --- a/repo/fsrepo/migrations/versions.go +++ b/repo/fsrepo/migrations/versions.go @@ -5,10 +5,8 @@ import ( "context" "errors" "fmt" - "os/exec" "path" "sort" - "strconv" "strings" "github.com/coreos/go-semver/semver" @@ -75,19 +73,3 @@ func DistVersions(ctx context.Context, fetcher Fetcher, dist string, sortDesc bo return out, nil } - -// IpfsRepoVersion returns the repo version required by the ipfs daemon -func IpfsRepoVersion(ctx context.Context) (int, error) { - out, err := exec.CommandContext(ctx, "ipfs", "version", "--repo").CombinedOutput() - if err != nil { - return 0, fmt.Errorf("%s: %s", err, string(out)) - } - - verStr := strings.TrimSpace(string(out)) - ver, err := strconv.Atoi(verStr) - if err != nil { - return 0, fmt.Errorf("repo version is not an integer: %s", verStr) - } - - return ver, nil -} diff --git a/repo/fsrepo/migrations/versions_test.go b/repo/fsrepo/migrations/versions_test.go index 984d70abd78..130a6de26fb 100644 --- a/repo/fsrepo/migrations/versions_test.go +++ b/repo/fsrepo/migrations/versions_test.go @@ -2,7 +2,6 @@ package migrations import ( "context" - "os/exec" "testing" "github.com/coreos/go-semver/semver" @@ -14,13 +13,9 @@ func TestDistVersions(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - fetcher := NewHttpFetcher() ts := createTestServer() defer ts.Close() - err := fetcher.SetGateway(ts.URL) - if err != nil { - panic(err) - } + fetcher := NewHttpFetcher("", ts.URL, "", 0) vers, err := DistVersions(ctx, fetcher, testDist, true) if err != nil { @@ -37,10 +32,9 @@ func TestLatestDistVersion(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - fetcher := NewHttpFetcher() - //ts := createTestServer() - //defer ts.Close() - //fetcher.SetGateway(ts.URL) + ts := createTestServer() + defer ts.Close() + fetcher := NewHttpFetcher("", ts.URL, "", 0) latest, err := LatestDistVersion(ctx, fetcher, testDist, false) if err != nil { @@ -55,22 +49,3 @@ func TestLatestDistVersion(t *testing.T) { } t.Log("Latest version of", testDist, "is", latest) } - -func TestIpfsRepoVersion(t *testing.T) { - _, err := exec.LookPath("ipfs") - if err != nil { - t.Skip("ipfs not available") - } - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ipfsRepoVer, err := IpfsRepoVersion(ctx) - if err != nil { - t.Fatal("Could not get required repo version:", err) - } - if ipfsRepoVer < 1 { - t.Fatal("Invalid repo version") - } - t.Log("IPFS repo version:", ipfsRepoVer) -} From 5ff3dd8e755f07932443a47dc405a4a9d7e3a5b7 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 16 Mar 2021 16:32:43 +0100 Subject: [PATCH 045/161] Feat: Re-import InitializeKeyspace code from go-namesys The InitializeKeyspace functionality is go-ipfs specific but lives in the go-namesys repo. It is only called from initializeIpnsKeyspace, and therefore the code is directly added to this function. The original function will be removed from go-namesys. --- cmd/ipfs/init.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index fe252e8cbf4..de3ad1180fa 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -15,7 +15,8 @@ import ( core "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/commands" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" - namesys "github.com/ipfs/go-namesys" + path "github.com/ipfs/go-path" + unixfs "github.com/ipfs/go-unixfs" cmds "github.com/ipfs/go-ipfs-cmds" config "github.com/ipfs/go-ipfs-config" @@ -245,5 +246,19 @@ func initializeIpnsKeyspace(repoRoot string) error { } defer nd.Close() - return namesys.InitializeKeyspace(ctx, nd.Namesys, nd.Pinning, nd.PrivateKey) + emptyDir := unixfs.EmptyDirNode() + + // pin recursively because this might already be pinned + // and doing a direct pin would throw an error in that case + err = nd.Pinning.Pin(ctx, emptyDir, true) + if err != nil { + return err + } + + err = nd.Pinning.Flush(ctx) + if err != nil { + return err + } + + return nd.Namesys.Publish(ctx, nd.PrivateKey, path.FromCid(emptyDir.Cid())) } From 1430a0104c79eeddbfaa9e14cf2bb07ed73be9c2 Mon Sep 17 00:00:00 2001 From: gammazero Date: Tue, 16 Mar 2021 16:57:44 -0700 Subject: [PATCH 046/161] Update name of latest distribution path const --- repo/fsrepo/migrations/fetch_test.go | 2 +- repo/fsrepo/migrations/fetcher.go | 6 +++--- repo/fsrepo/migrations/httpfetcher.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 7441e248e7c..4b5a48bd9b8 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -55,7 +55,7 @@ func createFakeArchive(name string, archZip bool, w io.Writer) { func TestGetDistPath(t *testing.T) { os.Unsetenv(envIpfsDistPath) distPath := GetDistPathEnv("") - if distPath != IpnsIpfsDist { + if distPath != LatestIpfsDist { t.Error("did not set default dist path") } diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index 23a2370ce9f..4bedafb63aa 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -9,8 +9,8 @@ import ( const ( // Current dirstibution to fetch migrations from CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" - // Distribution IPNS path. Default for fetchers. - IpnsIpfsDist = "/ipns/dist.ipfs.io" + // Latest distribution path. Default for fetchers. + LatestIpfsDist = "/ipns/dist.ipfs.io" // Distribution environ variable envIpfsDistPath = "IPFS_DIST_PATH" @@ -77,7 +77,7 @@ func GetDistPathEnv(distPath string) string { return dist } if distPath == "" { - return IpnsIpfsDist + return LatestIpfsDist } return distPath } diff --git a/repo/fsrepo/migrations/httpfetcher.go b/repo/fsrepo/migrations/httpfetcher.go index efc43bef6bb..876457f106c 100644 --- a/repo/fsrepo/migrations/httpfetcher.go +++ b/repo/fsrepo/migrations/httpfetcher.go @@ -32,7 +32,7 @@ var _ Fetcher = (*HttpFetcher)(nil) // Specifying 0 for fetchLimit sets the default, -1 means no limit. func NewHttpFetcher(distPath, gateway, userAgent string, fetchLimit int64) *HttpFetcher { f := &HttpFetcher{ - distPath: IpnsIpfsDist, + distPath: LatestIpfsDist, gateway: defaultGatewayURL, limit: defaultFetchLimit, } From 4ba03fa8df0e0d398bb946421c2a179828595221 Mon Sep 17 00:00:00 2001 From: lanzafame Date: Wed, 17 Mar 2021 10:15:42 +1000 Subject: [PATCH 047/161] revert registration of metrics against unexposed prom registry --- core/corehttp/metrics.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/corehttp/metrics.go b/core/corehttp/metrics.go index 8a73111fc91..f84a6e18dba 100644 --- a/core/corehttp/metrics.go +++ b/core/corehttp/metrics.go @@ -59,7 +59,6 @@ func MetricsOpenCensusCollectionOption() ServeOption { // This adds collection of net/http-related metrics func MetricsCollectionOption(handlerName string) ServeOption { return func(_ *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) { - promRegistry := prometheus.NewRegistry() // Adapted from github.com/prometheus/client_golang/prometheus/http.go // Work around https://github.com/prometheus/client_golang/pull/311 opts := prometheus.SummaryOpts{ @@ -79,7 +78,7 @@ func MetricsCollectionOption(handlerName string) ServeOption { }, []string{"method", "code"}, ) - if err := promRegistry.Register(reqCnt); err != nil { + if err := prometheus.Register(reqCnt); err != nil { if are, ok := err.(prometheus.AlreadyRegisteredError); ok { reqCnt = are.ExistingCollector.(*prometheus.CounterVec) } else { @@ -90,7 +89,7 @@ func MetricsCollectionOption(handlerName string) ServeOption { opts.Name = "request_duration_seconds" opts.Help = "The HTTP request latencies in seconds." reqDur := prometheus.NewSummaryVec(opts, nil) - if err := promRegistry.Register(reqDur); err != nil { + if err := prometheus.Register(reqDur); err != nil { if are, ok := err.(prometheus.AlreadyRegisteredError); ok { reqDur = are.ExistingCollector.(*prometheus.SummaryVec) } else { @@ -101,7 +100,7 @@ func MetricsCollectionOption(handlerName string) ServeOption { opts.Name = "request_size_bytes" opts.Help = "The HTTP request sizes in bytes." reqSz := prometheus.NewSummaryVec(opts, nil) - if err := promRegistry.Register(reqSz); err != nil { + if err := prometheus.Register(reqSz); err != nil { if are, ok := err.(prometheus.AlreadyRegisteredError); ok { reqSz = are.ExistingCollector.(*prometheus.SummaryVec) } else { @@ -112,7 +111,7 @@ func MetricsCollectionOption(handlerName string) ServeOption { opts.Name = "response_size_bytes" opts.Help = "The HTTP response sizes in bytes." resSz := prometheus.NewSummaryVec(opts, nil) - if err := promRegistry.Register(resSz); err != nil { + if err := prometheus.Register(resSz); err != nil { if are, ok := err.(prometheus.AlreadyRegisteredError); ok { resSz = are.ExistingCollector.(*prometheus.SummaryVec) } else { From 60e2c54db1a2c2d8879aee95ecf62616333547bc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 17 Mar 2021 13:03:08 -0700 Subject: [PATCH 048/161] test(sharness): verify the list of exported metrics We'll have to update this "golden" list as we add/remove metrics, but this will at least warn us if something changes. --- .../t0116-prometheus-data/prometheus_metrics | 575 ++++++++++++++++++ test/sharness/t0116-prometheus.sh | 29 + 2 files changed, 604 insertions(+) create mode 100644 test/sharness/t0116-prometheus-data/prometheus_metrics create mode 100755 test/sharness/t0116-prometheus.sh diff --git a/test/sharness/t0116-prometheus-data/prometheus_metrics b/test/sharness/t0116-prometheus-data/prometheus_metrics new file mode 100644 index 00000000000..0c653e35cb2 --- /dev/null +++ b/test/sharness/t0116-prometheus-data/prometheus_metrics @@ -0,0 +1,575 @@ +flatfs_datastore_batchcommit_errors_total +flatfs_datastore_batchcommit_latency_seconds_bucket +flatfs_datastore_batchcommit_latency_seconds_bucket +flatfs_datastore_batchcommit_latency_seconds_bucket +flatfs_datastore_batchcommit_latency_seconds_bucket +flatfs_datastore_batchcommit_latency_seconds_bucket +flatfs_datastore_batchcommit_latency_seconds_bucket +flatfs_datastore_batchcommit_latency_seconds_count +flatfs_datastore_batchcommit_latency_seconds_sum +flatfs_datastore_batchcommit_total +flatfs_datastore_batchdelete_errors_total +flatfs_datastore_batchdelete_latency_seconds_bucket +flatfs_datastore_batchdelete_latency_seconds_bucket +flatfs_datastore_batchdelete_latency_seconds_bucket +flatfs_datastore_batchdelete_latency_seconds_bucket +flatfs_datastore_batchdelete_latency_seconds_bucket +flatfs_datastore_batchdelete_latency_seconds_bucket +flatfs_datastore_batchdelete_latency_seconds_count +flatfs_datastore_batchdelete_latency_seconds_sum +flatfs_datastore_batchdelete_total +flatfs_datastore_batchput_errors_total +flatfs_datastore_batchput_latency_seconds_bucket +flatfs_datastore_batchput_latency_seconds_bucket +flatfs_datastore_batchput_latency_seconds_bucket +flatfs_datastore_batchput_latency_seconds_bucket +flatfs_datastore_batchput_latency_seconds_bucket +flatfs_datastore_batchput_latency_seconds_bucket +flatfs_datastore_batchput_latency_seconds_count +flatfs_datastore_batchput_latency_seconds_sum +flatfs_datastore_batchput_size_bytes_bucket +flatfs_datastore_batchput_size_bytes_bucket +flatfs_datastore_batchput_size_bytes_bucket +flatfs_datastore_batchput_size_bytes_bucket +flatfs_datastore_batchput_size_bytes_bucket +flatfs_datastore_batchput_size_bytes_count +flatfs_datastore_batchput_size_bytes_sum +flatfs_datastore_batchput_total +flatfs_datastore_check_errors_total +flatfs_datastore_check_latency_seconds_bucket +flatfs_datastore_check_latency_seconds_bucket +flatfs_datastore_check_latency_seconds_bucket +flatfs_datastore_check_latency_seconds_bucket +flatfs_datastore_check_latency_seconds_bucket +flatfs_datastore_check_latency_seconds_bucket +flatfs_datastore_check_latency_seconds_count +flatfs_datastore_check_latency_seconds_sum +flatfs_datastore_check_total +flatfs_datastore_delete_errors_total +flatfs_datastore_delete_latency_seconds_bucket +flatfs_datastore_delete_latency_seconds_bucket +flatfs_datastore_delete_latency_seconds_bucket +flatfs_datastore_delete_latency_seconds_bucket +flatfs_datastore_delete_latency_seconds_bucket +flatfs_datastore_delete_latency_seconds_bucket +flatfs_datastore_delete_latency_seconds_count +flatfs_datastore_delete_latency_seconds_sum +flatfs_datastore_delete_total +flatfs_datastore_du_errors_total +flatfs_datastore_du_latency_seconds_bucket +flatfs_datastore_du_latency_seconds_bucket +flatfs_datastore_du_latency_seconds_bucket +flatfs_datastore_du_latency_seconds_bucket +flatfs_datastore_du_latency_seconds_bucket +flatfs_datastore_du_latency_seconds_bucket +flatfs_datastore_du_latency_seconds_count +flatfs_datastore_du_latency_seconds_sum +flatfs_datastore_du_total +flatfs_datastore_gc_errors_total +flatfs_datastore_gc_latency_seconds_bucket +flatfs_datastore_gc_latency_seconds_bucket +flatfs_datastore_gc_latency_seconds_bucket +flatfs_datastore_gc_latency_seconds_bucket +flatfs_datastore_gc_latency_seconds_bucket +flatfs_datastore_gc_latency_seconds_bucket +flatfs_datastore_gc_latency_seconds_count +flatfs_datastore_gc_latency_seconds_sum +flatfs_datastore_gc_total +flatfs_datastore_get_errors_total +flatfs_datastore_get_latency_seconds_bucket +flatfs_datastore_get_latency_seconds_bucket +flatfs_datastore_get_latency_seconds_bucket +flatfs_datastore_get_latency_seconds_bucket +flatfs_datastore_get_latency_seconds_bucket +flatfs_datastore_get_latency_seconds_bucket +flatfs_datastore_get_latency_seconds_count +flatfs_datastore_get_latency_seconds_sum +flatfs_datastore_get_size_bytes_bucket +flatfs_datastore_get_size_bytes_bucket +flatfs_datastore_get_size_bytes_bucket +flatfs_datastore_get_size_bytes_bucket +flatfs_datastore_get_size_bytes_bucket +flatfs_datastore_get_size_bytes_count +flatfs_datastore_get_size_bytes_sum +flatfs_datastore_get_total +flatfs_datastore_getsize_errors_total +flatfs_datastore_getsize_latency_seconds_bucket +flatfs_datastore_getsize_latency_seconds_bucket +flatfs_datastore_getsize_latency_seconds_bucket +flatfs_datastore_getsize_latency_seconds_bucket +flatfs_datastore_getsize_latency_seconds_bucket +flatfs_datastore_getsize_latency_seconds_bucket +flatfs_datastore_getsize_latency_seconds_count +flatfs_datastore_getsize_latency_seconds_sum +flatfs_datastore_getsize_total +flatfs_datastore_has_errors_total +flatfs_datastore_has_latency_seconds_bucket +flatfs_datastore_has_latency_seconds_bucket +flatfs_datastore_has_latency_seconds_bucket +flatfs_datastore_has_latency_seconds_bucket +flatfs_datastore_has_latency_seconds_bucket +flatfs_datastore_has_latency_seconds_bucket +flatfs_datastore_has_latency_seconds_count +flatfs_datastore_has_latency_seconds_sum +flatfs_datastore_has_total +flatfs_datastore_put_errors_total +flatfs_datastore_put_latency_seconds_bucket +flatfs_datastore_put_latency_seconds_bucket +flatfs_datastore_put_latency_seconds_bucket +flatfs_datastore_put_latency_seconds_bucket +flatfs_datastore_put_latency_seconds_bucket +flatfs_datastore_put_latency_seconds_bucket +flatfs_datastore_put_latency_seconds_count +flatfs_datastore_put_latency_seconds_sum +flatfs_datastore_put_size_bytes_bucket +flatfs_datastore_put_size_bytes_bucket +flatfs_datastore_put_size_bytes_bucket +flatfs_datastore_put_size_bytes_bucket +flatfs_datastore_put_size_bytes_bucket +flatfs_datastore_put_size_bytes_count +flatfs_datastore_put_size_bytes_sum +flatfs_datastore_put_total +flatfs_datastore_query_errors_total +flatfs_datastore_query_latency_seconds_bucket +flatfs_datastore_query_latency_seconds_bucket +flatfs_datastore_query_latency_seconds_bucket +flatfs_datastore_query_latency_seconds_bucket +flatfs_datastore_query_latency_seconds_bucket +flatfs_datastore_query_latency_seconds_bucket +flatfs_datastore_query_latency_seconds_count +flatfs_datastore_query_latency_seconds_sum +flatfs_datastore_query_total +flatfs_datastore_scrub_errors_total +flatfs_datastore_scrub_latency_seconds_bucket +flatfs_datastore_scrub_latency_seconds_bucket +flatfs_datastore_scrub_latency_seconds_bucket +flatfs_datastore_scrub_latency_seconds_bucket +flatfs_datastore_scrub_latency_seconds_bucket +flatfs_datastore_scrub_latency_seconds_bucket +flatfs_datastore_scrub_latency_seconds_count +flatfs_datastore_scrub_latency_seconds_sum +flatfs_datastore_scrub_total +flatfs_datastore_sync_errors_total +flatfs_datastore_sync_latency_seconds_bucket +flatfs_datastore_sync_latency_seconds_bucket +flatfs_datastore_sync_latency_seconds_bucket +flatfs_datastore_sync_latency_seconds_bucket +flatfs_datastore_sync_latency_seconds_bucket +flatfs_datastore_sync_latency_seconds_bucket +flatfs_datastore_sync_latency_seconds_count +flatfs_datastore_sync_latency_seconds_sum +flatfs_datastore_sync_total +go_gc_duration_seconds +go_gc_duration_seconds +go_gc_duration_seconds +go_gc_duration_seconds +go_gc_duration_seconds +go_gc_duration_seconds_count +go_gc_duration_seconds_sum +go_goroutines +go_info +go_memstats_alloc_bytes +go_memstats_alloc_bytes_total +go_memstats_buck_hash_sys_bytes +go_memstats_frees_total +go_memstats_gc_cpu_fraction +go_memstats_gc_sys_bytes +go_memstats_heap_alloc_bytes +go_memstats_heap_idle_bytes +go_memstats_heap_inuse_bytes +go_memstats_heap_objects +go_memstats_heap_released_bytes +go_memstats_heap_sys_bytes +go_memstats_last_gc_time_seconds +go_memstats_lookups_total +go_memstats_mallocs_total +go_memstats_mcache_inuse_bytes +go_memstats_mcache_sys_bytes +go_memstats_mspan_inuse_bytes +go_memstats_mspan_sys_bytes +go_memstats_next_gc_bytes +go_memstats_other_sys_bytes +go_memstats_stack_inuse_bytes +go_memstats_stack_sys_bytes +go_memstats_sys_bytes +go_threads +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_bucket +ipfs_bitswap_recv_all_blocks_bytes_count +ipfs_bitswap_recv_all_blocks_bytes_sum +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_bucket +ipfs_bitswap_recv_dup_blocks_bytes_count +ipfs_bitswap_recv_dup_blocks_bytes_sum +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_bucket +ipfs_bitswap_sent_all_blocks_bytes_count +ipfs_bitswap_sent_all_blocks_bytes_sum +ipfs_bitswap_want_blocks_total +ipfs_bitswap_wantlist_total +ipfs_bs_cache_arc_hits_total +ipfs_bs_cache_arc_total +ipfs_fsrepo_datastore_batchcommit_errors_total +ipfs_fsrepo_datastore_batchcommit_latency_seconds_bucket +ipfs_fsrepo_datastore_batchcommit_latency_seconds_bucket +ipfs_fsrepo_datastore_batchcommit_latency_seconds_bucket +ipfs_fsrepo_datastore_batchcommit_latency_seconds_bucket +ipfs_fsrepo_datastore_batchcommit_latency_seconds_bucket +ipfs_fsrepo_datastore_batchcommit_latency_seconds_bucket +ipfs_fsrepo_datastore_batchcommit_latency_seconds_count +ipfs_fsrepo_datastore_batchcommit_latency_seconds_sum +ipfs_fsrepo_datastore_batchcommit_total +ipfs_fsrepo_datastore_batchdelete_errors_total +ipfs_fsrepo_datastore_batchdelete_latency_seconds_bucket +ipfs_fsrepo_datastore_batchdelete_latency_seconds_bucket +ipfs_fsrepo_datastore_batchdelete_latency_seconds_bucket +ipfs_fsrepo_datastore_batchdelete_latency_seconds_bucket +ipfs_fsrepo_datastore_batchdelete_latency_seconds_bucket +ipfs_fsrepo_datastore_batchdelete_latency_seconds_bucket +ipfs_fsrepo_datastore_batchdelete_latency_seconds_count +ipfs_fsrepo_datastore_batchdelete_latency_seconds_sum +ipfs_fsrepo_datastore_batchdelete_total +ipfs_fsrepo_datastore_batchput_errors_total +ipfs_fsrepo_datastore_batchput_latency_seconds_bucket +ipfs_fsrepo_datastore_batchput_latency_seconds_bucket +ipfs_fsrepo_datastore_batchput_latency_seconds_bucket +ipfs_fsrepo_datastore_batchput_latency_seconds_bucket +ipfs_fsrepo_datastore_batchput_latency_seconds_bucket +ipfs_fsrepo_datastore_batchput_latency_seconds_bucket +ipfs_fsrepo_datastore_batchput_latency_seconds_count +ipfs_fsrepo_datastore_batchput_latency_seconds_sum +ipfs_fsrepo_datastore_batchput_size_bytes_bucket +ipfs_fsrepo_datastore_batchput_size_bytes_bucket +ipfs_fsrepo_datastore_batchput_size_bytes_bucket +ipfs_fsrepo_datastore_batchput_size_bytes_bucket +ipfs_fsrepo_datastore_batchput_size_bytes_bucket +ipfs_fsrepo_datastore_batchput_size_bytes_count +ipfs_fsrepo_datastore_batchput_size_bytes_sum +ipfs_fsrepo_datastore_batchput_total +ipfs_fsrepo_datastore_check_errors_total +ipfs_fsrepo_datastore_check_latency_seconds_bucket +ipfs_fsrepo_datastore_check_latency_seconds_bucket +ipfs_fsrepo_datastore_check_latency_seconds_bucket +ipfs_fsrepo_datastore_check_latency_seconds_bucket +ipfs_fsrepo_datastore_check_latency_seconds_bucket +ipfs_fsrepo_datastore_check_latency_seconds_bucket +ipfs_fsrepo_datastore_check_latency_seconds_count +ipfs_fsrepo_datastore_check_latency_seconds_sum +ipfs_fsrepo_datastore_check_total +ipfs_fsrepo_datastore_delete_errors_total +ipfs_fsrepo_datastore_delete_latency_seconds_bucket +ipfs_fsrepo_datastore_delete_latency_seconds_bucket +ipfs_fsrepo_datastore_delete_latency_seconds_bucket +ipfs_fsrepo_datastore_delete_latency_seconds_bucket +ipfs_fsrepo_datastore_delete_latency_seconds_bucket +ipfs_fsrepo_datastore_delete_latency_seconds_bucket +ipfs_fsrepo_datastore_delete_latency_seconds_count +ipfs_fsrepo_datastore_delete_latency_seconds_sum +ipfs_fsrepo_datastore_delete_total +ipfs_fsrepo_datastore_du_errors_total +ipfs_fsrepo_datastore_du_latency_seconds_bucket +ipfs_fsrepo_datastore_du_latency_seconds_bucket +ipfs_fsrepo_datastore_du_latency_seconds_bucket +ipfs_fsrepo_datastore_du_latency_seconds_bucket +ipfs_fsrepo_datastore_du_latency_seconds_bucket +ipfs_fsrepo_datastore_du_latency_seconds_bucket +ipfs_fsrepo_datastore_du_latency_seconds_count +ipfs_fsrepo_datastore_du_latency_seconds_sum +ipfs_fsrepo_datastore_du_total +ipfs_fsrepo_datastore_gc_errors_total +ipfs_fsrepo_datastore_gc_latency_seconds_bucket +ipfs_fsrepo_datastore_gc_latency_seconds_bucket +ipfs_fsrepo_datastore_gc_latency_seconds_bucket +ipfs_fsrepo_datastore_gc_latency_seconds_bucket +ipfs_fsrepo_datastore_gc_latency_seconds_bucket +ipfs_fsrepo_datastore_gc_latency_seconds_bucket +ipfs_fsrepo_datastore_gc_latency_seconds_count +ipfs_fsrepo_datastore_gc_latency_seconds_sum +ipfs_fsrepo_datastore_gc_total +ipfs_fsrepo_datastore_get_errors_total +ipfs_fsrepo_datastore_get_latency_seconds_bucket +ipfs_fsrepo_datastore_get_latency_seconds_bucket +ipfs_fsrepo_datastore_get_latency_seconds_bucket +ipfs_fsrepo_datastore_get_latency_seconds_bucket +ipfs_fsrepo_datastore_get_latency_seconds_bucket +ipfs_fsrepo_datastore_get_latency_seconds_bucket +ipfs_fsrepo_datastore_get_latency_seconds_count +ipfs_fsrepo_datastore_get_latency_seconds_sum +ipfs_fsrepo_datastore_get_size_bytes_bucket +ipfs_fsrepo_datastore_get_size_bytes_bucket +ipfs_fsrepo_datastore_get_size_bytes_bucket +ipfs_fsrepo_datastore_get_size_bytes_bucket +ipfs_fsrepo_datastore_get_size_bytes_bucket +ipfs_fsrepo_datastore_get_size_bytes_count +ipfs_fsrepo_datastore_get_size_bytes_sum +ipfs_fsrepo_datastore_get_total +ipfs_fsrepo_datastore_getsize_errors_total +ipfs_fsrepo_datastore_getsize_latency_seconds_bucket +ipfs_fsrepo_datastore_getsize_latency_seconds_bucket +ipfs_fsrepo_datastore_getsize_latency_seconds_bucket +ipfs_fsrepo_datastore_getsize_latency_seconds_bucket +ipfs_fsrepo_datastore_getsize_latency_seconds_bucket +ipfs_fsrepo_datastore_getsize_latency_seconds_bucket +ipfs_fsrepo_datastore_getsize_latency_seconds_count +ipfs_fsrepo_datastore_getsize_latency_seconds_sum +ipfs_fsrepo_datastore_getsize_total +ipfs_fsrepo_datastore_has_errors_total +ipfs_fsrepo_datastore_has_latency_seconds_bucket +ipfs_fsrepo_datastore_has_latency_seconds_bucket +ipfs_fsrepo_datastore_has_latency_seconds_bucket +ipfs_fsrepo_datastore_has_latency_seconds_bucket +ipfs_fsrepo_datastore_has_latency_seconds_bucket +ipfs_fsrepo_datastore_has_latency_seconds_bucket +ipfs_fsrepo_datastore_has_latency_seconds_count +ipfs_fsrepo_datastore_has_latency_seconds_sum +ipfs_fsrepo_datastore_has_total +ipfs_fsrepo_datastore_put_errors_total +ipfs_fsrepo_datastore_put_latency_seconds_bucket +ipfs_fsrepo_datastore_put_latency_seconds_bucket +ipfs_fsrepo_datastore_put_latency_seconds_bucket +ipfs_fsrepo_datastore_put_latency_seconds_bucket +ipfs_fsrepo_datastore_put_latency_seconds_bucket +ipfs_fsrepo_datastore_put_latency_seconds_bucket +ipfs_fsrepo_datastore_put_latency_seconds_count +ipfs_fsrepo_datastore_put_latency_seconds_sum +ipfs_fsrepo_datastore_put_size_bytes_bucket +ipfs_fsrepo_datastore_put_size_bytes_bucket +ipfs_fsrepo_datastore_put_size_bytes_bucket +ipfs_fsrepo_datastore_put_size_bytes_bucket +ipfs_fsrepo_datastore_put_size_bytes_bucket +ipfs_fsrepo_datastore_put_size_bytes_count +ipfs_fsrepo_datastore_put_size_bytes_sum +ipfs_fsrepo_datastore_put_total +ipfs_fsrepo_datastore_query_errors_total +ipfs_fsrepo_datastore_query_latency_seconds_bucket +ipfs_fsrepo_datastore_query_latency_seconds_bucket +ipfs_fsrepo_datastore_query_latency_seconds_bucket +ipfs_fsrepo_datastore_query_latency_seconds_bucket +ipfs_fsrepo_datastore_query_latency_seconds_bucket +ipfs_fsrepo_datastore_query_latency_seconds_bucket +ipfs_fsrepo_datastore_query_latency_seconds_count +ipfs_fsrepo_datastore_query_latency_seconds_sum +ipfs_fsrepo_datastore_query_total +ipfs_fsrepo_datastore_scrub_errors_total +ipfs_fsrepo_datastore_scrub_latency_seconds_bucket +ipfs_fsrepo_datastore_scrub_latency_seconds_bucket +ipfs_fsrepo_datastore_scrub_latency_seconds_bucket +ipfs_fsrepo_datastore_scrub_latency_seconds_bucket +ipfs_fsrepo_datastore_scrub_latency_seconds_bucket +ipfs_fsrepo_datastore_scrub_latency_seconds_bucket +ipfs_fsrepo_datastore_scrub_latency_seconds_count +ipfs_fsrepo_datastore_scrub_latency_seconds_sum +ipfs_fsrepo_datastore_scrub_total +ipfs_fsrepo_datastore_sync_errors_total +ipfs_fsrepo_datastore_sync_latency_seconds_bucket +ipfs_fsrepo_datastore_sync_latency_seconds_bucket +ipfs_fsrepo_datastore_sync_latency_seconds_bucket +ipfs_fsrepo_datastore_sync_latency_seconds_bucket +ipfs_fsrepo_datastore_sync_latency_seconds_bucket +ipfs_fsrepo_datastore_sync_latency_seconds_bucket +ipfs_fsrepo_datastore_sync_latency_seconds_count +ipfs_fsrepo_datastore_sync_latency_seconds_sum +ipfs_fsrepo_datastore_sync_total +ipfs_http_request_duration_seconds +ipfs_http_request_duration_seconds +ipfs_http_request_duration_seconds +ipfs_http_request_duration_seconds_count +ipfs_http_request_duration_seconds_sum +ipfs_http_request_size_bytes +ipfs_http_request_size_bytes +ipfs_http_request_size_bytes +ipfs_http_request_size_bytes_count +ipfs_http_request_size_bytes_sum +ipfs_http_requests_total +ipfs_http_response_size_bytes +ipfs_http_response_size_bytes +ipfs_http_response_size_bytes +ipfs_http_response_size_bytes_count +ipfs_http_response_size_bytes_sum +ipfs_info +leveldb_datastore_batchcommit_errors_total +leveldb_datastore_batchcommit_latency_seconds_bucket +leveldb_datastore_batchcommit_latency_seconds_bucket +leveldb_datastore_batchcommit_latency_seconds_bucket +leveldb_datastore_batchcommit_latency_seconds_bucket +leveldb_datastore_batchcommit_latency_seconds_bucket +leveldb_datastore_batchcommit_latency_seconds_bucket +leveldb_datastore_batchcommit_latency_seconds_count +leveldb_datastore_batchcommit_latency_seconds_sum +leveldb_datastore_batchcommit_total +leveldb_datastore_batchdelete_errors_total +leveldb_datastore_batchdelete_latency_seconds_bucket +leveldb_datastore_batchdelete_latency_seconds_bucket +leveldb_datastore_batchdelete_latency_seconds_bucket +leveldb_datastore_batchdelete_latency_seconds_bucket +leveldb_datastore_batchdelete_latency_seconds_bucket +leveldb_datastore_batchdelete_latency_seconds_bucket +leveldb_datastore_batchdelete_latency_seconds_count +leveldb_datastore_batchdelete_latency_seconds_sum +leveldb_datastore_batchdelete_total +leveldb_datastore_batchput_errors_total +leveldb_datastore_batchput_latency_seconds_bucket +leveldb_datastore_batchput_latency_seconds_bucket +leveldb_datastore_batchput_latency_seconds_bucket +leveldb_datastore_batchput_latency_seconds_bucket +leveldb_datastore_batchput_latency_seconds_bucket +leveldb_datastore_batchput_latency_seconds_bucket +leveldb_datastore_batchput_latency_seconds_count +leveldb_datastore_batchput_latency_seconds_sum +leveldb_datastore_batchput_size_bytes_bucket +leveldb_datastore_batchput_size_bytes_bucket +leveldb_datastore_batchput_size_bytes_bucket +leveldb_datastore_batchput_size_bytes_bucket +leveldb_datastore_batchput_size_bytes_bucket +leveldb_datastore_batchput_size_bytes_count +leveldb_datastore_batchput_size_bytes_sum +leveldb_datastore_batchput_total +leveldb_datastore_check_errors_total +leveldb_datastore_check_latency_seconds_bucket +leveldb_datastore_check_latency_seconds_bucket +leveldb_datastore_check_latency_seconds_bucket +leveldb_datastore_check_latency_seconds_bucket +leveldb_datastore_check_latency_seconds_bucket +leveldb_datastore_check_latency_seconds_bucket +leveldb_datastore_check_latency_seconds_count +leveldb_datastore_check_latency_seconds_sum +leveldb_datastore_check_total +leveldb_datastore_delete_errors_total +leveldb_datastore_delete_latency_seconds_bucket +leveldb_datastore_delete_latency_seconds_bucket +leveldb_datastore_delete_latency_seconds_bucket +leveldb_datastore_delete_latency_seconds_bucket +leveldb_datastore_delete_latency_seconds_bucket +leveldb_datastore_delete_latency_seconds_bucket +leveldb_datastore_delete_latency_seconds_count +leveldb_datastore_delete_latency_seconds_sum +leveldb_datastore_delete_total +leveldb_datastore_du_errors_total +leveldb_datastore_du_latency_seconds_bucket +leveldb_datastore_du_latency_seconds_bucket +leveldb_datastore_du_latency_seconds_bucket +leveldb_datastore_du_latency_seconds_bucket +leveldb_datastore_du_latency_seconds_bucket +leveldb_datastore_du_latency_seconds_bucket +leveldb_datastore_du_latency_seconds_count +leveldb_datastore_du_latency_seconds_sum +leveldb_datastore_du_total +leveldb_datastore_gc_errors_total +leveldb_datastore_gc_latency_seconds_bucket +leveldb_datastore_gc_latency_seconds_bucket +leveldb_datastore_gc_latency_seconds_bucket +leveldb_datastore_gc_latency_seconds_bucket +leveldb_datastore_gc_latency_seconds_bucket +leveldb_datastore_gc_latency_seconds_bucket +leveldb_datastore_gc_latency_seconds_count +leveldb_datastore_gc_latency_seconds_sum +leveldb_datastore_gc_total +leveldb_datastore_get_errors_total +leveldb_datastore_get_latency_seconds_bucket +leveldb_datastore_get_latency_seconds_bucket +leveldb_datastore_get_latency_seconds_bucket +leveldb_datastore_get_latency_seconds_bucket +leveldb_datastore_get_latency_seconds_bucket +leveldb_datastore_get_latency_seconds_bucket +leveldb_datastore_get_latency_seconds_count +leveldb_datastore_get_latency_seconds_sum +leveldb_datastore_get_size_bytes_bucket +leveldb_datastore_get_size_bytes_bucket +leveldb_datastore_get_size_bytes_bucket +leveldb_datastore_get_size_bytes_bucket +leveldb_datastore_get_size_bytes_bucket +leveldb_datastore_get_size_bytes_count +leveldb_datastore_get_size_bytes_sum +leveldb_datastore_get_total +leveldb_datastore_getsize_errors_total +leveldb_datastore_getsize_latency_seconds_bucket +leveldb_datastore_getsize_latency_seconds_bucket +leveldb_datastore_getsize_latency_seconds_bucket +leveldb_datastore_getsize_latency_seconds_bucket +leveldb_datastore_getsize_latency_seconds_bucket +leveldb_datastore_getsize_latency_seconds_bucket +leveldb_datastore_getsize_latency_seconds_count +leveldb_datastore_getsize_latency_seconds_sum +leveldb_datastore_getsize_total +leveldb_datastore_has_errors_total +leveldb_datastore_has_latency_seconds_bucket +leveldb_datastore_has_latency_seconds_bucket +leveldb_datastore_has_latency_seconds_bucket +leveldb_datastore_has_latency_seconds_bucket +leveldb_datastore_has_latency_seconds_bucket +leveldb_datastore_has_latency_seconds_bucket +leveldb_datastore_has_latency_seconds_count +leveldb_datastore_has_latency_seconds_sum +leveldb_datastore_has_total +leveldb_datastore_put_errors_total +leveldb_datastore_put_latency_seconds_bucket +leveldb_datastore_put_latency_seconds_bucket +leveldb_datastore_put_latency_seconds_bucket +leveldb_datastore_put_latency_seconds_bucket +leveldb_datastore_put_latency_seconds_bucket +leveldb_datastore_put_latency_seconds_bucket +leveldb_datastore_put_latency_seconds_count +leveldb_datastore_put_latency_seconds_sum +leveldb_datastore_put_size_bytes_bucket +leveldb_datastore_put_size_bytes_bucket +leveldb_datastore_put_size_bytes_bucket +leveldb_datastore_put_size_bytes_bucket +leveldb_datastore_put_size_bytes_bucket +leveldb_datastore_put_size_bytes_count +leveldb_datastore_put_size_bytes_sum +leveldb_datastore_put_total +leveldb_datastore_query_errors_total +leveldb_datastore_query_latency_seconds_bucket +leveldb_datastore_query_latency_seconds_bucket +leveldb_datastore_query_latency_seconds_bucket +leveldb_datastore_query_latency_seconds_bucket +leveldb_datastore_query_latency_seconds_bucket +leveldb_datastore_query_latency_seconds_bucket +leveldb_datastore_query_latency_seconds_count +leveldb_datastore_query_latency_seconds_sum +leveldb_datastore_query_total +leveldb_datastore_scrub_errors_total +leveldb_datastore_scrub_latency_seconds_bucket +leveldb_datastore_scrub_latency_seconds_bucket +leveldb_datastore_scrub_latency_seconds_bucket +leveldb_datastore_scrub_latency_seconds_bucket +leveldb_datastore_scrub_latency_seconds_bucket +leveldb_datastore_scrub_latency_seconds_bucket +leveldb_datastore_scrub_latency_seconds_count +leveldb_datastore_scrub_latency_seconds_sum +leveldb_datastore_scrub_total +leveldb_datastore_sync_errors_total +leveldb_datastore_sync_latency_seconds_bucket +leveldb_datastore_sync_latency_seconds_bucket +leveldb_datastore_sync_latency_seconds_bucket +leveldb_datastore_sync_latency_seconds_bucket +leveldb_datastore_sync_latency_seconds_bucket +leveldb_datastore_sync_latency_seconds_bucket +leveldb_datastore_sync_latency_seconds_count +leveldb_datastore_sync_latency_seconds_sum +leveldb_datastore_sync_total +process_cpu_seconds_total +process_max_fds +process_open_fds +process_resident_memory_bytes +process_start_time_seconds +process_virtual_memory_bytes +process_virtual_memory_max_bytes +statsd_metric_mapper_cache_gets_total +statsd_metric_mapper_cache_hits_total +statsd_metric_mapper_cache_length diff --git a/test/sharness/t0116-prometheus.sh b/test/sharness/t0116-prometheus.sh new file mode 100755 index 00000000000..0412179febd --- /dev/null +++ b/test/sharness/t0116-prometheus.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2020 Protocol Labs +# MIT/Apache-2.0 Licensed; see the LICENSE file in this repository. +# + +test_description="Test prometheus metrics are exposed correctly" + +. lib/test-lib.sh + +test_init_ipfs + +test_launch_ipfs_daemon + +test_expect_success "collect metrics" ' + curl "$API_ADDR/debug/metrics/prometheus" > raw_metrics +' + +test_kill_ipfs_daemon + +test_expect_success "filter metrics" ' + sed -ne "s/^\([a-z0-9_]\+\).*/\1/p" raw_metrics | LC_ALL=C sort > filtered_metrics +' + +test_expect_success "make sure metrics haven't changed" ' + diff -u ../t0116-prometheus-data/prometheus_metrics filtered_metrics +' + +test_done From c3b9a3f63872536c1df38df1663c4dd0dc4c99a7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 18 Mar 2021 12:02:36 -0700 Subject: [PATCH 049/161] doc: document security fix policy 1. All releases may contain unannounced security fixes. 2. By default, security fixes will not be backported. --- docs/RELEASE_ISSUE_TEMPLATE.md | 2 ++ docs/releases.md | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/RELEASE_ISSUE_TEMPLATE.md b/docs/RELEASE_ISSUE_TEMPLATE.md index 3f1c7ef35a9..7c34627c749 100644 --- a/docs/RELEASE_ISSUE_TEMPLATE.md +++ b/docs/RELEASE_ISSUE_TEMPLATE.md @@ -4,6 +4,8 @@ We're happy to announce go-ipfs X.Y.Z, bla bla... +As usual, this release includes important fixes, some of which may be critical for security. Unless the fix addresses a bug being exploited in the wild, the fix will _not_ be called out in the release notes. Please make sure to update ASAP. See our [release process](https://github.com/ipfs/go-ipfs/tree/master/docs/releases.md#security-fix-policy) for details. + ## 🗺 What's left for release diff --git a/docs/releases.md b/docs/releases.md index 3170ffcb578..97dfa01ce60 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -83,6 +83,14 @@ Patch releases will usually follow a compressed release cycle and should take 2- Some patch releases, especially ones fixing one or more complex bugs, may undergo the full release process. +## Security Fix Policy + +Any release may contain security fixes. Unless the fix addresses a bug being exploited in the wild, the fix will _not_ be called out in the release notes. Please make sure to update ASAP. + +By policy, the team will usually wait until about 2 weeks after the final release to announce any fixed security issues. However, depending on the impact and ease of discovery of the issue, the team may wait more or less time. It is important to always update to the latest version ASAP and file issues if you're unable to update for some reason. + +Finally, unless a security issue is actively being exploited or a significant number of users are unable to update to the latest version (e.g., due to a difficult migration, breaking changes, etc.), security fixes will _not_ be backported to previous releases. + ## Performing a Release The release is managed by the `Lead Maintainer` for `go-ipfs`. It starts with the opening of an issue containing the content available on the [RELEASE_ISSUE_TEMPLATE](./RELEASE_ISSUE_TEMPLATE.md) not more than **48 hours** after the previous release. From b81b7549d34e0b549c0035286bdd02b2be50030c Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 18 Mar 2021 21:15:07 +0100 Subject: [PATCH 050/161] refactor: addressing review - moved to separate utility function - return Bad Request error - improved escaping of values passed via URL path --- core/corehttp/gateway_handler.go | 60 ++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 289fdd725de..2d6b5f037bc 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -39,7 +39,17 @@ var onlyAscii = regexp.MustCompile("[[:^ascii:]]") // HTML-based redirect for errors which can be recovered from, but we want // to provide hint to people that they should fix things on their end. -var redirectTemplate = template.Must(template.New("redirect").Parse(`
{{.ErrorMsg}}
(if a redirect does not happen in 10 seconds, use "{{.SuggestedPath}}" instead)
`)) +var redirectTemplate = template.Must(template.New("redirect").Parse(` + + + + + + + +
{{.ErrorMsg}}
(if a redirect does not happen in 10 seconds, use "{{.SuggestedPath}}" instead)
+ +`)) type redirectTemplateData struct { RedirectURL string @@ -228,27 +238,9 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request parsedPath := ipath.New(urlPath) if pathErr := parsedPath.IsValid(); pathErr != nil { - // Attempt to fix redundant /ipfs/ namespace as long as resulting - // 'intended' path is valid. This is in case gremlins were tickled - // wrong way and user ended up at /ipfs/ipfs/{cid} or /ipfs/ipns/{id} - // like in bafybeien3m7mdn6imm425vc2s22erzyhbvk5n3ofzgikkhmdkh5cuqbpbq - // :^)) - intendedPath := ipath.New(strings.TrimPrefix(urlPath, "/ipfs")) - if err := intendedPath.IsValid(); err == nil { - intendedURL := strings.Replace(r.URL.String(), urlPath, intendedPath.String(), 1) - // return HTML that - // - points at correct canonical path via header - // - displays error - // - redirects to intendedURL after a delay - err = redirectTemplate.Execute(w, redirectTemplateData{ - RedirectURL: intendedURL, - SuggestedPath: intendedPath.String(), - ErrorMsg: pathErr.Error(), - }) - if err != nil { - internalWebError(w, err) - return - } + if fixErr := fixupSuperfluousNamespace(w, r, pathErr, urlPath); fixErr == nil { + // the error was due to redundant namespace, which we were able to fix + // by returning error/redirect page, nothing left to do here return } // unable to fix path, returning error @@ -816,3 +808,27 @@ func preferred404Filename(acceptHeaders []string) (string, string, error) { return "", "", fmt.Errorf("there is no 404 file for the requested content types") } + +// Attempt to fix redundant /ipfs/ namespace as long as resulting +// 'intended' path is valid. This is in case gremlins were tickled +// wrong way and user ended up at /ipfs/ipfs/{cid} or /ipfs/ipns/{id} +// like in bafybeien3m7mdn6imm425vc2s22erzyhbvk5n3ofzgikkhmdkh5cuqbpbq :^)) +func fixupSuperfluousNamespace(w http.ResponseWriter, r *http.Request, pathErr error, urlPath string) error { + intendedPath := ipath.New(strings.TrimPrefix(urlPath, "/ipfs")) + err := intendedPath.IsValid() + if err != nil { + // not a superfluous namespace + return err + } + intendedURL := strings.Replace(r.URL.String(), urlPath, intendedPath.String(), 1) + // return HTTP 400 (Bad Request) with HTML error page that: + // - points at correct canonical path via header + // - displays human-readable error + // - redirects to intendedURL after a short delay + w.WriteHeader(http.StatusBadRequest) + return redirectTemplate.Execute(w, redirectTemplateData{ + RedirectURL: intendedURL, + SuggestedPath: intendedPath.String(), + ErrorMsg: fmt.Sprintf("invalid path: %q should be %q", urlPath, intendedPath.String()), + }) +} From 450baef0e9c113e4751b559dd0562f7c98302668 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 18 Mar 2021 21:48:04 +0100 Subject: [PATCH 051/161] refactor: explicit prefix check https://github.com/ipfs/go-ipfs/pull/7930#discussion_r584001161 --- core/corehttp/gateway_handler.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 2d6b5f037bc..07f08656c78 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -238,7 +238,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request parsedPath := ipath.New(urlPath) if pathErr := parsedPath.IsValid(); pathErr != nil { - if fixErr := fixupSuperfluousNamespace(w, r, pathErr, urlPath); fixErr == nil { + if fixupSuperfluousNamespace(w, r, urlPath) { // the error was due to redundant namespace, which we were able to fix // by returning error/redirect page, nothing left to do here return @@ -813,12 +813,13 @@ func preferred404Filename(acceptHeaders []string) (string, string, error) { // 'intended' path is valid. This is in case gremlins were tickled // wrong way and user ended up at /ipfs/ipfs/{cid} or /ipfs/ipns/{id} // like in bafybeien3m7mdn6imm425vc2s22erzyhbvk5n3ofzgikkhmdkh5cuqbpbq :^)) -func fixupSuperfluousNamespace(w http.ResponseWriter, r *http.Request, pathErr error, urlPath string) error { +func fixupSuperfluousNamespace(w http.ResponseWriter, r *http.Request, urlPath string) bool { + if !(strings.HasPrefix(urlPath, "/ipfs/ipfs/") || strings.HasPrefix(urlPath, "/ipfs/ipns/")) { + return false // not a superfluous namespace + } intendedPath := ipath.New(strings.TrimPrefix(urlPath, "/ipfs")) - err := intendedPath.IsValid() - if err != nil { - // not a superfluous namespace - return err + if err := intendedPath.IsValid(); err != nil { + return false // not a valid path } intendedURL := strings.Replace(r.URL.String(), urlPath, intendedPath.String(), 1) // return HTTP 400 (Bad Request) with HTML error page that: @@ -830,5 +831,5 @@ func fixupSuperfluousNamespace(w http.ResponseWriter, r *http.Request, pathErr e RedirectURL: intendedURL, SuggestedPath: intendedPath.String(), ErrorMsg: fmt.Sprintf("invalid path: %q should be %q", urlPath, intendedPath.String()), - }) + }) == nil } From a35ffee1364b72e50f66fdd1a03f7a3665d99309 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 18 Mar 2021 23:48:53 +0100 Subject: [PATCH 052/161] refactor: safer query handling https://github.com/ipfs/go-ipfs/pull/7930#discussion_r597246135 --- core/corehttp/gateway_handler.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 07f08656c78..4d0a34c2338 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -238,7 +238,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request parsedPath := ipath.New(urlPath) if pathErr := parsedPath.IsValid(); pathErr != nil { - if fixupSuperfluousNamespace(w, r, urlPath) { + if fixupSuperfluousNamespace(w, urlPath, r.URL.RawQuery) { // the error was due to redundant namespace, which we were able to fix // by returning error/redirect page, nothing left to do here return @@ -813,7 +813,7 @@ func preferred404Filename(acceptHeaders []string) (string, string, error) { // 'intended' path is valid. This is in case gremlins were tickled // wrong way and user ended up at /ipfs/ipfs/{cid} or /ipfs/ipns/{id} // like in bafybeien3m7mdn6imm425vc2s22erzyhbvk5n3ofzgikkhmdkh5cuqbpbq :^)) -func fixupSuperfluousNamespace(w http.ResponseWriter, r *http.Request, urlPath string) bool { +func fixupSuperfluousNamespace(w http.ResponseWriter, urlPath string, urlQuery string) bool { if !(strings.HasPrefix(urlPath, "/ipfs/ipfs/") || strings.HasPrefix(urlPath, "/ipfs/ipns/")) { return false // not a superfluous namespace } @@ -821,7 +821,12 @@ func fixupSuperfluousNamespace(w http.ResponseWriter, r *http.Request, urlPath s if err := intendedPath.IsValid(); err != nil { return false // not a valid path } - intendedURL := strings.Replace(r.URL.String(), urlPath, intendedPath.String(), 1) + intendedURL := intendedPath.String() + if urlQuery != "" { + // we render HTML, so ensure query entries are properly escaped + q, _ := url.ParseQuery(urlQuery) + intendedURL = intendedURL + "?" + q.Encode() + } // return HTTP 400 (Bad Request) with HTML error page that: // - points at correct canonical path via header // - displays human-readable error From 763a120ed28c6cd2e77077c6bb0281c583a6b580 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 20 Mar 2021 00:00:58 +0100 Subject: [PATCH 053/161] fix: no fixup if X-Ipfs-Gateway-Prefix is present https://github.com/ipfs/go-ipfs/pull/7930#discussion_r597976690 --- core/corehttp/gateway_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 4d0a34c2338..0275c873d1e 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -238,7 +238,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request parsedPath := ipath.New(urlPath) if pathErr := parsedPath.IsValid(); pathErr != nil { - if fixupSuperfluousNamespace(w, urlPath, r.URL.RawQuery) { + if prefix == "" && fixupSuperfluousNamespace(w, urlPath, r.URL.RawQuery) { // the error was due to redundant namespace, which we were able to fix // by returning error/redirect page, nothing left to do here return From e7ddd3894ba2a0888ce38acf499b4a59883327f5 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 22 Mar 2021 19:42:04 +0100 Subject: [PATCH 054/161] Fix: innacuracies in MFS command documentation. These also end up in API docs. --- core/commands/files.go | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/core/commands/files.go b/core/commands/files.go index db498d815ff..18ffd33e48c 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -43,16 +43,17 @@ The files facility interacts with MFS (Mutable File System). MFS acts as a single, dynamic filesystem mount. MFS has a root CID that is transparently updated when a change happens (and can be checked with "ipfs files stat /"). -All files and folders within MFS are respected and will not be cleaned up -during garbage collections. MFS is independent from the list of pinned items -("ipfs pin ls"). Calls to "ipfs pin add" and "ipfs pin rm" will add and remove -pins independently of MFS. If MFS content that was -additionally pinned is removed by calling "ipfs files rm", it will still -remain pinned. +All files and folders within MFS are respected and will not be deleted +during garbage collections. However, a DAG may be referenced in MFS without +being fully available locally (MFS content is lazy loaded when accessed). +MFS is independent from the list of pinned items ("ipfs pin ls"). Calls to +"ipfs pin add" and "ipfs pin rm" will add and remove pins independently of +MFS. If MFS content that was additionally pinned is removed by calling +"ipfs files rm", it will still remain pinned. Content added with "ipfs add" (which by default also becomes pinned), is not -added to MFS. Any content can be put into MFS with the command "ipfs files cp -/ipfs/ /some/path/". +added to MFS. Any content can be lazily referenced from MFS with the command +"ipfs files cp /ipfs/ /some/path/" (see ipfs files cp --help). NOTE: @@ -321,11 +322,12 @@ func walkBlock(ctx context.Context, dagserv ipld.DAGService, nd ipld.Node) (bool var filesCpCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Copy any IPFS files and directories into MFS (or copy within MFS).", + Tagline: "Add references to IPFS files and directories in MFS (or copy within MFS).", ShortDescription: ` -"ipfs files cp" can be used to copy any IPFS file or directory (usually in the -form /ipfs/, but also any resolvable path), into the Mutable File System -(MFS). +"ipfs files cp" can be used to add references to any IPFS file or directory +(usually in the form /ipfs/, but also any resolvable path) into MFS. +This performs a lazy copy: the full DAG will not be fetched, only the root +node being copied. It can also be used to copy files within MFS, but in the case when an IPFS-path matches an existing MFS path, the IPFS path wins. @@ -337,6 +339,17 @@ $ ipfs add --quieter --pin=false # ... # ... outputs the root CID at the end $ ipfs cp /ipfs/ /your/desired/mfs/path + +If you wish to fully copy content from a different IPFS peer into MFS, do not +forget to force IPFS to fetch to full DAG after doing the "cp" operation. i.e: + +$ ipfs cp /ipfs/ /your/desired/mfs/path +$ ipfs pin add + +The lazy-copy feature can also be used to protect partial DAG contents from +garbage collection. i.e. adding the Wikipedia root to MFS would not download +all the Wikipedia, but will any downloaded Wikipedia-DAG content from being +GC'ed. `, }, Arguments: []cmds.Argument{ @@ -561,7 +574,7 @@ Examples: $ ipfs files read /test/hello hello - `, + `, }, Arguments: []cmds.Argument{ From 0ff1cf33aa03014265335b0c72b104bb90b8279a Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 24 Mar 2021 17:41:14 +0100 Subject: [PATCH 055/161] docs: cosmetic fixes of help text Unfortunately, API docs are genereted from go-ipfs sources via https://github.com/ipfs/http-api-docs so it all gets lost when API docs for new version are re-generated. This re-applies manual fixes from: https://docs.ipfs.io/reference/http/api/ so the next time http-api-docs are re-generated, those changes stay. --- README.md | 14 +++++++------- core/commands/add.go | 10 +++++----- core/commands/config.go | 4 ++-- core/commands/dag/dag.go | 20 ++++++++++---------- core/commands/files.go | 8 ++++---- core/commands/id.go | 2 +- core/commands/keystore.go | 8 ++++---- core/commands/name/ipnsps.go | 6 +++--- core/commands/object/diff.go | 2 +- core/commands/object/object.go | 4 ++-- core/commands/object/patch.go | 4 ++-- core/commands/p2p.go | 4 ++-- core/commands/pin/pin.go | 2 +- core/commands/root.go | 2 +- core/commands/shutdown.go | 5 ++--- core/commands/stat.go | 2 +- core/commands/stat_dht.go | 2 +- core/commands/tar.go | 4 ++-- core/commands/version.go | 6 +++--- 19 files changed, 54 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index f0f7b1510f6..9d59cd64ba6 100644 --- a/README.md +++ b/README.md @@ -288,10 +288,10 @@ Basic proof of 'ipfs working' locally: SUBCOMMANDS BASIC COMMANDS - init Initialize ipfs local configuration - add Add a file to ipfs - cat Show ipfs object data - get Download ipfs objects + init Initialize local IPFS configuration + add Add a file to IPFS + cat Show IPFS object data + get Download IPFS objects ls List links from an object refs List hashes of links from an object @@ -302,7 +302,7 @@ SUBCOMMANDS ADVANCED COMMANDS daemon Start a long-running daemon process - mount Mount an ipfs read-only mount point + mount Mount an IPFS read-only mount point resolve Resolve any type of name name Publish or resolve IPNS names dns Resolve DNS links @@ -310,7 +310,7 @@ SUBCOMMANDS repo Manipulate an IPFS repository NETWORK COMMANDS - id Show info about ipfs peers + id Show info about IPFS peers bootstrap Add or remove bootstrap peers swarm Manage connections to the p2p network dht Query the DHT for values or peers @@ -319,7 +319,7 @@ SUBCOMMANDS TOOL COMMANDS config Manage configuration - version Show ipfs version information + version Show IPFS version information update Download and apply go-ipfs updates commands List all available commands diff --git a/core/commands/add.go b/core/commands/add.go index ba0dc2ecbd5..3284d113043 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -51,13 +51,13 @@ const adderOutChanSize = 8 var AddCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Add a file or directory to ipfs.", + Tagline: "Add a file or directory to IPFS.", ShortDescription: ` -Adds contents of to ipfs. Use -r to add directories (recursively). +Adds contents of to IPFS. Use -r to add directories (recursively). `, LongDescription: ` -Adds contents of to ipfs. Use -r to add directories. -Note that directories are added recursively, to form the ipfs +Adds contents of to IPFS. Use -r to add directories. +Note that directories are added recursively, to form the IPFS MerkleDAG. If the daemon is not running, it will just add locally. @@ -115,7 +115,7 @@ only-hash, and progress/status related flags) will change the final hash. }, Arguments: []cmds.Argument{ - cmds.FileArg("path", true, true, "The path to a file to be added to ipfs.").EnableRecursive().EnableStdin(), + cmds.FileArg("path", true, true, "The path to a file to be added to IPFS.").EnableRecursive().EnableStdin(), }, Options: []cmds.Option{ cmds.OptionRecursivePath, // a builtin option that allows recursive paths (-r, --recursive) diff --git a/core/commands/config.go b/core/commands/config.go index cc6374c24ca..a5157ac9c72 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -38,10 +38,10 @@ const ( var ConfigCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Get and set ipfs config values.", + Tagline: "Get and set IPFS config values.", ShortDescription: ` 'ipfs config' controls configuration variables. It works like 'git config'. -The configuration values are stored in a config file inside your ipfs +The configuration values are stored in a config file inside your IPFS_PATH repository.`, LongDescription: ` 'ipfs config' controls configuration variables. It works diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index 005847039d7..cdfa8ce9661 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -24,9 +24,9 @@ const ( // DagCmd provides a subset of commands for interacting with ipld dag objects var DagCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Interact with ipld dag objects.", + Tagline: "Interact with IPLD DAG objects.", ShortDescription: ` -'ipfs dag' is used for creating and manipulating dag objects/hierarchies. +'ipfs dag' is used for creating and manipulating DAG objects/hierarchies. This subcommand is currently an experimental feature, but it is intended to deprecate and replace the existing 'ipfs object' command moving forward. @@ -67,7 +67,7 @@ type RootMeta struct { // DagPutCmd is a command for adding a dag node var DagPutCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Add a dag node to ipfs.", + Tagline: "Add a DAG node to IPFS.", ShortDescription: ` 'ipfs dag put' accepts input from a file or stdin and parses it into an object of the specified format. @@ -99,9 +99,9 @@ into an object of the specified format. // DagGetCmd is a command for getting a dag node from IPFS var DagGetCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Get a dag node from ipfs.", + Tagline: "Get a DAG node from IPFS.", ShortDescription: ` -'ipfs dag get' fetches a dag node from ipfs and prints it out in the specified +'ipfs dag get' fetches a DAG node from IPFS and prints it out in the specified format. `, }, @@ -114,9 +114,9 @@ format. // DagResolveCmd returns address of highest block within a path and a path remainder var DagResolveCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Resolve ipld block", + Tagline: "Resolve IPLD block.", ShortDescription: ` -'ipfs dag resolve' fetches a dag node from ipfs, prints its address and remaining path. +'ipfs dag resolve' fetches a DAG node from IPFS, prints its address and remaining path. `, }, Arguments: []cmds.Argument{ @@ -230,7 +230,7 @@ var DagExportCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Streams the selected DAG as a .car stream on stdout.", ShortDescription: ` -'ipfs dag export' fetches a dag and streams it out as a well-formed .car file. +'ipfs dag export' fetches a DAG and streams it out as a well-formed .car file. Note that at present only single root selections / .car files are supported. The output of blocks happens in strict DAG-traversal, first-seen, order. `, @@ -260,9 +260,9 @@ func (s *DagStat) String() string { // DagStatCmd is a command for getting size information about an ipfs-stored dag var DagStatCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Gets stats for a DAG", + Tagline: "Gets stats for a DAG.", ShortDescription: ` -'ipfs dag stat' fetches a dag and returns various statistics about the DAG. +'ipfs dag stat' fetches a DAG and returns various statistics about it. Statistics include size and number of blocks. Note: This command skips duplicate blocks in reporting both size and the number of blocks diff --git a/core/commands/files.go b/core/commands/files.go index 18ffd33e48c..927ce51e2cf 100644 --- a/core/commands/files.go +++ b/core/commands/files.go @@ -10,10 +10,10 @@ import ( "sort" "strings" + humanize "github.com/dustin/go-humanize" "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/commands/cmdenv" - "github.com/dustin/go-humanize" bservice "github.com/ipfs/go-blockservice" cid "github.com/ipfs/go-cid" cidenc "github.com/ipfs/go-cidutil/cidenc" @@ -22,7 +22,7 @@ import ( ipld "github.com/ipfs/go-ipld-format" logging "github.com/ipfs/go-log" dag "github.com/ipfs/go-merkledag" - "github.com/ipfs/go-mfs" + mfs "github.com/ipfs/go-mfs" ft "github.com/ipfs/go-unixfs" iface "github.com/ipfs/interface-go-ipfs-core" path "github.com/ipfs/interface-go-ipfs-core/path" @@ -943,9 +943,9 @@ are run with the '--flush=false'. var filesChcidCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Change the cid version or hash function of the root node of a given path.", + Tagline: "Change the CID version or hash function of the root node of a given path.", ShortDescription: ` -Change the cid version or hash function of the root node of a given path. +Change the CID version or hash function of the root node of a given path. `, }, Arguments: []cmds.Argument{ diff --git a/core/commands/id.go b/core/commands/id.go index 83f3bb4b3ab..b77ad7ddbe9 100644 --- a/core/commands/id.go +++ b/core/commands/id.go @@ -48,7 +48,7 @@ const ( var IDCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Show ipfs node id info.", + Tagline: "Show IPFS node id info.", ShortDescription: ` Prints out information about the specified peer. If no peer is specified, prints out information for local peers. diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 9b86ba36b56..85c6ae1a3df 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -300,7 +300,7 @@ var keyImportCmd = &cmds.Command{ var keyListCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "List all local keypairs", + Tagline: "List all local keypairs.", }, Options: []cmds.Option{ cmds.BoolOption("l", "Show extra information about keys."), @@ -345,7 +345,7 @@ const ( var keyRenameCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Rename a keypair", + Tagline: "Rename a keypair.", }, Arguments: []cmds.Argument{ cmds.StringArg("name", true, false, "name of key to rename"), @@ -396,7 +396,7 @@ var keyRenameCmd = &cmds.Command{ var keyRmCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Remove a keypair", + Tagline: "Remove a keypair.", }, Arguments: []cmds.Argument{ cmds.StringArg("name", true, true, "names of keys to remove").EnableStdin(), @@ -440,7 +440,7 @@ var keyRmCmd = &cmds.Command{ var keyRotateCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Rotates the ipfs identity.", + Tagline: "Rotates the IPFS identity.", ShortDescription: ` Generates a new ipfs identity and saves it to the ipfs config file. Your existing identity key will be backed up in the Keystore. diff --git a/core/commands/name/ipnsps.go b/core/commands/name/ipnsps.go index 0aa7c459a4e..31791570970 100644 --- a/core/commands/name/ipnsps.go +++ b/core/commands/name/ipnsps.go @@ -43,7 +43,7 @@ Note: this command is experimental and subject to change as the system is refine var ipnspsStateCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Query the state of IPNS pubsub", + Tagline: "Query the state of IPNS pubsub.", }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { n, err := cmdenv.GetNode(env) @@ -71,7 +71,7 @@ var ipnspsStateCmd = &cmds.Command{ var ipnspsSubsCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Show current name subscriptions", + Tagline: "Show current name subscriptions.", }, Options: []cmds.Option{ ke.OptionIPNSBase, @@ -115,7 +115,7 @@ var ipnspsSubsCmd = &cmds.Command{ var ipnspsCancelCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Cancel a name subscription", + Tagline: "Cancel a name subscription.", }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { n, err := cmdenv.GetNode(env) diff --git a/core/commands/object/diff.go b/core/commands/object/diff.go index 02904476f3c..d83da7cec5d 100644 --- a/core/commands/object/diff.go +++ b/core/commands/object/diff.go @@ -21,7 +21,7 @@ type Changes struct { var ObjectDiffCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Display the diff between two ipfs objects.", + Tagline: "Display the diff between two IPFS objects.", ShortDescription: ` 'ipfs object diff' is a command used to show the differences between two IPFS objects.`, diff --git a/core/commands/object/object.go b/core/commands/object/object.go index ed5bbcf24d7..37eb17cff21 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -8,11 +8,11 @@ import ( "io/ioutil" "text/tabwriter" + cmds "github.com/ipfs/go-ipfs-cmds" "github.com/ipfs/go-ipfs/core/commands/cmdenv" humanize "github.com/dustin/go-humanize" "github.com/ipfs/go-cid" - "github.com/ipfs/go-ipfs-cmds" ipld "github.com/ipfs/go-ipld-format" dag "github.com/ipfs/go-merkledag" "github.com/ipfs/interface-go-ipfs-core/options" @@ -466,7 +466,7 @@ And then run: // ObjectNewCmd object new command var ObjectNewCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Create a new object from an ipfs template.", + Tagline: "Create a new object from an IPFS template.", ShortDescription: ` 'ipfs object new' is a plumbing command for creating new DAG nodes. `, diff --git a/core/commands/object/patch.go b/core/commands/object/patch.go index dfbb7f94f25..2f0239cec10 100644 --- a/core/commands/object/patch.go +++ b/core/commands/object/patch.go @@ -4,9 +4,9 @@ import ( "fmt" "io" + cmds "github.com/ipfs/go-ipfs-cmds" "github.com/ipfs/go-ipfs/core/commands/cmdenv" - "github.com/ipfs/go-ipfs-cmds" "github.com/ipfs/interface-go-ipfs-core/options" "github.com/ipfs/interface-go-ipfs-core/path" ) @@ -31,7 +31,7 @@ result. This is the Merkle-DAG version of modifying an object. var patchAppendDataCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Append data to the data segment of a dag node.", + Tagline: "Append data to the data segment of a DAG node.", ShortDescription: ` Append data to what already exists in the data segment in the given object. diff --git a/core/commands/p2p.go b/core/commands/p2p.go index afd6c03bd49..77e7ca2b4f8 100644 --- a/core/commands/p2p.go +++ b/core/commands/p2p.go @@ -79,7 +79,7 @@ are refined`, var p2pForwardCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Forward connections to libp2p service", + Tagline: "Forward connections to libp2p service.", ShortDescription: ` Forward connections made to to . @@ -180,7 +180,7 @@ func parseIpfsAddr(addr string) (*peer.AddrInfo, error) { var p2pListenCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Create libp2p service", + Tagline: "Create libp2p service.", ShortDescription: ` Create libp2p service and forward connections made to . diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index 409b75cc00d..de8098b5d6d 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -523,7 +523,7 @@ const ( var updatePinCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Update a recursive pin", + Tagline: "Update a recursive pin.", ShortDescription: ` Efficiently pins a new object based on differences from an existing one and, by default, removes the old pin. diff --git a/core/commands/root.go b/core/commands/root.go index f367d06e2bd..788f7aabdea 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -68,7 +68,7 @@ NETWORK COMMANDS TOOL COMMANDS config Manage configuration - version Show ipfs version information + version Show IPFS version information update Download and apply go-ipfs updates commands List all available commands cid Convert and discover properties of CIDs diff --git a/core/commands/shutdown.go b/core/commands/shutdown.go index 9ef35cf94d6..4d4adad03d7 100644 --- a/core/commands/shutdown.go +++ b/core/commands/shutdown.go @@ -1,14 +1,13 @@ package commands import ( + cmds "github.com/ipfs/go-ipfs-cmds" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" - - "github.com/ipfs/go-ipfs-cmds" ) var daemonShutdownCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Shut down the ipfs daemon", + Tagline: "Shut down the IPFS daemon.", }, Run: func(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment) error { nd, err := cmdenv.GetNode(env) diff --git a/core/commands/stat.go b/core/commands/stat.go index 8b83ee4d58d..cc51d7123a7 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -42,7 +42,7 @@ const ( var statBwCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Print ipfs bandwidth information.", + Tagline: "Print IPFS bandwidth information.", ShortDescription: `'ipfs stats bw' prints bandwidth information for the ipfs daemon. It displays: TotalIn, TotalOut, RateIn, RateOut. `, diff --git a/core/commands/stat_dht.go b/core/commands/stat_dht.go index 0a4517c8a0c..a8b5323c507 100644 --- a/core/commands/stat_dht.go +++ b/core/commands/stat_dht.go @@ -35,7 +35,7 @@ type dhtBucket struct { var statDhtCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Returns statistics about the node's DHT(s)", + Tagline: "Returns statistics about the node's DHT(s).", ShortDescription: ` Returns statistics about the DHT(s) the node is participating in. diff --git a/core/commands/tar.go b/core/commands/tar.go index a85b909eba4..efc1503cdb8 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -4,10 +4,10 @@ import ( "fmt" "io" + cmds "github.com/ipfs/go-ipfs-cmds" "github.com/ipfs/go-ipfs/core/commands/cmdenv" tar "github.com/ipfs/go-ipfs/tar" - "github.com/ipfs/go-ipfs-cmds" dag "github.com/ipfs/go-merkledag" path "github.com/ipfs/interface-go-ipfs-core/path" ) @@ -25,7 +25,7 @@ var TarCmd = &cmds.Command{ var tarAddCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Import a tar file into ipfs.", + Tagline: "Import a tar file into IPFS.", ShortDescription: ` 'ipfs tar add' will parse a tar file and create a merkledag structure to represent it. diff --git a/core/commands/version.go b/core/commands/version.go index 834326d1733..a3693545281 100644 --- a/core/commands/version.go +++ b/core/commands/version.go @@ -30,8 +30,8 @@ const ( var VersionCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Show ipfs version information.", - ShortDescription: "Returns the current version of ipfs and exits.", + Tagline: "Show IPFS version information.", + ShortDescription: "Returns the current version of IPFS and exits.", }, Subcommands: map[string]*cmds.Command{ "deps": depsVersionCommand, @@ -105,7 +105,7 @@ const pkgVersionFmt = "%s@%s" var depsVersionCommand = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Shows information about dependencies used for build", + Tagline: "Shows information about dependencies used for build.", ShortDescription: ` Print out all dependencies and their versions.`, }, From 5fad09909f7152b96bc180aeb6dcec1dd91ddfdd Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 24 Mar 2021 18:02:42 +0100 Subject: [PATCH 056/161] docs: suggest dag/files cmds in place of object This is a cosmetic change to 'ipfs --help' that reorders operations to prioritize 'dag' and 'files' over legacy 'object'. Context: https://github.com/ipfs/go-ipfs/issues/7936 --- README.md | 15 +++++++++++---- core/commands/object/object.go | 6 +++--- core/commands/root.go | 8 ++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9d59cd64ba6..b292d778aef 100644 --- a/README.md +++ b/README.md @@ -296,18 +296,23 @@ SUBCOMMANDS refs List hashes of links from an object DATA STRUCTURE COMMANDS + dag Interact with IPLD DAG nodes + files Interact with files as if they were a unix filesystem + object Interact with objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore - object Interact with raw dag nodes - files Interact with objects as if they were a unix filesystem ADVANCED COMMANDS daemon Start a long-running daemon process mount Mount an IPFS read-only mount point resolve Resolve any type of name - name Publish or resolve IPNS names + name Publish and resolve IPNS names + key Create and list IPNS name keypairs dns Resolve DNS links pin Pin objects to local storage - repo Manipulate an IPFS repository + repo Manipulate the IPFS repository + stats Various operational stats + p2p Libp2p stream mounting + filestore Manage the filestore (experimental) NETWORK COMMANDS id Show info about IPFS peers @@ -322,6 +327,8 @@ SUBCOMMANDS version Show IPFS version information update Download and apply go-ipfs updates commands List all available commands + cid Convert and discover properties of CIDs + log Manage and show logs of running daemon Use 'ipfs --help' to learn more about each command. diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 37eb17cff21..9ed68275850 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -48,10 +48,10 @@ const ( var ObjectCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Interact with IPFS objects.", + Tagline: "Interact with objects (deprecated, use 'dag' or 'files')", ShortDescription: ` -'ipfs object' is a plumbing command used to manipulate DAG objects -directly.`, +'ipfs object' is a legacy plumbing command used to manipulate DAG objects +directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`, }, Subcommands: map[string]*cmds.Command{ diff --git a/core/commands/root.go b/core/commands/root.go index 788f7aabdea..7decb8b9b94 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -32,7 +32,7 @@ var Root = &cmds.Command{ Synopsis: "ipfs [--config= | -c] [--debug | -D] [--help] [-h] [--api=] [--offline] [--cid-base=] [--upgrade-cidv0-in-output] [--encoding= | --enc] [--timeout=] ...", Subcommands: ` BASIC COMMANDS - init Initialize ipfs local configuration + init Initialize local IPFS configuration add Add a file to IPFS cat Show IPFS object data get Download IPFS objects @@ -40,10 +40,10 @@ BASIC COMMANDS refs List hashes of links from an object DATA STRUCTURE COMMANDS + dag Interact with IPLD DAG nodes + files Interact with files as if they were a unix filesystem + object Interact with objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore - object Interact with raw dag nodes - files Interact with objects as if they were a unix filesystem - dag Interact with IPLD documents (experimental) ADVANCED COMMANDS daemon Start a long-running daemon process From f91411362baf0812150042e596292baf3854d43a Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 24 Mar 2021 20:49:50 +0100 Subject: [PATCH 057/161] docs: ipfs object only works with dag-pb Closes #7396 --- README.md | 2 +- core/commands/object/object.go | 42 +++++++++++++++++----------------- core/commands/root.go | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b292d778aef..f7ffa719ed6 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ SUBCOMMANDS DATA STRUCTURE COMMANDS dag Interact with IPLD DAG nodes files Interact with files as if they were a unix filesystem - object Interact with objects (deprecated, use 'dag' or 'files') + object Interact with dag-pb objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore ADVANCED COMMANDS diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 9ed68275850..1e52f231566 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -48,9 +48,9 @@ const ( var ObjectCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Interact with objects (deprecated, use 'dag' or 'files')", + Tagline: "Interact with dag-pb objects (deprecated, use generic 'dag')", ShortDescription: ` -'ipfs object' is a legacy plumbing command used to manipulate DAG objects +'ipfs object' is a legacy plumbing command used to manipulate dag-pb objects directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`, }, @@ -69,14 +69,14 @@ directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`, // ObjectDataCmd object data command var ObjectDataCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Output the raw bytes of an IPFS object.", + Tagline: "Output the raw bytes of a dag-pb object.", ShortDescription: ` 'ipfs object data' is a plumbing command for retrieving the raw bytes stored -in a DAG node. It outputs to stdout, and is a base58 encoded multihash. +in a dag-pb node. It outputs to stdout, and is a base58 encoded multihash. `, LongDescription: ` 'ipfs object data' is a plumbing command for retrieving the raw bytes stored -in a DAG node. It outputs to stdout, and is a base58 encoded multihash. +in a dag-pb node. It outputs to stdout, and is a base58 encoded multihash. Note that the "--encoding" option does not affect the output, since the output is the raw data of the object. @@ -106,16 +106,16 @@ is the raw data of the object. // ObjectLinksCmd object links command var ObjectLinksCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Output the links pointed to by the specified object.", + Tagline: "Output the links pointed to by the specified dag-pb object.", ShortDescription: ` 'ipfs object links' is a plumbing command for retrieving the links from -a DAG node. It outputs to stdout, and is a base58 encoded +a dag-pb node. It outputs to stdout, and is a base58 encoded multihash. `, }, Arguments: []cmds.Argument{ - cmds.StringArg("key", true, false, "Key of the object to retrieve, in base58-encoded multihash format.").EnableStdin(), + cmds.StringArg("key", true, false, "Key of the dag-pb object to retrieve, in base58-encoded multihash format.").EnableStdin(), }, Options: []cmds.Option{ cmds.BoolOption(headersOptionName, "v", "Print table headers (Hash, Size, Name)."), @@ -180,14 +180,14 @@ multihash. // ObjectGetCmd object get command var ObjectGetCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Get and serialize the DAG node named by .", + Tagline: "Get and serialize the dag-pb node named by .", ShortDescription: ` -'ipfs object get' is a plumbing command for retrieving DAG nodes. +'ipfs object get' is a plumbing command for retrieving dag-pb nodes. It serializes the DAG node to the format specified by the "--encoding" flag. It outputs to stdout, and is a base58 encoded multihash. `, LongDescription: ` -'ipfs object get' is a plumbing command for retrieving DAG nodes. +'ipfs object get' is a plumbing command for retrieving dag-pb nodes. It serializes the DAG node to the format specified by the "--encoding" flag. It outputs to stdout, and is a base58 encoded multihash. @@ -207,7 +207,7 @@ Supported values are: }, Arguments: []cmds.Argument{ - cmds.StringArg("key", true, false, "Key of the object to retrieve, in base58-encoded multihash format.").EnableStdin(), + cmds.StringArg("key", true, false, "Key of the dag-pb object to retrieve, in base58-encoded multihash format.").EnableStdin(), }, Options: []cmds.Option{ cmds.StringOption(encodingOptionName, "Encoding type of the data field, either \"text\" or \"base64\".").WithDefault("text"), @@ -287,9 +287,9 @@ Supported values are: // ObjectStatCmd object stat command var ObjectStatCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Get stats for the DAG node named by .", + Tagline: "Get stats for the dag-pb node named by .", ShortDescription: ` -'ipfs object stat' is a plumbing command to print DAG node statistics. +'ipfs object stat' is a plumbing command to print dag-pb node statistics. is a base58 encoded multihash. It outputs to stdout: NumLinks int number of links in link table @@ -360,13 +360,13 @@ var ObjectStatCmd = &cmds.Command{ // ObjectPutCmd object put command var ObjectPutCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Store input as a DAG object, print its key.", + Tagline: "Store input as a dag-pb object, print its key.", ShortDescription: ` -'ipfs object put' is a plumbing command for storing DAG nodes. +'ipfs object put' is a plumbing command for storing dag-pb nodes. It reads from stdin, and the output is a base58 encoded multihash. `, LongDescription: ` -'ipfs object put' is a plumbing command for storing DAG nodes. +'ipfs object put' is a plumbing command for storing dag-pb nodes. It reads from stdin, and the output is a base58 encoded multihash. Data should be in the format specified by the --inputenc flag. @@ -397,7 +397,7 @@ And then run: }, Arguments: []cmds.Argument{ - cmds.FileArg("data", true, false, "Data to be stored as a DAG object.").EnableStdin(), + cmds.FileArg("data", true, false, "Data to be stored as a dag-pb object.").EnableStdin(), }, Options: []cmds.Option{ cmds.StringOption(inputencOptionName, "Encoding type of input data. One of: {\"protobuf\", \"json\"}.").WithDefault("json"), @@ -466,12 +466,12 @@ And then run: // ObjectNewCmd object new command var ObjectNewCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Create a new object from an IPFS template.", + Tagline: "Create a new dag-pb object from a template.", ShortDescription: ` -'ipfs object new' is a plumbing command for creating new DAG nodes. +'ipfs object new' is a plumbing command for creating new dag-pb nodes. `, LongDescription: ` -'ipfs object new' is a plumbing command for creating new DAG nodes. +'ipfs object new' is a plumbing command for creating new dag-pb nodes. By default it creates and returns a new empty merkledag node, but you may pass an optional template argument to create a preformatted node. diff --git a/core/commands/root.go b/core/commands/root.go index 7decb8b9b94..fff4623e6b7 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -42,7 +42,7 @@ BASIC COMMANDS DATA STRUCTURE COMMANDS dag Interact with IPLD DAG nodes files Interact with files as if they were a unix filesystem - object Interact with objects (deprecated, use 'dag' or 'files') + object Interact with dag-pb objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore ADVANCED COMMANDS From 3502a78e33d2c001d27b7fc9b618558dad854e5f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 21:54:36 +0000 Subject: [PATCH 058/161] Create Dependabot config file --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..2e1e4a5e934 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 From 15577b89cc523553501aafa4a42e06ca2d789e07 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 22:02:56 +0000 Subject: [PATCH 059/161] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/master/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.9.0...v1.10.0) Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 8a0d5e11b62..36f32c45faf 100644 --- a/go.mod +++ b/go.mod @@ -91,7 +91,7 @@ require ( github.com/multiformats/go-multihash v0.0.14 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.9.0 + github.com/prometheus/client_golang v1.10.0 github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.0 github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 @@ -104,7 +104,7 @@ require ( golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 + golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 ) go 1.14 diff --git a/go.sum b/go.sum index b30a5ac5e5b..aac4296d7da 100644 --- a/go.sum +++ b/go.sum @@ -250,8 +250,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -1091,8 +1092,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg= +github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1106,8 +1107,8 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= +github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1117,8 +1118,8 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/statsd_exporter v0.15.0 h1:UiwC1L5HkxEPeapXdm2Ye0u1vUJfTj7uwT5yydYpa1E= github.com/prometheus/statsd_exporter v0.15.0/go.mod h1:Dv8HnkoLQkeEjkIE4/2ndAA7WL1zHKK7WMqFQqu72rw= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1414,6 +1415,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1470,10 +1472,9 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= From ee7095ee2c2149b6fd4ceabee809c0ea5b0df903 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 22:03:06 +0000 Subject: [PATCH 060/161] build(deps): bump github.com/gabriel-vasile/mimetype from 1.1.2 to 1.2.0 Bumps [github.com/gabriel-vasile/mimetype](https://github.com/gabriel-vasile/mimetype) from 1.1.2 to 1.2.0. - [Release notes](https://github.com/gabriel-vasile/mimetype/releases) - [Commits](https://github.com/gabriel-vasile/mimetype/compare/v1.1.2...v1.2.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8a0d5e11b62..2e40d958892 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 github.com/fsnotify/fsnotify v1.4.9 - github.com/gabriel-vasile/mimetype v1.1.2 + github.com/gabriel-vasile/mimetype v1.2.0 github.com/go-bindata/go-bindata/v3 v3.1.3 github.com/hashicorp/go-multierror v1.1.0 github.com/ipfs/go-bitswap v0.3.3 diff --git a/go.sum b/go.sum index b30a5ac5e5b..ce2b236f061 100644 --- a/go.sum +++ b/go.sum @@ -186,8 +186,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gabriel-vasile/mimetype v1.1.1/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= -github.com/gabriel-vasile/mimetype v1.1.2 h1:gaPnPcNor5aZSVCJVSGipcpbgMWiAAj9z182ocSGbHU= -github.com/gabriel-vasile/mimetype v1.1.2/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= +github.com/gabriel-vasile/mimetype v1.2.0 h1:A6z5J8OhjiWFV91sQ3dMI8apYu/tvP9keDaMM3Xu6p4= +github.com/gabriel-vasile/mimetype v1.2.0/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-bindata/go-bindata/v3 v3.1.3 h1:F0nVttLC3ws0ojc7p60veTurcOm//D4QBODNM7EGrCI= From 6ca2770d385ed266b5cef7957a3392681e6b404a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 22:03:21 +0000 Subject: [PATCH 061/161] build(deps): bump github.com/coreos/go-systemd/v22 from 22.1.0 to 22.3.0 Bumps [github.com/coreos/go-systemd/v22](https://github.com/coreos/go-systemd) from 22.1.0 to 22.3.0. - [Release notes](https://github.com/coreos/go-systemd/releases) - [Commits](https://github.com/coreos/go-systemd/compare/v22.1.0...v22.3.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 8a0d5e11b62..894b9581286 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( contrib.go.opencensus.io/exporter/prometheus v0.2.0 github.com/blang/semver/v4 v4.0.0 github.com/cheggaaa/pb v1.0.29 - github.com/coreos/go-systemd/v22 v22.1.0 + github.com/coreos/go-systemd/v22 v22.3.0 github.com/dustin/go-humanize v1.0.0 github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 github.com/fsnotify/fsnotify v1.4.9 diff --git a/go.sum b/go.sum index b30a5ac5e5b..da9ca0b6f0e 100644 --- a/go.sum +++ b/go.sum @@ -127,8 +127,9 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.0 h1:C8u/Ljj8G8O6rqWJh2J8cDyeEFBMWvXlvJ/ccMyzcqw= +github.com/coreos/go-systemd/v22 v22.3.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= From 0528c9daee499f29e54aaddb738f1fca92d5061d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 22:03:53 +0000 Subject: [PATCH 062/161] build(deps): bump github.com/ipfs/go-log from 1.0.4 to 1.0.5 Bumps [github.com/ipfs/go-log](https://github.com/ipfs/go-log) from 1.0.4 to 1.0.5. - [Release notes](https://github.com/ipfs/go-log/releases) - [Commits](https://github.com/ipfs/go-log/compare/v1.0.4...v1.0.5) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8a0d5e11b62..6989c7bde43 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/ipfs/go-ipld-format v0.2.0 github.com/ipfs/go-ipld-git v0.0.3 github.com/ipfs/go-ipns v0.0.2 - github.com/ipfs/go-log v1.0.4 + github.com/ipfs/go-log v1.0.5 github.com/ipfs/go-merkledag v0.3.2 github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 diff --git a/go.sum b/go.sum index b30a5ac5e5b..82e0ccbe21a 100644 --- a/go.sum +++ b/go.sum @@ -467,14 +467,16 @@ github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9 github.com/ipfs/go-log v1.0.1/go.mod h1:HuWlQttfN6FWNHRhlY5yMk/lW7evQC0HHGOxEwMRR8I= github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= -github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= +github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.0.1/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= -github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= +github.com/ipfs/go-log/v2 v2.1.3 h1:1iS3IU7aXRlbgUpN8yTTpJ53NXYjAe37vcI5+5nYrzk= +github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-merkledag v0.0.3/go.mod h1:Oc5kIXLHokkE1hWGMBHw+oxehkAaTOqtEb7Zbh6BhLA= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.1.0/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= @@ -1272,8 +1274,9 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/dig v1.10.0 h1:yLmDDj9/zuDjv3gz8GQGviXMs9TfysIUMUilCpgzUJY= go.uber.org/dig v1.10.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/fx v1.13.1 h1:CFNTr1oin5OJ0VCZ8EycL3wzF29Jz2g0xe55RFsf2a4= @@ -1284,9 +1287,9 @@ go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= From ff5e4fbb74e8f5cdb9265041af90d600a208a7fa Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 24 Mar 2021 15:03:55 -0700 Subject: [PATCH 063/161] chore: label dependabot PRs --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2e1e4a5e934..14f776456a2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,5 @@ updates: interval: daily time: "11:00" open-pull-requests-limit: 10 + labels: + - "topic/dependencies" From 7fd4326dedfcbee5f7efc42f1df22b694a858d2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 23:16:29 +0000 Subject: [PATCH 064/161] build(deps): bump github.com/ipfs/go-namesys from 0.0.1 to 0.1.0 Bumps [github.com/ipfs/go-namesys](https://github.com/ipfs/go-namesys) from 0.0.1 to 0.1.0. - [Release notes](https://github.com/ipfs/go-namesys/releases) - [Commits](https://github.com/ipfs/go-namesys/compare/v0.0.1...v0.1.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 94 ++-------------------------------------------------------- 2 files changed, 4 insertions(+), 92 deletions(-) diff --git a/go.mod b/go.mod index 65a2b09f57d..9105f6f50f5 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 github.com/ipfs/go-mfs v0.1.2 - github.com/ipfs/go-namesys v0.0.1 + github.com/ipfs/go-namesys v0.1.0 github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 github.com/ipfs/go-unixfs v0.2.4 diff --git a/go.sum b/go.sum index 2f08ed1d58b..f6bd1f8cdf4 100644 --- a/go.sum +++ b/go.sum @@ -40,7 +40,6 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/Stebalien/go-bitfield v0.0.0-20180330043415-076a62f9ce6e/go.mod h1:3oM7gXIttpYDAJXpVNnSCiUMYBLIZ6cb1t+Ip982MRo= github.com/Stebalien/go-bitfield v0.0.1 h1:X3kbSSPUaJK60wV2hjOPZwmpljr6VGCqdq4cBLhbQBo= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -74,8 +73,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -127,7 +124,6 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.0 h1:C8u/Ljj8G8O6rqWJh2J8cDyeEFBMWvXlvJ/ccMyzcqw= github.com/coreos/go-systemd/v22 v22.3.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -175,7 +171,6 @@ github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:Jp github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6E= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= @@ -186,7 +181,6 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gabriel-vasile/mimetype v1.1.1/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/gabriel-vasile/mimetype v1.2.0 h1:A6z5J8OhjiWFV91sQ3dMI8apYu/tvP9keDaMM3Xu6p4= github.com/gabriel-vasile/mimetype v1.2.0/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -292,7 +286,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpg github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= -github.com/gxed/pubsub v0.0.0-20180201040156-26ebdf44f824/go.mod h1:OiEWyHgK+CWrmOlVquHaIK1vhpUJydC9m0Je6mhaiNE= github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= @@ -324,7 +317,6 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= @@ -334,20 +326,17 @@ github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod github.com/ipfs/bbloom v0.0.1/go.mod h1:oqo8CVWsJFMOZqTglBG4wydCE4IQA/G2/SEofB0rjUI= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/go-bitswap v0.0.3/go.mod h1:jadAZYsP/tcRMl47ZhFxhaNuDQoXawT8iHMg+iFoQbg= github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3UPrwvis= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.1.3/go.mod h1:YEQlFy0kkxops5Vy+OxWdRSEZIoS7I7KDIwoa5Chkps= github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= -github.com/ipfs/go-bitswap v0.2.20/go.mod h1:C7TwBgHnu89Q8sHsTJP7IhUqF9XYLe71P4tT5adgmYo= github.com/ipfs/go-bitswap v0.3.3 h1:CrTO3OiOYFBcdliw074/C7T2QYHEOsPClgvR6RIYcO4= github.com/ipfs/go-bitswap v0.3.3/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= -github.com/ipfs/go-blockservice v0.0.3/go.mod h1:/NNihwTi6V2Yr6g8wBI+BSwPuURpBRMtYNGrlxZ8KuI= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= github.com/ipfs/go-blockservice v0.1.1/go.mod h1:t+411r7psEUhLueM8C7aPA7cxCclv4O3VsUVxt9kz2I= @@ -383,7 +372,6 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-badger v0.2.4/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.2.6 h1:Hy8jw4rifxtRDrqpvC1yh36oIyE37KDzsUzlHUPOFiU= github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= github.com/ipfs/go-ds-flatfs v0.4.5 h1:4QceuKEbH+HVZ2ZommstJMi3o3II+dWS3IhLaD7IGHs= @@ -399,10 +387,8 @@ github.com/ipfs/go-filestore v0.0.3 h1:MhZ1jT5K3NewZwim6rS/akcJLm1xM+r6nz6foeB9E github.com/ipfs/go-filestore v0.0.3/go.mod h1:dvXRykFzyyXN2CdNlRGzDAkXMDPyI+D7JE066SiKLSE= github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= -github.com/ipfs/go-graphsync v0.1.1/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= github.com/ipfs/go-graphsync v0.7.0 h1:ZdyU2otZYPjcvduAPwVjCdijmkPtHI1mm1VyZbRQ5KI= github.com/ipfs/go-graphsync v0.7.0/go.mod h1:YRQg0TyvD2HzFansAZdMcUFBJ8zIJ4K+32kNdnHfHZc= -github.com/ipfs/go-ipfs v0.7.0/go.mod h1:4UNBZMgbAZ6/+xUZDlMkGxMFPiu1RB67+TaNVvKV7ZQ= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= @@ -412,10 +398,8 @@ github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtL github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= -github.com/ipfs/go-ipfs-cmds v0.4.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw= github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= -github.com/ipfs/go-ipfs-config v0.9.0/go.mod h1:GQUxqb0NfkZmEU92PxqqqLVVFTLpoGGUlBaTyDaAqrE= github.com/ipfs/go-ipfs-config v0.12.0 h1:wxqN3ohBlis1EkhkzIKuF+XLx4YNn9rNpiSOYw3DFZc= github.com/ipfs/go-ipfs-config v0.12.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -428,14 +412,11 @@ github.com/ipfs/go-ipfs-exchange-interface v0.0.1 h1:LJXIo9W7CAmugqI+uofioIpRb6r github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= github.com/ipfs/go-ipfs-exchange-offline v0.0.1 h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= -github.com/ipfs/go-ipfs-files v0.0.2/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.8 h1:8o0oFJkJ8UkO/ABl8T6ac6tKF3+NIpj67aAB6ZpusRg= github.com/ipfs/go-ipfs-files v0.0.8/go.mod h1:wiN/jSG8FKyk7N0WyctKSvq3ljIa2NNTiZB55kpTdOs= -github.com/ipfs/go-ipfs-flags v0.0.1/go.mod h1:RnXBb9WV53GSfTrSDVK61NLTFKvWc60n+K9EgCDh+rA= github.com/ipfs/go-ipfs-keystore v0.0.2 h1:Fa9xg9IFD1VbiZtrNLzsD0GuELVHUFXCWF64kCPfEXU= github.com/ipfs/go-ipfs-keystore v0.0.2/go.mod h1:H49tRmibOEs7gLMgbOsjC4dqh1u5e0R/SWuc2ScfgSo= -github.com/ipfs/go-ipfs-pinner v0.0.4/go.mod h1:s4kFZWLWGDudN8Jyd/GTpt222A12C2snA2+OTdy/7p8= github.com/ipfs/go-ipfs-pinner v0.1.1 h1:iJd1gwILGQJSZhhI0jn6yFOLg34Ua7fdKcB6mXp6k/M= github.com/ipfs/go-ipfs-pinner v0.1.1/go.mod h1:EzyyaWCWeZJ/he9cDBH6QrEkSuRqTRWMmCoyNkylTTg= github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= @@ -451,7 +432,6 @@ github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42 github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= -github.com/ipfs/go-ipld-cbor v0.0.1/go.mod h1:RXHr8s4k0NE0TKhnrxqZC9M888QfsBN9rhS5NjfKzY8= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= @@ -479,7 +459,6 @@ github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscw github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3 h1:1iS3IU7aXRlbgUpN8yTTpJ53NXYjAe37vcI5+5nYrzk= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-merkledag v0.0.3/go.mod h1:Oc5kIXLHokkE1hWGMBHw+oxehkAaTOqtEb7Zbh6BhLA= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.1.0/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= @@ -493,11 +472,9 @@ github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZa github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= -github.com/ipfs/go-namesys v0.0.1 h1:HmhgHDA2hyfVtFtbvPR92IdmKbUFRmlbU0Lv1IwmDas= -github.com/ipfs/go-namesys v0.0.1/go.mod h1:I33kVZixNRWXe5FN1mpWBXsAeJj0t+kxcVDgbIkgE2E= -github.com/ipfs/go-path v0.0.3/go.mod h1:zIRQUez3LuQIU25zFjC2hpBTHimWx7VK5bjZgRLbbdo= +github.com/ipfs/go-namesys v0.1.0 h1:3wTIZ7oD9X9clmA+9cpZF6I7tZky24ahUvq0Oz7FD4c= +github.com/ipfs/go-namesys v0.1.0/go.mod h1:JITpuwDgYYh84sXxw8bQXY3aTlEdyJqkbzvE12YzXgM= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= -github.com/ipfs/go-path v0.0.8/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= @@ -507,25 +484,19 @@ github.com/ipfs/go-peertaskqueue v0.2.0 h1:2cSr7exUGKYyDeUyQ7P/nHPs9P7Ht/B+ROrpN github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUnr+P7jivavs9lY= github.com/ipfs/go-pinning-service-http-client v0.1.0 h1:Au0P4NglL5JfzhNSZHlZ1qra+IcJyO3RWMd9EYCwqSY= github.com/ipfs/go-pinning-service-http-client v0.1.0/go.mod h1:tcCKmlkWWH9JUUkKs8CrOZBanacNc1dmKLfjlyXAMu4= -github.com/ipfs/go-unixfs v0.0.4/go.mod h1:eIo/p9ADu/MFOuyxzwU+Th8D6xoxU//r590vUpWyfz8= github.com/ipfs/go-unixfs v0.1.0/go.mod h1:lysk5ELhOso8+Fed9U1QTGey2ocsfaZ18h0NCO2Fj9s= github.com/ipfs/go-unixfs v0.2.4 h1:6NwppOXefWIyysZ4LR/qUBPvXd5//8J3jiMdvpbw6Lo= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= -github.com/ipfs/interface-go-ipfs-core v0.3.0/go.mod h1:Tihp8zxGpUeE3Tokr94L6zWZZdkRQvG5TL6i9MuNE+s= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/ipld/go-car v0.1.1-0.20200429200904-c222d793c339/go.mod h1:eajxljm6I8o3LitnFeVEmucwZmz7+yLSiKce9yYMefg= github.com/ipld/go-car v0.2.0 h1:WwP83IdXdEuaW4fkCj+DWmdWygcFXpixramvItqFo1A= github.com/ipld/go-car v0.2.0/go.mod h1:pPb7hzVBHBoRqU3GkPy1d6FZKQoGQ56yd3MyPGzZ0Xs= -github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= github.com/ipld/go-ipld-prime v0.7.0 h1:eigF1ZpaL1prbsKYVMqPLoPJqD/pzkQOe2j1uzvVg7w= github.com/ipld/go-ipld-prime v0.7.0/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipld/go-ipld-prime-proto v0.1.1 h1:EX4yWYaIqSLwtVE30nxEcZDcvsWDtx1vImSG+XCJebY= github.com/ipld/go-ipld-prime-proto v0.1.1/go.mod h1:cI9NwYAUKCLUwqufoUjChISxuTEkaY2yvNYCRCuhRck= -github.com/jackpal/gateway v1.0.4/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= @@ -592,7 +563,6 @@ github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoR github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= -github.com/libp2p/go-conn-security-multistream v0.0.1/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= @@ -604,45 +574,35 @@ github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZ github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= -github.com/libp2p/go-libp2p v0.0.2/go.mod h1:Qu8bWqFXiocPloabFGUcVG4kk94fLvfC8mWTDdFC9wE= github.com/libp2p/go-libp2p v0.0.30/go.mod h1:XWT8FGHlhptAv1+3V/+J5mEpzyui/5bvFsNuWYs611A= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= -github.com/libp2p/go-libp2p v0.6.0/go.mod h1:mfKWI7Soz3ABX+XEBR61lGbg+ewyMtJHVt043oWeqwg= github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= -github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= -github.com/libp2p/go-libp2p v0.11.0/go.mod h1:3/ogJDXsbbepEfqtZKBR/DedzxJXCeK17t2Z9RE9bEE= github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= github.com/libp2p/go-libp2p v0.13.0 h1:tDdrXARSghmusdm0nf1U/4M8aj8Rr0V2IzQOXmbzQ3s= github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= -github.com/libp2p/go-libp2p-autonat v0.0.2/go.mod h1:fs71q5Xk+pdnKU014o2iq1RhMs9/PMaG5zXRFNnIIT4= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= -github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= -github.com/libp2p/go-libp2p-circuit v0.0.1/go.mod h1:Dqm0s/BiV63j8EEAs8hr1H5HudqvCAeXxDyic59lCwE= github.com/libp2p/go-libp2p-circuit v0.0.9/go.mod h1:uU+IBvEQzCu953/ps7bYzC/D/R0Ho2A9LfKVVCatlqU= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= -github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= github.com/libp2p/go-libp2p-circuit v0.4.0 h1:eqQ3sEYkGTtybWgr6JLqJY6QLtPWRErvFjFDfAOO1wc= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= @@ -660,7 +620,6 @@ github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUh github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= @@ -676,27 +635,22 @@ github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJB github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= -github.com/libp2p/go-libp2p-discovery v0.0.1/go.mod h1:ZkkF9xIFRLA1xCc7bstYFkd80gBGK8Fc1JqGoU2i+zI= github.com/libp2p/go-libp2p-discovery v0.0.5/go.mod h1:YtF20GUxjgoKZ4zmXj8j3Nb2TUSBHFlOCetzYdbZL5I= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= -github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-gostream v0.2.1/go.mod h1:1Mjp3LDmkqICe5tH9yLVNCqFaRTy6OwBvuJV6j1b9Nk= github.com/libp2p/go-libp2p-gostream v0.3.0 h1:rnas//vRdHYCr7bjraZJISPwZV8OGMjeX5k5fN5Ax44= github.com/libp2p/go-libp2p-gostream v0.3.0/go.mod h1:pLBQu8db7vBMNINGsAwLL/ZCE8wng5V1FThoaE5rNjc= github.com/libp2p/go-libp2p-host v0.0.1/go.mod h1:qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go= github.com/libp2p/go-libp2p-host v0.0.3/go.mod h1:Y/qPyA6C8j2coYyos1dfRm0I8+nvd4TGrDGt4tA7JR8= -github.com/libp2p/go-libp2p-http v0.1.5/go.mod h1:2YfPjsQxUlBGFQl2u461unkQ7ukwiSs7NX2eSslOJiU= github.com/libp2p/go-libp2p-http v0.2.0 h1:GYeVd+RZzkRa8XFLITqOpcrIQG6KbFLPJqII6HHBHzY= github.com/libp2p/go-libp2p-http v0.2.0/go.mod h1:GlNKFqDZHe25LVy2CvnZKx75/jLtMaD3VxZV6N39X7E= github.com/libp2p/go-libp2p-interface-connmgr v0.0.1/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= -github.com/libp2p/go-libp2p-kad-dht v0.9.0/go.mod h1:LEKcCFHxnvypOPaqZ0m6h0fLQ9Y8t1iZMOg7a0aQDD4= github.com/libp2p/go-libp2p-kad-dht v0.11.1 h1:FsriVQhOUZpCotWIjyFSjEDNJmUzuMma/RyyTDZanwc= github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= @@ -710,12 +664,10 @@ github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3 github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1 h1:/pyhkP1nLwjG3OM+VuaNJkQT/Pqq73WzB3aDN3Fx1sc= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= -github.com/libp2p/go-libp2p-nat v0.0.2/go.mod h1:QrjXQSD5Dj4IJOdEcjHRkWTSomyxRo6HnUkf/TfQpLQ= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= @@ -739,23 +691,17 @@ github.com/libp2p/go-libp2p-peerstore v0.1.4/go.mod h1:+4BDbDiiKf4PzpANZDAT+knVd github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= -github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= -github.com/libp2p/go-libp2p-pubsub v0.3.2/go.mod h1:Uss7/Cfz872KggNb+doCVPHeCDmXB7z500m/R8DaAUk= -github.com/libp2p/go-libp2p-pubsub v0.3.5/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= github.com/libp2p/go-libp2p-pubsub v0.4.0/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDFhWj+8yy8= github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= -github.com/libp2p/go-libp2p-pubsub-router v0.3.2/go.mod h1:G4MAvYzPxhoR0LEBluS9Ow+Nnr/8iDalUN+RNwVgNkY= github.com/libp2p/go-libp2p-pubsub-router v0.4.0 h1:KjzTLIOBCt0+/4wH6epTxD/Qu4Up/IyeKHlj9MhWRJI= github.com/libp2p/go-libp2p-pubsub-router v0.4.0/go.mod h1:hs0j0ugcBjMOMgJ6diOlZM2rZEId/w5Gg86E+ac4SmQ= -github.com/libp2p/go-libp2p-quic-transport v0.8.0/go.mod h1:F2FG/6Bzz0U6essUVxDzE0s9CrY4XGLbl7QEmDNvU7A= github.com/libp2p/go-libp2p-quic-transport v0.10.0 h1:koDCbWD9CCHwcHZL3/WEvP2A+e/o5/W5L3QS/2SPMA0= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= @@ -767,18 +713,15 @@ github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ github.com/libp2p/go-libp2p-routing v0.0.1/go.mod h1:N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys= github.com/libp2p/go-libp2p-routing-helpers v0.2.3 h1:xY61alxJ6PurSi+MXbywZpelvuU4U4p/gPTxjqCqTzY= github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= -github.com/libp2p/go-libp2p-secio v0.0.1/go.mod h1:IdG6iQybdcYmbTzxp4J5dwtUEDTOvZrT0opIDVNPrJs= github.com/libp2p/go-libp2p-secio v0.0.3/go.mod h1:hS7HQ00MgLhRO/Wyu1bTX6ctJKhVpm+j2/S2A5UqYb0= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= -github.com/libp2p/go-libp2p-swarm v0.0.1/go.mod h1:mh+KZxkbd3lQnveQ3j2q60BM1Cw2mX36XXQqwfPOShs= github.com/libp2p/go-libp2p-swarm v0.0.6/go.mod h1:s5GZvzg9xXe8sbeESuFpjt8CJPTCa8mhEusweJqyFy8= github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= -github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h/GGZes8Wku/M5Y= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= @@ -792,16 +735,13 @@ github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MB github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= -github.com/libp2p/go-libp2p-testing v0.2.0/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-testing v0.4.0 h1:PrwHRi0IGqOwVQWR3xzgigSlhlLfxgfXgkHxr77EghQ= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= -github.com/libp2p/go-libp2p-transport v0.0.4/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= github.com/libp2p/go-libp2p-transport v0.0.5/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= -github.com/libp2p/go-libp2p-transport-upgrader v0.0.1/go.mod h1:NJpUAgQab/8K6K0m+JmZCe5RUXG10UMEx4kWe9Ipj5c= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= @@ -824,7 +764,6 @@ github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9 github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUhgnKqNEmIAz/bPU= -github.com/libp2p/go-mplex v0.0.1/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.4/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= @@ -833,7 +772,6 @@ github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3 github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-mplex v0.3.0 h1:U1T+vmCYJaEoDJPV1aq31N56hS+lJgb397GsylNSgrU= github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= -github.com/libp2p/go-msgio v0.0.1/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= @@ -855,7 +793,6 @@ github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= -github.com/libp2p/go-reuseport-transport v0.0.1/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= @@ -870,7 +807,6 @@ github.com/libp2p/go-stream-muxer-multistream v0.1.1/go.mod h1:zmGdfkQ1AzOECIAcc github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DXdvDSiLHQidKKUGZtiOY= github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= -github.com/libp2p/go-tcp-transport v0.0.1/go.mod h1:mnjg0o0O5TmXUaUIanYPUqkW4+u6mK0en8rlpA6BBTs= github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19K427vCzQ+xHKH/o= github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= @@ -879,7 +815,6 @@ github.com/libp2p/go-tcp-transport v0.2.1 h1:ExZiVQV+h+qL16fzCWtd1HSzPsqWottJ8KX github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= github.com/libp2p/go-testutil v0.0.1/go.mod h1:iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= -github.com/libp2p/go-ws-transport v0.0.1/go.mod h1:p3bKjDWHEgtuKKj+2OdPYs5dAPIjtpQGHF2tJfGz7Ww= github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= @@ -901,7 +836,6 @@ github.com/libp2p/go-yamux/v2 v2.0.0 h1:vSGhAy5u6iHBq11ZDcyHH4Blcf9xlBhT4WQDoOE9 github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lucas-clemente/quic-go v0.18.0/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= @@ -909,11 +843,9 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -928,16 +860,14 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.4/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo= @@ -1001,12 +931,10 @@ github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysj github.com/multiformats/go-multiaddr-net v0.2.0 h1:MSXRGN0mFymt6B1yo/6BPnIRpLPEnKgQNvVfCX5VDJk= github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= -github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= -github.com/multiformats/go-multihash v0.0.7/go.mod h1:XuKXPp8VHcTygube3OWZC+aZrA+H1IhmjoCDtJc7PXM= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= @@ -1017,7 +945,6 @@ github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -1083,7 +1010,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190408063855-01bf1e26dd14/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -1170,7 +1096,6 @@ github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHei github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= @@ -1226,7 +1151,6 @@ github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvS github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4= github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 h1:bsUlNhdmbtlfdLVXAVfuvKQ01RnWAM09TVrJkI7NZs4= github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= @@ -1237,10 +1161,6 @@ github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h1:cZNvX9cFybI01GriPRMXDtczuvUhgbcYr9iCGaNlRv8= -github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible/go.mod h1:34LEDbeKFZInPUrAG+bjuJmUXONGdEFW7XL0SpTY1y4= -github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible/go.mod h1:dRWHHvc4HDQSHh9gbKEBbUZ+f2Q8iZTPG3UOGYODxSQ= -github.com/whyrusleeping/go-smux-yamux v2.0.8+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI= -github.com/whyrusleeping/go-smux-yamux v2.0.9+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI= github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 h1:ctS9Anw/KozviCCtK6VWMz5kPL9nbQzbQY4yfqlIV4M= github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1/go.mod h1:tKH72zYNt/exx6/5IQO6L9LoQ0rEjd5SbbWaDTs9Zso= github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= @@ -1249,12 +1169,10 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c/go.mod h1:xxcJeBb7SIUl/Wzkz1eVKJE/CB34YNrqX2TQI6jY9zs= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= -github.com/whyrusleeping/yamux v1.1.5/go.mod h1:E8LnQQ8HKx5KD29HZFUwM1PxCOdPRzGwur1mcYhXcD8= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1326,7 +1244,6 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= @@ -1351,7 +1268,6 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -1363,7 +1279,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1470,7 +1385,6 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1529,7 +1443,6 @@ golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 h1:g3QwFWCjsUzBtcQIcI+CYmiL/0i0BxTJjQp54GGDLEM= @@ -1615,7 +1528,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= From 9351771b65ca6767adeb9fe7bb66b8485d7eb728 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 23:18:14 +0000 Subject: [PATCH 065/161] build(deps): bump github.com/hashicorp/go-multierror from 1.1.0 to 1.1.1 Bumps [github.com/hashicorp/go-multierror](https://github.com/hashicorp/go-multierror) from 1.1.0 to 1.1.1. - [Release notes](https://github.com/hashicorp/go-multierror/releases) - [Commits](https://github.com/hashicorp/go-multierror/compare/v1.1.0...v1.1.1) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 65a2b09f57d..8024f5c67e2 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/fsnotify/fsnotify v1.4.9 github.com/gabriel-vasile/mimetype v1.2.0 github.com/go-bindata/go-bindata/v3 v3.1.3 - github.com/hashicorp/go-multierror v1.1.0 + github.com/hashicorp/go-multierror v1.1.1 github.com/ipfs/go-bitswap v0.3.3 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-blockservice v0.1.4 diff --git a/go.sum b/go.sum index 2f08ed1d58b..20c60ede671 100644 --- a/go.sum +++ b/go.sum @@ -304,8 +304,9 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= From efa55e02a513ccf24da3ee0144628a6895b66cab Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 24 Mar 2021 20:29:11 -0700 Subject: [PATCH 066/161] fix: omit empty pins slice when reporting pin progress Otherwise, we get messages of the form `{Pins: null, Progress: 100}`. After this change, we'll get `{Progress: 100}`. --- core/commands/pin/pin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index 409b75cc00d..dfeb69a95e4 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -44,8 +44,8 @@ type PinOutput struct { } type AddPinOutput struct { - Pins []string - Progress int `json:",omitempty"` + Pins []string `json:",omitempty"` + Progress int `json:",omitempty"` } const ( From 49270f43a3c580e94a19b3043c72009cbad1e0fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 11:14:11 +0000 Subject: [PATCH 067/161] build(deps): bump github.com/ipfs/go-ipld-git from 0.0.3 to 0.0.4 Bumps [github.com/ipfs/go-ipld-git](https://github.com/ipfs/go-ipld-git) from 0.0.3 to 0.0.4. - [Release notes](https://github.com/ipfs/go-ipld-git/releases) - [Commits](https://github.com/ipfs/go-ipld-git/compare/v0.0.3...v0.0.4) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 65a2b09f57d..e8a9c039c8d 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/ipfs/go-ipfs-util v0.0.2 github.com/ipfs/go-ipld-cbor v0.0.5 github.com/ipfs/go-ipld-format v0.2.0 - github.com/ipfs/go-ipld-git v0.0.3 + github.com/ipfs/go-ipld-git v0.0.4 github.com/ipfs/go-ipns v0.0.2 github.com/ipfs/go-log v1.0.5 github.com/ipfs/go-merkledag v0.3.2 diff --git a/go.sum b/go.sum index 2f08ed1d58b..6c86e676879 100644 --- a/go.sum +++ b/go.sum @@ -461,8 +461,9 @@ github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dC github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= -github.com/ipfs/go-ipld-git v0.0.3 h1:/YjkjCyo5KYRpW+suby8Xh9Cm/iH9dAgGV6qyZ1dGus= github.com/ipfs/go-ipld-git v0.0.3/go.mod h1:RuvMXa9qtJpDbqngyICCU/d+cmLFXxLsbIclmD0Lcr0= +github.com/ipfs/go-ipld-git v0.0.4 h1:fQv2Alq72g6mH+heDWQ9Awu5FQYc3hcCUVtzuWj/Mno= +github.com/ipfs/go-ipld-git v0.0.4/go.mod h1:RuvMXa9qtJpDbqngyICCU/d+cmLFXxLsbIclmD0Lcr0= github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= From db58dbc6257a5319564fd80b50770ce012e5af5f Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Thu, 25 Mar 2021 15:42:05 +0100 Subject: [PATCH 068/161] Readme: replace header image for dark mode - Fix text contrast for dark mode and dimmed mode with white outlines around the black text fixes ipfs#8024 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0f7b1510f6..f4e89e5113e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # go-ipfs -![banner](https://ipfs.io/ipfs/QmVk7srrwahXLNmcDYvyUEJptyoxpndnRa57YJ11L4jV26/ipfs.go.png) +![banner](https://ipfs.io/ipfs/bafykbzacecaesuqmivkauix25v6i6xxxsvsrtxknhgb5zak3xxsg2nb4dhs2u/ipfs.go.png) [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/room/#ipfs:matrix.org) From 1530cd2ceab3925d0203972869b0cbf296ecea72 Mon Sep 17 00:00:00 2001 From: Andrew Gillis Date: Thu, 25 Mar 2021 10:10:26 -0700 Subject: [PATCH 069/161] Rename migrations from ipfs-x-to-y to fs-repo-x-to-y (#8002) * rename migrations from ipfs-x-to-y to fs-repo-x-to-y * update current ipfs dist to one with migrations v1.0.0 --- repo/fsrepo/migrations/fetch.go | 4 ++-- repo/fsrepo/migrations/fetcher.go | 2 +- repo/fsrepo/migrations/migrations.go | 2 +- repo/fsrepo/migrations/migrations_test.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 753c9b10b17..8cb6bedde35 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -27,8 +27,8 @@ import ( // same name it has inside the archive. Otherwise, the binary file is written // to the file named by out. func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out string) (string, error) { - // The archive file name is the base of dist to support possible subdir in - // dist, for example: "ipfs-repo-migrations/ipfs-11-to-12" + // The archive file name is the base of dist. This is to support a possible subdir in + // dist, for example: "ipfs-repo-migrations/fs-repo-11-to-12" arcName := path.Base(dist) // If binary base name is not specified, then it is same as archive base name. if binName == "" { diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index 4bedafb63aa..bf04cb3c093 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -8,7 +8,7 @@ import ( const ( // Current dirstibution to fetch migrations from - CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y" + CurrentIpfsDist = "/ipfs/QmZqzacg5Q8WpDL7SymogoaSZYw6RZT2kgPavymCmMwWse" // Latest distribution path. Default for fetchers. LatestIpfsDist = "/ipns/dist.ipfs.io" diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 1833dff3015..0d51c638638 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -105,7 +105,7 @@ func ExeName(name string) string { } func migrationName(from, to int) string { - return fmt.Sprintf("ipfs-%d-to-%d", from, to) + return fmt.Sprintf("fs-repo-%d-to-%d", from, to) } // findMigrations returns a list of migrations, ordered from first to last diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 089eaa8d83f..6ba02a2f7d4 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -125,7 +125,7 @@ func TestFetchMigrations(t *testing.T) { } defer os.RemoveAll(tmpDir) - needed := []string{"ipfs-1-to-2", "ipfs-2-to-3"} + needed := []string{"fs-repo-1-to-2", "fs-repo-2-to-3"} fetched, err := fetchMigrations(ctx, fetcher, needed, tmpDir) if err != nil { t.Fatal(err) @@ -177,7 +177,7 @@ func TestRunMigrations(t *testing.T) { err = RunMigration(ctx, fetcher, targetVer, fakeIpfs, true) if err != nil { - if !strings.HasPrefix(err.Error(), "migration ipfs-10-to-11 failed") { + if !strings.HasPrefix(err.Error(), "migration fs-repo-10-to-11 failed") { t.Fatal(err) } } From 09a481ea7a34d92bd2a4a7b4b94333b89d37ac85 Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 25 Mar 2021 12:25:14 -0700 Subject: [PATCH 070/161] update current ipfs dist to migrations with vtag --- repo/fsrepo/migrations/fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index bf04cb3c093..0ee66b5337b 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -8,7 +8,7 @@ import ( const ( // Current dirstibution to fetch migrations from - CurrentIpfsDist = "/ipfs/QmZqzacg5Q8WpDL7SymogoaSZYw6RZT2kgPavymCmMwWse" + CurrentIpfsDist = "/ipfs/QmWLyhqWDsWbcWE8vjmHkzGKLGgvHh84cLxM3ceLsojwrx" // Latest distribution path. Default for fetchers. LatestIpfsDist = "/ipns/dist.ipfs.io" From 891c81e631a559d831ba3687bfb48dd4d7af033c Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 25 Mar 2021 15:53:15 -0400 Subject: [PATCH 071/161] test: repo migrations fetch - support windows wanting binaries to end in .exe --- repo/fsrepo/migrations/fetch_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 4b5a48bd9b8..7d90d7405d1 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -40,6 +40,7 @@ func createFakeArchive(name string, archZip bool, w io.Writer) { if fileName == "go-ipfs" { fileName = "ipfs" } + fileName = ExeName(fileName) var err error if archZip { @@ -179,7 +180,7 @@ func TestFetchBinary(t *testing.T) { t.Error("expected 'exists' error, got:", err) } - os.Remove(path.Join(tmpDir, "ipfs")) + os.Remove(path.Join(tmpDir, ExeName("ipfs"))) // Check error creating temp download directory err = os.Chmod(tmpDir, 0555) From 36de939e25fce2dd19118206b9f857de9bc76e98 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 25 Mar 2021 15:55:37 -0400 Subject: [PATCH 072/161] test: repo migrations fetch - skip part of a test on windows since it does not support read-only directories --- repo/fsrepo/migrations/fetch_test.go | 44 ++++++++++++++++------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 7d90d7405d1..bf0b33c4fc5 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -10,6 +10,7 @@ import ( "net/http/httptest" "os" "path" + "runtime" "strings" "testing" ) @@ -183,25 +184,30 @@ func TestFetchBinary(t *testing.T) { os.Remove(path.Join(tmpDir, ExeName("ipfs"))) // Check error creating temp download directory - err = os.Chmod(tmpDir, 0555) - if err != nil { - panic(err) - } - err = os.Setenv("TMPDIR", tmpDir) - if err != nil { - panic(err) - } - _, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "ipfs", tmpDir) - if !os.IsPermission(err) { - t.Error("expected 'permission' error, got:", err) - } - err = os.Setenv("TMPDIR", "/tmp") - if err != nil { - panic(err) - } - err = os.Chmod(tmpDir, 0755) - if err != nil { - panic(err) + // + // Windows doesn't have read-only directories https://github.com/golang/go/issues/35042 this would need to be + // tested another way + if runtime.GOOS != "windows" { + err = os.Chmod(tmpDir, 0555) + if err != nil { + panic(err) + } + err = os.Setenv("TMPDIR", tmpDir) + if err != nil { + panic(err) + } + _, err = FetchBinary(ctx, fetcher, "go-ipfs", "v0.3.5", "ipfs", tmpDir) + if !os.IsPermission(err) { + t.Error("expected 'permission' error, got:", err) + } + err = os.Setenv("TMPDIR", "/tmp") + if err != nil { + panic(err) + } + err = os.Chmod(tmpDir, 0755) + if err != nil { + panic(err) + } } // Check error if failure to fetch due to bad dist From 5ee8710c5806bb26982b82a1567a28c75d2aed05 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 25 Mar 2021 15:47:45 -0400 Subject: [PATCH 073/161] feat: repo migrations - use filepath instead of path to support windows --- repo/fsrepo/migrations/fetch.go | 8 ++++---- repo/fsrepo/migrations/fetch_test.go | 3 ++- repo/fsrepo/migrations/ipfsdir.go | 8 ++++---- repo/fsrepo/migrations/ipfsdir_test.go | 6 +++--- repo/fsrepo/migrations/migrations_test.go | 6 +++--- repo/fsrepo/migrations/unpack_test.go | 13 +++++++------ 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 8cb6bedde35..0682aea532a 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -9,7 +9,7 @@ import ( "io/ioutil" "os" "os/exec" - "path" + "path/filepath" "runtime" "strings" ) @@ -29,7 +29,7 @@ import ( func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out string) (string, error) { // The archive file name is the base of dist. This is to support a possible subdir in // dist, for example: "ipfs-repo-migrations/fs-repo-11-to-12" - arcName := path.Base(dist) + arcName := filepath.Base(dist) // If binary base name is not specified, then it is same as archive base name. if binName == "" { binName = arcName @@ -53,7 +53,7 @@ func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out s } } // out exists and is a directory, so compose final name - out = path.Join(out, binName) + out = filepath.Join(out, binName) // Check if the binary already exists in the directory _, err = os.Stat(out) if !os.IsNotExist(err) { @@ -83,7 +83,7 @@ func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out s arcDistPath, arcFullName := makeArchivePath(dist, arcName, ver, atype) // Create a file to write the archive data to - arcPath := path.Join(tmpDir, arcFullName) + arcPath := filepath.Join(tmpDir, arcFullName) arcFile, err := os.Create(arcPath) if err != nil { return "", err diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index bf0b33c4fc5..36cfb466217 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -10,6 +10,7 @@ import ( "net/http/httptest" "os" "path" + "path/filepath" "runtime" "strings" "testing" @@ -181,7 +182,7 @@ func TestFetchBinary(t *testing.T) { t.Error("expected 'exists' error, got:", err) } - os.Remove(path.Join(tmpDir, ExeName("ipfs"))) + os.Remove(filepath.Join(tmpDir, ExeName("ipfs"))) // Check error creating temp download directory // diff --git a/repo/fsrepo/migrations/ipfsdir.go b/repo/fsrepo/migrations/ipfsdir.go index ef1a65800ca..241e1ab8dd2 100644 --- a/repo/fsrepo/migrations/ipfsdir.go +++ b/repo/fsrepo/migrations/ipfsdir.go @@ -5,7 +5,7 @@ import ( "fmt" "io/ioutil" "os" - "path" + "path/filepath" "strconv" "strings" @@ -47,7 +47,7 @@ func IpfsDir(dir string) (string, error) { return "", errors.New("could not determine IPFS_PATH, home dir not set") } - return path.Join(home, defIpfsDir), nil + return filepath.Join(home, defIpfsDir), nil } // CheckIpfsDir gets the ipfs directory and checks that the directory exists. @@ -84,12 +84,12 @@ func WriteRepoVersion(ipfsDir string, version int) error { return err } - vFilePath := path.Join(ipfsDir, versionFile) + vFilePath := filepath.Join(ipfsDir, versionFile) return ioutil.WriteFile(vFilePath, []byte(fmt.Sprintf("%d\n", version)), 0644) } func repoVersion(ipfsDir string) (int, error) { - c, err := ioutil.ReadFile(path.Join(ipfsDir, versionFile)) + c, err := ioutil.ReadFile(filepath.Join(ipfsDir, versionFile)) if err != nil { return 0, err } diff --git a/repo/fsrepo/migrations/ipfsdir_test.go b/repo/fsrepo/migrations/ipfsdir_test.go index 2ccd507e335..2fecefa9216 100644 --- a/repo/fsrepo/migrations/ipfsdir_test.go +++ b/repo/fsrepo/migrations/ipfsdir_test.go @@ -3,7 +3,7 @@ package migrations import ( "io/ioutil" "os" - "path" + "path/filepath" "testing" ) @@ -21,7 +21,7 @@ func TestRepoDir(t *testing.T) { defer os.RemoveAll(fakeHome) os.Setenv("HOME", fakeHome) - fakeIpfs = path.Join(fakeHome, ".ipfs") + fakeIpfs = filepath.Join(fakeHome, ".ipfs") t.Run("testIpfsDir", testIpfsDir) t.Run("testCheckIpfsDir", testCheckIpfsDir) @@ -144,7 +144,7 @@ func testRepoVersion(t *testing.T) { if err != nil { t.Fatal(err) } - vFilePath := path.Join(ipfsDir, versionFile) + vFilePath := filepath.Join(ipfsDir, versionFile) err = ioutil.WriteFile(vFilePath, []byte("bad-version-data\n"), 0644) if err != nil { panic(err) diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 6ba02a2f7d4..812e5bd7665 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -4,7 +4,7 @@ import ( "context" "io/ioutil" "os" - "path" + "path/filepath" "strings" "testing" ) @@ -148,7 +148,7 @@ func TestRunMigrations(t *testing.T) { defer os.RemoveAll(fakeHome) os.Setenv("HOME", fakeHome) - fakeIpfs := path.Join(fakeHome, ".ipfs") + fakeIpfs := filepath.Join(fakeHome, ".ipfs") err = os.Mkdir(fakeIpfs, os.ModePerm) if err != nil { @@ -184,7 +184,7 @@ func TestRunMigrations(t *testing.T) { } func createFakeBin(from, to int, tmpDir string) { - migPath := path.Join(tmpDir, ExeName(migrationName(from, to))) + migPath := filepath.Join(tmpDir, ExeName(migrationName(from, to))) emptyFile, err := os.Create(migPath) if err != nil { panic(err) diff --git a/repo/fsrepo/migrations/unpack_test.go b/repo/fsrepo/migrations/unpack_test.go index e772f00b197..f4266b0246f 100644 --- a/repo/fsrepo/migrations/unpack_test.go +++ b/repo/fsrepo/migrations/unpack_test.go @@ -9,6 +9,7 @@ import ( "io/ioutil" "os" "path" + "path/filepath" "strings" "testing" ) @@ -38,7 +39,7 @@ func TestUnpackTgz(t *testing.T) { } defer os.RemoveAll(tmpDir) - badTarGzip := path.Join(tmpDir, "bad.tar.gz") + badTarGzip := filepath.Join(tmpDir, "bad.tar.gz") err = ioutil.WriteFile(badTarGzip, []byte("bad-data\n"), 0644) if err != nil { panic(err) @@ -48,14 +49,14 @@ func TestUnpackTgz(t *testing.T) { t.Fatal("expected error opening gzip reader, got:", err) } - testTarGzip := path.Join(tmpDir, "test.tar.gz") + testTarGzip := filepath.Join(tmpDir, "test.tar.gz") testData := "some data" err = writeTarGzipFile(testTarGzip, "testroot", "testfile", testData) if err != nil { panic(err) } - out := path.Join(tmpDir, "out.txt") + out := filepath.Join(tmpDir, "out.txt") // Test looking for file that is not in archive err = unpackTgz(testTarGzip, "testroot", "abc", out) @@ -86,7 +87,7 @@ func TestUnpackZip(t *testing.T) { } defer os.RemoveAll(tmpDir) - badZip := path.Join(tmpDir, "bad.zip") + badZip := filepath.Join(tmpDir, "bad.zip") err = ioutil.WriteFile(badZip, []byte("bad-data\n"), 0644) if err != nil { panic(err) @@ -96,14 +97,14 @@ func TestUnpackZip(t *testing.T) { t.Fatal("expected error opening zip reader, got:", err) } - testZip := path.Join(tmpDir, "test.zip") + testZip := filepath.Join(tmpDir, "test.zip") testData := "some data" err = writeZipFile(testZip, "testroot", "testfile", testData) if err != nil { panic(err) } - out := path.Join(tmpDir, "out.txt") + out := filepath.Join(tmpDir, "out.txt") // Test looking for file that is not in archive err = unpackZip(testZip, "testroot", "abc", out) From f00b49be5855121fd257bc6bb9572530a3e8eb2e Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 25 Mar 2021 23:42:59 -0700 Subject: [PATCH 074/161] Set latest dist to use one with darwin arm64 builds --- repo/fsrepo/migrations/fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index 0ee66b5337b..cb29004719f 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -8,7 +8,7 @@ import ( const ( // Current dirstibution to fetch migrations from - CurrentIpfsDist = "/ipfs/QmWLyhqWDsWbcWE8vjmHkzGKLGgvHh84cLxM3ceLsojwrx" + CurrentIpfsDist = "/ipfs/Qmaubnx6vDUEA2arLzPWxqY2brx2c1CUKsrgQHSwBXDZ5E" // Latest distribution path. Default for fetchers. LatestIpfsDist = "/ipns/dist.ipfs.io" From fe97eee1c90bc8ca29bc84753b7c723615688f2d Mon Sep 17 00:00:00 2001 From: gammazero Date: Fri, 26 Mar 2021 00:48:13 -0700 Subject: [PATCH 075/161] Fix typo in log message --- repo/fsrepo/migrations/migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index 0d51c638638..f8d343d6578 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -54,7 +54,7 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s } } - log.Print("Need", len(missing), "migrations, downloading.") + log.Println("Need", len(missing), "migrations, downloading.") tmpDir, err := ioutil.TempDir("", "migrations") if err != nil { From 2fc1594f51a606d2f1e1b4b735fa5c8098153c4f Mon Sep 17 00:00:00 2001 From: gammazero Date: Fri, 26 Mar 2021 01:47:24 -0700 Subject: [PATCH 076/161] Use same semver lib that is use elsewhere in go-ipfs --- go.mod | 4 ++-- go.sum | 6 ++++-- repo/fsrepo/migrations/versions.go | 6 +++--- repo/fsrepo/migrations/versions_test.go | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 190ed2675c0..5b68ecaa251 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ require ( bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc contrib.go.opencensus.io/exporter/prometheus v0.2.0 github.com/blang/semver v3.5.1+incompatible + github.com/blang/semver/v4 v4.0.0 github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d github.com/cheggaaa/pb v1.0.29 - github.com/coreos/go-semver v0.3.0 - github.com/coreos/go-systemd/v22 v22.1.0 + github.com/coreos/go-systemd/v22 v22.3.0 github.com/dustin/go-humanize v1.0.0 github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 github.com/fsnotify/fsnotify v1.4.9 diff --git a/go.sum b/go.sum index d1141d65172..51746c3ed2a 100644 --- a/go.sum +++ b/go.sum @@ -59,6 +59,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d h1:QgeLLoPD3kRVmeu/1al9iIpIANMi9O1zXFm8BnYGCJg= github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI= @@ -103,8 +105,8 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.0 h1:C8u/Ljj8G8O6rqWJh2J8cDyeEFBMWvXlvJ/ccMyzcqw= +github.com/coreos/go-systemd/v22 v22.3.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg= diff --git a/repo/fsrepo/migrations/versions.go b/repo/fsrepo/migrations/versions.go index 508e1e01fcc..69b2e290bb4 100644 --- a/repo/fsrepo/migrations/versions.go +++ b/repo/fsrepo/migrations/versions.go @@ -9,7 +9,7 @@ import ( "sort" "strings" - "github.com/coreos/go-semver/semver" + "github.com/blang/semver/v4" ) const distVersions = "versions" @@ -46,11 +46,11 @@ func DistVersions(ctx context.Context, fetcher Fetcher, dist string, sortDesc bo defer rc.Close() prefix := "v" - var vers []*semver.Version + var vers []semver.Version scan := bufio.NewScanner(rc) for scan.Scan() { - ver, err := semver.NewVersion(strings.TrimLeft(scan.Text(), prefix)) + ver, err := semver.Make(strings.TrimLeft(scan.Text(), prefix)) if err != nil { continue } diff --git a/repo/fsrepo/migrations/versions_test.go b/repo/fsrepo/migrations/versions_test.go index 130a6de26fb..18de72b779c 100644 --- a/repo/fsrepo/migrations/versions_test.go +++ b/repo/fsrepo/migrations/versions_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/coreos/go-semver/semver" + "github.com/blang/semver/v4" ) const testDist = "go-ipfs" @@ -43,7 +43,7 @@ func TestLatestDistVersion(t *testing.T) { if len(latest) < 6 { t.Fatal("latest version string too short", latest) } - _, err = semver.NewVersion(latest[1:]) + _, err = semver.New(latest[1:]) if err != nil { t.Fatal("latest version has invalid format:", latest) } From 5f0d828e85389cdff9d19c81c37d065da12a599d Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Mon, 29 Mar 2021 18:32:02 +0200 Subject: [PATCH 077/161] docs: clarification of the Strategic Providing functionality or the lack of --- docs/experimental-features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/experimental-features.md b/docs/experimental-features.md index fd8cd331811..600bc1a0154 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -496,7 +496,7 @@ NOTE: Ensuring `Swarm.EnableRelayHop` is _false_ is extremely important here. If Experimental, disabled by default. -Replaces the existing provide mechanism with a robust, strategic provider system. +Replaces the existing provide mechanism with a robust, strategic provider system. Currently enabling this option will provide nothing. ### How to enable From fb55f09882c0b0dcf395645b56d34be3840aceba Mon Sep 17 00:00:00 2001 From: gammazero Date: Mon, 29 Mar 2021 15:11:38 -0700 Subject: [PATCH 078/161] Add comment about reading until channel closed --- core/coreapi/pin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 160db2c047c..b5db63d35a1 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -219,6 +219,9 @@ func (p *pinInfo) Err() error { } // pinLsAll is an internal function for returning a list of pins +// +// The caller must keep reading results until the channel is closed to prevent +// leaking the goroutine that is fetching pins. func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreiface.Pin { out := make(chan coreiface.Pin, 1) From 2f105f79b9fc12c4321a2333652ba1a7fb17e936 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sat, 20 Mar 2021 00:53:08 +0100 Subject: [PATCH 079/161] chore: deprecate Gateway.PathPrefixes Context: https://github.com/ipfs/go-ipfs/issues/7702#issuecomment-803136077 --- cmd/ipfs/daemon.go | 4 ++++ core/corehttp/gateway_handler.go | 1 + docs/config.md | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 329a29c4cf4..9a92a0767f1 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -677,6 +677,10 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e opts = append(opts, corehttp.RedirectOption("", cfg.Gateway.RootRedirect)) } + if len(cfg.Gateway.PathPrefixes) > 0 { + log.Error("Support for X-Ipfs-Gateway-Prefix and Gateway.PathPrefixes is deprecated and will be removed in the next release. Please comment on the issue if you're using this feature: https://github.com/ipfs/go-ipfs/issues/7702") + } + node, err := cctx.ConstructNode() if err != nil { return nil, fmt.Errorf("serveHTTPGateway: ConstructNode() failed: %s", err) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index e4719817418..261c2920f60 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -159,6 +159,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request // If the gateway is behind a reverse proxy and mounted at a sub-path, // the prefix header can be set to signal this sub-path. // It will be prepended to links in directory listings and the index.html redirect. + // TODO: this feature is deprecated and will be removed (https://github.com/ipfs/go-ipfs/issues/7702) prefix := "" if prfx := r.Header.Get("X-Ipfs-Gateway-Prefix"); len(prfx) > 0 { for _, p := range i.config.PathPrefixes { diff --git a/docs/config.md b/docs/config.md index 3f70795bccb..7760e98d434 100644 --- a/docs/config.md +++ b/docs/config.md @@ -559,6 +559,9 @@ Type: `bool` ### `Gateway.PathPrefixes` +**DEPRECATED:** see [go-ipfs#7702](https://github.com/ipfs/go-ipfs/issues/7702) + + + Default: `[]` Type: `array[string]` From 090953d2980d6a361cf14af8c0bd142cf0e2c3b5 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 30 Mar 2021 21:22:55 +0200 Subject: [PATCH 080/161] docs: tweak ipfs cmd help https://github.com/ipfs/go-ipfs/pull/8010#discussion_r600842235 https://github.com/ipfs/go-ipfs/pull/8010#discussion_r600842123 --- core/commands/add.go | 4 ++-- core/commands/config.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/commands/add.go b/core/commands/add.go index 3284d113043..0be67a203db 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -53,10 +53,10 @@ var AddCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Add a file or directory to IPFS.", ShortDescription: ` -Adds contents of to IPFS. Use -r to add directories (recursively). +Adds the content of to IPFS. Use -r to add directories (recursively). `, LongDescription: ` -Adds contents of to IPFS. Use -r to add directories. +Adds the content of to IPFS. Use -r to add directories. Note that directories are added recursively, to form the IPFS MerkleDAG. diff --git a/core/commands/config.go b/core/commands/config.go index a5157ac9c72..587d6cee43a 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -41,12 +41,11 @@ var ConfigCmd = &cmds.Command{ Tagline: "Get and set IPFS config values.", ShortDescription: ` 'ipfs config' controls configuration variables. It works like 'git config'. -The configuration values are stored in a config file inside your IPFS_PATH -repository.`, +The configuration values are stored in a config file inside your IPFS_PATH.`, LongDescription: ` 'ipfs config' controls configuration variables. It works much like 'git config'. The configuration values are stored in a config -file inside your IPFS repository. +file inside your IPFS repository (IPFS_PATH). Examples: From ab563dd64140dd1ba38f9ae9c7b63ccc26d0ea5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 23:21:54 +0000 Subject: [PATCH 081/161] build(deps): bump github.com/ipld/go-car from 0.2.0 to 0.2.2 Bumps [github.com/ipld/go-car](https://github.com/ipld/go-car) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/ipld/go-car/releases) - [Commits](https://github.com/ipld/go-car/compare/v0.2.0...v0.2.2) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 259e96621d3..c08f78fccc7 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( github.com/ipfs/go-unixfs v0.2.4 github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 - github.com/ipld/go-car v0.2.0 + github.com/ipld/go-car v0.2.2 github.com/jbenet/go-is-domain v1.0.5 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 diff --git a/go.sum b/go.sum index 8fcaef728ac..3d0ec0a9e94 100644 --- a/go.sum +++ b/go.sum @@ -442,7 +442,6 @@ github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dC github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= -github.com/ipfs/go-ipld-git v0.0.3/go.mod h1:RuvMXa9qtJpDbqngyICCU/d+cmLFXxLsbIclmD0Lcr0= github.com/ipfs/go-ipld-git v0.0.4 h1:fQv2Alq72g6mH+heDWQ9Awu5FQYc3hcCUVtzuWj/Mno= github.com/ipfs/go-ipld-git v0.0.4/go.mod h1:RuvMXa9qtJpDbqngyICCU/d+cmLFXxLsbIclmD0Lcr0= github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= @@ -493,8 +492,8 @@ github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2 github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/ipld/go-car v0.2.0 h1:WwP83IdXdEuaW4fkCj+DWmdWygcFXpixramvItqFo1A= -github.com/ipld/go-car v0.2.0/go.mod h1:pPb7hzVBHBoRqU3GkPy1d6FZKQoGQ56yd3MyPGzZ0Xs= +github.com/ipld/go-car v0.2.2 h1:Dq0Kl0XMaNMCNxATbYYu/EIgqWjo2w2W+Miu6npd20g= +github.com/ipld/go-car v0.2.2/go.mod h1:pPb7hzVBHBoRqU3GkPy1d6FZKQoGQ56yd3MyPGzZ0Xs= github.com/ipld/go-ipld-prime v0.7.0 h1:eigF1ZpaL1prbsKYVMqPLoPJqD/pzkQOe2j1uzvVg7w= github.com/ipld/go-ipld-prime v0.7.0/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= github.com/ipld/go-ipld-prime-proto v0.1.1 h1:EX4yWYaIqSLwtVE30nxEcZDcvsWDtx1vImSG+XCJebY= From 52eb25343a67f914a0b4e7ac57891bba108f4fd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 23:18:19 +0000 Subject: [PATCH 082/161] build(deps): bump contrib.go.opencensus.io/exporter/prometheus Bumps [contrib.go.opencensus.io/exporter/prometheus](https://github.com/census-ecosystem/opencensus-go-exporter-prometheus) from 0.2.0 to 0.3.0. - [Release notes](https://github.com/census-ecosystem/opencensus-go-exporter-prometheus/releases) - [Commits](https://github.com/census-ecosystem/opencensus-go-exporter-prometheus/compare/v0.2.0...v0.3.0) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index c08f78fccc7..d679b430e36 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/ipfs/go-ipfs require ( bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc - contrib.go.opencensus.io/exporter/prometheus v0.2.0 + contrib.go.opencensus.io/exporter/prometheus v0.3.0 github.com/blang/semver/v4 v4.0.0 github.com/cheggaaa/pb v1.0.29 github.com/coreos/go-systemd/v22 v22.3.0 diff --git a/go.sum b/go.sum index 3d0ec0a9e94..ca23465c38e 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -contrib.go.opencensus.io/exporter/prometheus v0.2.0 h1:9PUk0/8V0LGoPqVCrf8fQZJkFGBxudu8jOjQSMwoD6w= -contrib.go.opencensus.io/exporter/prometheus v0.2.0/go.mod h1:TYmVAyE8Tn1lyPcltF5IYYfWp2KHu7lQGIZnj8iZMys= +contrib.go.opencensus.io/exporter/prometheus v0.3.0 h1:08FMdJYpItzsknogU6PiiNo7XQZg/25GjH236+YCwD0= +contrib.go.opencensus.io/exporter/prometheus v0.3.0/go.mod h1:rpCPVQKhiyH8oomWgm34ZmgIdZa8OVYO5WAIygPbBBE= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= @@ -99,7 +99,6 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= @@ -246,8 +245,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -526,6 +526,7 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -1019,9 +1020,10 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg= github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1036,7 +1038,9 @@ github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7q github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y= github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1044,14 +1048,14 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/statsd_exporter v0.15.0 h1:UiwC1L5HkxEPeapXdm2Ye0u1vUJfTj7uwT5yydYpa1E= -github.com/prometheus/statsd_exporter v0.15.0/go.mod h1:Dv8HnkoLQkeEjkIE4/2ndAA7WL1zHKK7WMqFQqu72rw= +github.com/prometheus/statsd_exporter v0.20.0 h1:M0hQphnq2WyWKS5CefQL8PqWwBOBPhiAkyLo5l4ZYvE= +github.com/prometheus/statsd_exporter v0.20.0/go.mod h1:YL3FWCG8JBBtaUSxAg4Gz2ZYu22bS84XM89ZQXXTWmQ= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1372,9 +1376,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1386,11 +1388,14 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1520,6 +1525,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= From ca53af5adb27f7819129afc718a2b3b1b3a56e0d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 30 Mar 2021 16:03:47 -0700 Subject: [PATCH 083/161] test(sharness): fix for opencensus updates --- test/sharness/t0116-prometheus-data/prometheus_metrics | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/sharness/t0116-prometheus-data/prometheus_metrics b/test/sharness/t0116-prometheus-data/prometheus_metrics index 0c653e35cb2..eb3e9211c3f 100644 --- a/test/sharness/t0116-prometheus-data/prometheus_metrics +++ b/test/sharness/t0116-prometheus-data/prometheus_metrics @@ -570,6 +570,3 @@ process_resident_memory_bytes process_start_time_seconds process_virtual_memory_bytes process_virtual_memory_max_bytes -statsd_metric_mapper_cache_gets_total -statsd_metric_mapper_cache_hits_total -statsd_metric_mapper_cache_length From 418943df4e115a84ec208585bd1a65a238b38697 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:28:14 +0000 Subject: [PATCH 084/161] build(deps): bump github.com/libp2p/go-libp2p-noise from 0.1.2 to 0.1.3 Bumps [github.com/libp2p/go-libp2p-noise](https://github.com/libp2p/go-libp2p-noise) from 0.1.2 to 0.1.3. - [Release notes](https://github.com/libp2p/go-libp2p-noise/releases) - [Commits](https://github.com/libp2p/go-libp2p-noise/compare/v0.1.2...v0.1.3) Signed-off-by: dependabot[bot] --- go.mod | 5 ++--- go.sum | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index c08f78fccc7..b33d9ff8cd4 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,7 @@ require ( github.com/libp2p/go-libp2p-kbucket v0.4.7 github.com/libp2p/go-libp2p-loggables v0.1.0 github.com/libp2p/go-libp2p-mplex v0.4.1 - github.com/libp2p/go-libp2p-noise v0.1.2 + github.com/libp2p/go-libp2p-noise v0.1.3 github.com/libp2p/go-libp2p-peerstore v0.2.6 github.com/libp2p/go-libp2p-pubsub v0.4.1 github.com/libp2p/go-libp2p-pubsub-router v0.4.0 @@ -100,9 +100,8 @@ require ( go.opencensus.io v0.23.0 go.uber.org/fx v1.13.1 go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 + golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect - golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 ) diff --git a/go.sum b/go.sum index 3d0ec0a9e94..f1d119c1067 100644 --- a/go.sum +++ b/go.sum @@ -679,8 +679,8 @@ github.com/libp2p/go-libp2p-netutil v0.0.1/go.mod h1:GdusFvujWZI9Vt0X5BKqwWWmZFx github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ= github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM= -github.com/libp2p/go-libp2p-noise v0.1.2 h1:IH9GRihQJTx56obm+GnpdPX4KeVIlvpXrP6xnJ0wxWk= -github.com/libp2p/go-libp2p-noise v0.1.2/go.mod h1:9B10b7ueo7TIxZHHcjcDCo5Hd6kfKT2m77by82SFRfE= +github.com/libp2p/go-libp2p-noise v0.1.3 h1:Akt9iJ4lsV/H/m/1F6M3SDdhSHLk541iUKXdb/n/lz4= +github.com/libp2p/go-libp2p-noise v0.1.3/go.mod h1:2LDlAB9ctnK4yL9KnipwcOdwdpwjupwh5SwI+ls1kGQ= github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= @@ -1247,8 +1247,8 @@ golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1316,8 +1316,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1394,7 +1394,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From b75d8239504280769228f1a54162e09abc32f7f8 Mon Sep 17 00:00:00 2001 From: gammazero Date: Wed, 31 Mar 2021 12:25:32 -0700 Subject: [PATCH 085/161] Update latest distribution CID --- repo/fsrepo/migrations/fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index cb29004719f..f6d5f66861a 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -8,7 +8,7 @@ import ( const ( // Current dirstibution to fetch migrations from - CurrentIpfsDist = "/ipfs/Qmaubnx6vDUEA2arLzPWxqY2brx2c1CUKsrgQHSwBXDZ5E" + CurrentIpfsDist = "/ipfs/QmVxxcTSuryJYdQJGcS8SyhzN7NBNLTqVPAxpu6gp2ZcrR" // Latest distribution path. Default for fetchers. LatestIpfsDist = "/ipns/dist.ipfs.io" From ce617a03e26c5d5ef0314e1d51d1a30b272f4bff Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 31 Mar 2021 16:18:57 -0700 Subject: [PATCH 086/161] fix: set systemd startup timeout to infinity fixes #7369 fixes #8034 --- misc/systemd/ipfs-hardened.service | 7 +++++++ misc/systemd/ipfs.service | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/misc/systemd/ipfs-hardened.service b/misc/systemd/ipfs-hardened.service index bf202218f84..87dd08f6a01 100644 --- a/misc/systemd/ipfs-hardened.service +++ b/misc/systemd/ipfs-hardened.service @@ -58,6 +58,13 @@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE #don't use swap MemorySwapMax=0 +# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when +# badger is recovering) and migrations can delay startup. +# +# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking +# systemd dependencies deeper into go-ipfs. +TimeoutStartSec=infinity + Type=notify User=ipfs Group=ipfs diff --git a/misc/systemd/ipfs.service b/misc/systemd/ipfs.service index cd689d3bafd..44519de7702 100644 --- a/misc/systemd/ipfs.service +++ b/misc/systemd/ipfs.service @@ -29,6 +29,13 @@ After=network.target #don't use swap MemorySwapMax=0 +# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when +# badger is recovering) and migrations can delay startup. +# +# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking +# systemd dependencies deeper into go-ipfs. +TimeoutStartSec=infinity + Type=notify User=ipfs Group=ipfs From 8eefcce4a1af26dfe99b4a37cef9c621abd42b33 Mon Sep 17 00:00:00 2001 From: gammazero Date: Thu, 1 Apr 2021 18:33:18 -0700 Subject: [PATCH 087/161] Add info to "pin rm" help about how to tell if a pin is indirectly pinned. Addresses issue #7440 --- core/commands/pin/pin.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index de8098b5d6d..49c1581f473 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -204,6 +204,14 @@ var rmPinCmd = &cmds.Command{ ShortDescription: ` Removes the pin from the given object allowing it to be garbage collected if needed. (By default, recursively. Use -r=false for direct pins.) +`, + LongDescription: ` +Removes the pin from the given object allowing it to be garbage +collected if needed. (By default, recursively. Use -r=false for direct pins.) + +A pin may not be removed because the specified object is not pinned or pinned +indirectly. To determine if the object is pinned indirectly, use the command: +ipfs pin ls -t indirect `, }, From 58b840f23c15a9752fada97029ea463571da927d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Apr 2021 11:14:30 +0000 Subject: [PATCH 088/161] build(deps): bump github.com/coreos/go-systemd/v22 from 22.3.0 to 22.3.1 Bumps [github.com/coreos/go-systemd/v22](https://github.com/coreos/go-systemd) from 22.3.0 to 22.3.1. - [Release notes](https://github.com/coreos/go-systemd/releases) - [Commits](https://github.com/coreos/go-systemd/compare/v22.3.0...v22.3.1) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c50d49fd9b2..eedbddcd94c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( contrib.go.opencensus.io/exporter/prometheus v0.3.0 github.com/blang/semver/v4 v4.0.0 github.com/cheggaaa/pb v1.0.29 - github.com/coreos/go-systemd/v22 v22.3.0 + github.com/coreos/go-systemd/v22 v22.3.1 github.com/dustin/go-humanize v1.0.0 github.com/elgris/jsondiff v0.0.0-20160530203242-765b5c24c302 github.com/fsnotify/fsnotify v1.4.9 diff --git a/go.sum b/go.sum index 2f5fb2f5d6f..1bf9797383e 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d h1:t5Wuyh53qYyg9eqn4BbnlIT+vmhyww0TatL+zT3uWgI= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.0 h1:C8u/Ljj8G8O6rqWJh2J8cDyeEFBMWvXlvJ/ccMyzcqw= -github.com/coreos/go-systemd/v22 v22.3.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.1 h1:7OO2CXWMYNDdaAzP51t4lCCZWwpQHmvPbm9sxWjm3So= +github.com/coreos/go-systemd/v22 v22.3.1/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -199,6 +199,7 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= From d6322f485af222e319c893eeac51c44a9859e901 Mon Sep 17 00:00:00 2001 From: David Pflug Date: Mon, 5 Apr 2021 18:01:15 -0400 Subject: [PATCH 089/161] Fix transposed words in docs/config.md --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index f9d26273f9f..ef1ff5477f2 100644 --- a/docs/config.md +++ b/docs/config.md @@ -54,7 +54,7 @@ documented in `ipfs config profile --help`. This is the most battle-tested and reliable datastore, but it's significantly slower than the badger datastore. You should use this datastore if: - - You need a very simple and very reliable datastore you and trust your + - You need a very simple and very reliable datastore and you trust your filesystem. This datastore stores each block as a separate file in the underlying filesystem so it's unlikely to loose data unless there's an issue with the underlying file system. From c4b6366536dfb59dbe06c5500bf8eed75897f4a2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 5 Apr 2021 16:31:40 -0700 Subject: [PATCH 090/161] fix: update root help * move the `cid` command to the "datastructures" section. * document bitswap & pubsub commands fixes #8047 --- core/commands/root.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/commands/root.go b/core/commands/root.go index fff4623e6b7..8aa1d7e1e45 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -44,6 +44,7 @@ DATA STRUCTURE COMMANDS files Interact with files as if they were a unix filesystem object Interact with dag-pb objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore + cid Convert and discover properties of CIDs ADVANCED COMMANDS daemon Start a long-running daemon process @@ -65,13 +66,14 @@ NETWORK COMMANDS dht Query the DHT for values or peers ping Measure the latency of a connection diag Print diagnostics + bitswap Inspect bitswap state + pubsub Send and receive messages via pubsub TOOL COMMANDS config Manage configuration version Show IPFS version information update Download and apply go-ipfs updates commands List all available commands - cid Convert and discover properties of CIDs log Manage and show logs of running daemon Use 'ipfs --help' to learn more about each command. From 7c8df87cd0710db66b36d875dd2545c180af1e8a Mon Sep 17 00:00:00 2001 From: gammazero Date: Mon, 5 Apr 2021 20:19:09 -0700 Subject: [PATCH 091/161] Make migrations log output to stdout Migrations were logging to a mix of stdout and stderr. This was due to the individual migration binaries logging non-error output to stdout, while the migration library (which downloads and executed these migrations) was logging to stderr. This inconsistency can be confusing. Also, previous versions of go-ipfs wrote non-error output to stdout. This PR fixes this so that non-error output from the migrations library is written to stdout. Added test to look for expected log output. --- repo/fsrepo/migrations/migrations.go | 32 ++++++++++++----------- repo/fsrepo/migrations/migrations_test.go | 19 +++++++++++++- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index f8d343d6578..b3a3b534f54 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -38,7 +38,9 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s return fmt.Errorf("downgrade not allowed from %d to %d", fromVer, targetVer) } - log.Print("Looking for suitable migration binaries.") + logger := log.New(os.Stdout, "", 0) + + logger.Print("Looking for suitable migration binaries.") migrations, binPaths, err := findMigrations(ctx, fromVer, targetVer) if err != nil { @@ -54,7 +56,7 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s } } - log.Println("Need", len(missing), "migrations, downloading.") + logger.Println("Need", len(missing), "migrations, downloading.") tmpDir, err := ioutil.TempDir("", "migrations") if err != nil { @@ -62,9 +64,9 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s } defer os.RemoveAll(tmpDir) - fetched, err := fetchMigrations(ctx, fetcher, missing, tmpDir) + fetched, err := fetchMigrations(ctx, fetcher, missing, tmpDir, logger) if err != nil { - log.Print("Failed to download migrations.") + logger.Print("Failed to download migrations.") return err } for i := range missing { @@ -77,13 +79,13 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s revert = true } for _, migration := range migrations { - log.Println("Running migration", migration, "...") - err = runMigration(ctx, binPaths[migration], ipfsDir, revert) + logger.Println("Running migration", migration, "...") + err = runMigration(ctx, binPaths[migration], ipfsDir, revert, logger) if err != nil { return fmt.Errorf("migration %s failed: %s", migration, err) } } - log.Printf("Success: fs-repo migrated to version %d.\n", targetVer) + logger.Printf("Success: fs-repo migrated to version %d.\n", targetVer) return nil } @@ -142,14 +144,14 @@ func findMigrations(ctx context.Context, from, to int) ([]string, map[string]str return migrations, binPaths, nil } -func runMigration(ctx context.Context, binPath, ipfsDir string, revert bool) error { +func runMigration(ctx context.Context, binPath, ipfsDir string, revert bool, logger *log.Logger) error { pathArg := fmt.Sprintf("-path=%s", ipfsDir) var cmd *exec.Cmd if revert { - log.Println(" => Running:", binPath, pathArg, "-verbose=true -revert") + logger.Println(" => Running:", binPath, pathArg, "-verbose=true -revert") cmd = exec.CommandContext(ctx, binPath, pathArg, "-verbose=true", "-revert") } else { - log.Println(" => Running:", binPath, pathArg, "-verbose=true") + logger.Println(" => Running:", binPath, pathArg, "-verbose=true") cmd = exec.CommandContext(ctx, binPath, pathArg, "-verbose=true") } cmd.Stdout = os.Stdout @@ -159,7 +161,7 @@ func runMigration(ctx context.Context, binPath, ipfsDir string, revert bool) err // fetchMigrations downloads the requested migrations, and returns a slice with // the paths of each binary, in the same order specified by needed. -func fetchMigrations(ctx context.Context, fetcher Fetcher, needed []string, destDir string) ([]string, error) { +func fetchMigrations(ctx context.Context, fetcher Fetcher, needed []string, destDir string, logger *log.Logger) ([]string, error) { osv, err := osWithVariant() if err != nil { return nil, err @@ -173,21 +175,21 @@ func fetchMigrations(ctx context.Context, fetcher Fetcher, needed []string, dest bins := make([]string, len(needed)) // Download and unpack all requested migrations concurrently. for i, name := range needed { - log.Printf("Downloading migration: %s...", name) + logger.Printf("Downloading migration: %s...", name) go func(i int, name string) { defer wg.Done() dist := path.Join(distMigsRoot, name) ver, err := LatestDistVersion(ctx, fetcher, dist, false) if err != nil { - log.Printf("could not get latest version of migration %s: %s", name, err) + logger.Printf("could not get latest version of migration %s: %s", name, err) return } loc, err := FetchBinary(ctx, fetcher, dist, ver, name, destDir) if err != nil { - log.Printf("could not download %s: %s", name, err) + logger.Printf("could not download %s: %s", name, err) return } - log.Printf("Downloaded and unpacked migration: %s (%s)", loc, ver) + logger.Printf("Downloaded and unpacked migration: %s (%s)", loc, ver) bins[i] = loc }(i, name) } diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 812e5bd7665..2735f26216e 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -2,7 +2,9 @@ package migrations import ( "context" + "fmt" "io/ioutil" + "log" "os" "path/filepath" "strings" @@ -126,7 +128,10 @@ func TestFetchMigrations(t *testing.T) { defer os.RemoveAll(tmpDir) needed := []string{"fs-repo-1-to-2", "fs-repo-2-to-3"} - fetched, err := fetchMigrations(ctx, fetcher, needed, tmpDir) + buf := new(strings.Builder) + buf.Grow(256) + logger := log.New(buf, "", 0) + fetched, err := fetchMigrations(ctx, fetcher, needed, tmpDir, logger) if err != nil { t.Fatal(err) } @@ -137,6 +142,18 @@ func TestFetchMigrations(t *testing.T) { t.Error("expected file to exist:", bin) } } + + // Check expected log output + for _, mig := range needed { + logOut := fmt.Sprintf("Downloading migration: %s", mig) + if !strings.Contains(buf.String(), logOut) { + t.Fatalf("did not find expected log output %q", logOut) + } + logOut = fmt.Sprintf("Downloaded and unpacked migration: %s", filepath.Join(tmpDir, mig)) + if !strings.Contains(buf.String(), logOut) { + t.Fatalf("did not find expected log output %q", logOut) + } + } } func TestRunMigrations(t *testing.T) { From 3106e5f91104ff60387e9f8d12d3476e6215a371 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Tue, 6 Apr 2021 16:39:22 +0100 Subject: [PATCH 092/161] chore: dont docker tag rc as latest - add guard for rc releases; publish them to docker hub with the matching git tag - make the semver regex stricter and only publish as latest when a full semver tag with no pre-release suffix is the name of the git tag. - add `release` tag as an alias of `latest` as per https://github.com/ipfs/go-ipfs/issues/3999#issuecomment-742228981 Tested manually as the push-docker-tag.sh script is set up for it: ```shell ./push-docker-tags.sh $(date -u +%F) testingsha release v0.9.0-test dry Nothing to do. No docker tag defined for branch: release, tag: v0.9.0-test ./push-docker-tags.sh $(date -u +%F) testingsha release v0.9.0-rc1 dry DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:v0.9.0-rc1 docker push ipfs/go-ipfs:v0.9.0-rc1 ./push-docker-tags.sh $(date -u +%F) testingsha release v0.9.0 dry DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:v0.9.0 docker push ipfs/go-ipfs:v0.9.0 DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:latest docker push ipfs/go-ipfs:latest DRY RUN! I would have tagged and pushed the following... docker tag ipfs/go-ipfs:wip ipfs/go-ipfs:release docker push ipfs/go-ipfs:release ``` fixes #3999 License: MIT Signed-off-by: Oli Evans --- bin/push-docker-tags.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/push-docker-tags.sh b/bin/push-docker-tags.sh index faee3998631..464a0f8942b 100755 --- a/bin/push-docker-tags.sh +++ b/bin/push-docker-tags.sh @@ -6,7 +6,7 @@ # A bit like dockerhub autobuild config, but somewhere we can version control it. # # The `docker-build` job in .circleci/config.yml builds the current commit -# in docker and tags it as ipfs/go-ipfs:wip +# in docker and tags it as ipfs/go-ipfs:wip # # Then the `docker-publish` job runs this script to decide what tag, if any, # to publish to dockerhub. @@ -59,9 +59,13 @@ pushTag () { fi } -if [[ $GIT_TAG =~ ^v[0-9]+ ]]; then +if [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then + pushTag "$GIT_TAG" + +elif [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then pushTag "$GIT_TAG" pushTag "latest" + pushTag "release" # see: https://github.com/ipfs/go-ipfs/issues/3999#issuecomment-742228981 elif [ "$GIT_BRANCH" = "feat/stabilize-dht" ]; then pushTag "bifrost-${BUILD_NUM}-${GIT_SHA1_SHORT}" From 79de5ffd3209ae16c93eacaf6d8ae016b6e7e7ab Mon Sep 17 00:00:00 2001 From: gammazero Date: Tue, 6 Apr 2021 22:45:26 -0700 Subject: [PATCH 093/161] chore: go-namesys v0.1.1 https://github.com/ipfs/go-namesys/releases/tag/v0.1.1 Closes #8000 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eedbddcd94c..ca3dfa83098 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 github.com/ipfs/go-mfs v0.1.2 - github.com/ipfs/go-namesys v0.1.0 + github.com/ipfs/go-namesys v0.1.1 github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 github.com/ipfs/go-unixfs v0.2.4 diff --git a/go.sum b/go.sum index 1bf9797383e..3617f746bad 100644 --- a/go.sum +++ b/go.sum @@ -474,8 +474,8 @@ github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZa github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= -github.com/ipfs/go-namesys v0.1.0 h1:3wTIZ7oD9X9clmA+9cpZF6I7tZky24ahUvq0Oz7FD4c= -github.com/ipfs/go-namesys v0.1.0/go.mod h1:JITpuwDgYYh84sXxw8bQXY3aTlEdyJqkbzvE12YzXgM= +github.com/ipfs/go-namesys v0.1.1 h1:HwJWd1h0Z4oALjdOz8aP/38SHgyOfh0MUUaanvEUUn8= +github.com/ipfs/go-namesys v0.1.1/go.mod h1:JITpuwDgYYh84sXxw8bQXY3aTlEdyJqkbzvE12YzXgM= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= From 9f8964e6f9fe881014d0dd20b9f1a069971c1874 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 12 Apr 2021 18:03:44 +0200 Subject: [PATCH 094/161] fix(gw): remove hardcoded hostnames This closes #7317 by removing hardcoded PL hostnames from default config, making the localhost the only implicit gateway hostname. --- core/corehttp/hostname.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index 2030989e24e..6740f0e59f7 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -23,12 +23,7 @@ import ( nsopts "github.com/ipfs/interface-go-ipfs-core/options/namesys" ) -var defaultPaths = []string{"/ipfs/", "/ipns/", "/api/", "/p2p/", "/version"} - -var pathGatewaySpec = &config.GatewaySpec{ - Paths: defaultPaths, - UseSubdomains: false, -} +var defaultPaths = []string{"/ipfs/", "/ipns/", "/api/", "/p2p/"} var subdomainGatewaySpec = &config.GatewaySpec{ Paths: defaultPaths, @@ -36,10 +31,7 @@ var subdomainGatewaySpec = &config.GatewaySpec{ } var defaultKnownGateways = map[string]*config.GatewaySpec{ - "localhost": subdomainGatewaySpec, - "ipfs.io": pathGatewaySpec, - "gateway.ipfs.io": pathGatewaySpec, - "dweb.link": subdomainGatewaySpec, + "localhost": subdomainGatewaySpec, } // Label's max length in DNS (https://tools.ietf.org/html/rfc1034#page-7) From c744981585519d632d4deb02a7cc0bc56370d2fa Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 13 Apr 2021 12:45:15 -0700 Subject: [PATCH 095/161] fix(mkreleaselog): partially handle v2 modules We can now handle v2 modules that use tags, but not v2 modules that use v2 sub-directories. --- bin/mkreleaselog | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/bin/mkreleaselog b/bin/mkreleaselog index 0588adaee24..bcc4f325513 100755 --- a/bin/mkreleaselog +++ b/bin/mkreleaselog @@ -40,7 +40,8 @@ msg() { } statlog() { - local rpath="$GOPATH/src/$1" + local module="$1" + local rpath="$GOPATH/src/$(strip_version "$module")" local start="${2:-}" local end="${3:-HEAD}" local mailmap_file="$rpath/.mailmap" @@ -106,9 +107,10 @@ pr_link() { release_log() { setopt local_options BASH_REMATCH - local repo="$1" + local module="$1" local start="$2" local end="${3:-HEAD}" + local repo="$(strip_version "$1")" local dir="$GOPATH/src/$repo" local commit pr @@ -139,11 +141,11 @@ indent() { } mod_deps() { - go list -json -m all | jq 'select(.Version != null)' + go list -mod=mod -json -m all | jq 'select(.Version != null)' } ensure() { - local repo="$1" + local repo="$(strip_version "$1")" local commit="$2" local rpath="$GOPATH/src/$repo" if [[ ! -d "$rpath" ]]; then @@ -164,14 +166,23 @@ statsummary() { jq '. + {Lines: (.Deletions + .Insertions)}' } +strip_version() { + local repo="$1" + if [[ "$repo" =~ '.*/v[0-9]+$' ]]; then + repo="$(dirname "$repo")" + fi + echo "$repo" +} + recursive_release_log() { local start="${1:-$(git tag -l | sort -V | grep -v -- '-rc' | grep 'v'| tail -n1)}" local end="${2:-$(git rev-parse HEAD)}" local repo_root="$(git rev-parse --show-toplevel)" - local package="$(cd "$repo_root" && go list)" + local module="$(go list -m)" + local dir="$(go list -m -f '{{.Dir}}')" - if ! [[ "${GOPATH}/${package}" != "${repo_root}" ]]; then - echo "This script requires the target package and all dependencies to live in a GOPATH." + if [[ "${GOPATH}/${module}" -ef "${dir}" ]]; then + echo "This script requires the target module and all dependencies to live in a GOPATH." return 1 fi @@ -191,28 +202,28 @@ recursive_release_log() { rm -f go.mod go.sum - printf -- "Generating Changelog for %s %s..%s\n" "$package" "$start" "$end" >&2 + printf -- "Generating Changelog for %s %s..%s\n" "$module" "$start" "$end" >&2 - printf -- "- %s:\n" "$package" - release_log "$package" "$start" "$end" | indent + printf -- "- %s:\n" "$module" + release_log "$module" "$start" "$end" | indent - statlog "$package" "$start" "$end" > statlog.json + statlog "$module" "$start" "$end" > statlog.json dep_changes old_deps.json new_deps.json | jq --arg filter "$REPO_FILTER" 'select(.Path | match($filter))' | # Compute changelogs jq -r '"\(.Path) \(.New.Version) \(.New.Ref) \(.Old.Version) \(.Old.Ref // "")"' | - while read repo new new_ref old old_ref; do - if ! ensure "$repo" "$new_ref"; then + while read module new new_ref old old_ref; do + if ! ensure "$module" "$new_ref"; then result=1 local changelog="failed to fetch repo" else - statlog "$repo" "$old_ref" "$new_ref" >> statlog.json - local changelog="$(release_log "$repo" "$old_ref" "$new_ref")" + statlog "$module" "$old_ref" "$new_ref" >> statlog.json + local changelog="$(release_log "$module" "$old_ref" "$new_ref")" fi if [[ -n "$changelog" ]]; then - printf -- "- %s (%s -> %s):\n" "$repo" "$old" "$new" + printf -- "- %s (%s -> %s):\n" "$module" "$old" "$new" echo "$changelog" | indent fi done From 0ae9b2b9034a57e02df419fe72f705f5a5b3b9c7 Mon Sep 17 00:00:00 2001 From: Andrew Gillis Date: Thu, 15 Apr 2021 11:47:11 -0700 Subject: [PATCH 096/161] Update migration sharness tests for new migrations (#8053) * Update migration sharness tests for new migrations With the new migrations, go-ipfs no longer uses fs-repo-migrations to do repo migrations, and was downloading real migration binaries from the network and running them. This caused failure, but was not caught because the test was expecting `ipfs daemon --migrate` to fail for other reasons. This PR fixes the migration tests by creating the appropriate fake migration binaries in the PATH so that those get run and avoid downloading the real ones. This also fixes a test that was previously marked broken. --- test/sharness/t0066-migration.sh | 55 ++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/test/sharness/t0066-migration.sh b/test/sharness/t0066-migration.sh index 5e1301befb7..aa40fd8a468 100755 --- a/test/sharness/t0066-migration.sh +++ b/test/sharness/t0066-migration.sh @@ -10,16 +10,47 @@ test_description="Test migrations auto update prompt" test_init_ipfs +MIGRATION_START=7 +IPFS_REPO_VER=$(<.ipfs/version) + +# Generate mock migration binaries +gen_mock_migrations() { + mkdir bin + i=$((MIGRATION_START)) + until [ $i -ge $IPFS_REPO_VER ] + do + j=$((i+1)) + echo "#!/bin/bash" > bin/fs-repo-${i}-to-${j} + echo "echo fake applying ${i}-to-${j} repo migration" >> bin/fs-repo-${i}-to-${j} + chmod +x bin/fs-repo-${i}-to-${j} + ((i++)) + done +} + +# Check for expected output from each migration +check_migration_output() { + out_file="$1" + i=$((MIGRATION_START)) + until [ $i -ge $IPFS_REPO_VER ] + do + j=$((i+1)) + grep "applying ${i}-to-${j} repo migration" "$out_file" > /dev/null + ((i++)) + done +} + +# Create fake migration binaries instead of letting ipfs download from network +# To test downloading and running actual binaries, comment out this test. test_expect_success "setup mock migrations" ' - mkdir bin && - echo "#!/bin/bash" > bin/fs-repo-migrations && - echo "echo 5" >> bin/fs-repo-migrations && - chmod +x bin/fs-repo-migrations && - export PATH="$(pwd)/bin":$PATH + gen_mock_migrations && + find bin -name "fs-repo-*-to-*" | wc -l > mock_count && + echo $((IPFS_REPO_VER-MIGRATION_START)) > expect_mock_count && + export PATH="$(pwd)/bin":$PATH && + test_cmp mock_count expect_mock_count ' -test_expect_success "manually reset repo version to 3" ' - echo "3" > "$IPFS_PATH"/version +test_expect_success "manually reset repo version to $MIGRATION_START" ' + echo "$MIGRATION_START" > "$IPFS_PATH"/version ' test_expect_success "ipfs daemon --migrate=false fails" ' @@ -30,13 +61,17 @@ test_expect_success "output looks good" ' grep "Please get fs-repo-migrations from https://dist.ipfs.io" false_out ' +# The migrations will succeed, but the daemon will still exit with 1 because +# the fake migrations do not update the repo version number. +# +# If run with real migrations, the daemon continues running and must be killed. test_expect_success "ipfs daemon --migrate=true runs migration" ' test_expect_code 1 ipfs daemon --migrate=true > true_out ' -test_expect_failure "output looks good" ' - grep "Running: " true_out > /dev/null && - grep "Success: fs-repo has been migrated to version 5." true_out > /dev/null +test_expect_success "output looks good" ' + check_migration_output true_out && + grep "Success: fs-repo migrated to version $IPFS_REPO_VER" true_out > /dev/null ' test_expect_success "'ipfs daemon' prompts to auto migrate" ' From 215f110bd300315b0fa4d7d55f59693639a67b7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 11:16:36 +0000 Subject: [PATCH 097/161] build(deps): bump github.com/ipfs/go-unixfs from 0.2.4 to 0.2.5 Bumps [github.com/ipfs/go-unixfs](https://github.com/ipfs/go-unixfs) from 0.2.4 to 0.2.5. - [Release notes](https://github.com/ipfs/go-unixfs/releases) - [Commits](https://github.com/ipfs/go-unixfs/compare/v0.2.4...v0.2.5) Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ca3dfa83098..fc11cad29e0 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/ipfs/go-namesys v0.1.1 github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 - github.com/ipfs/go-unixfs v0.2.4 + github.com/ipfs/go-unixfs v0.2.5 github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 github.com/ipld/go-car v0.2.2 diff --git a/go.sum b/go.sum index 3617f746bad..1397f4bee33 100644 --- a/go.sum +++ b/go.sum @@ -487,8 +487,9 @@ github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUn github.com/ipfs/go-pinning-service-http-client v0.1.0 h1:Au0P4NglL5JfzhNSZHlZ1qra+IcJyO3RWMd9EYCwqSY= github.com/ipfs/go-pinning-service-http-client v0.1.0/go.mod h1:tcCKmlkWWH9JUUkKs8CrOZBanacNc1dmKLfjlyXAMu4= github.com/ipfs/go-unixfs v0.1.0/go.mod h1:lysk5ELhOso8+Fed9U1QTGey2ocsfaZ18h0NCO2Fj9s= -github.com/ipfs/go-unixfs v0.2.4 h1:6NwppOXefWIyysZ4LR/qUBPvXd5//8J3jiMdvpbw6Lo= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= +github.com/ipfs/go-unixfs v0.2.5 h1:irj/WzIcgTBay48mSMUYDbKlIzIocXWcuUUsi5qOMOE= +github.com/ipfs/go-unixfs v0.2.5/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= From b3f054f450df1f6ad6918c1e230e9429b9e69641 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Thu, 22 Apr 2021 20:30:41 +0200 Subject: [PATCH 098/161] Fix typo in comment --- core/commands/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/config.go b/core/commands/config.go index 587d6cee43a..86037ceb4f9 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -430,7 +430,7 @@ func scrubPrivKey(cfg *config.Config) (map[string]interface{}, error) { return cfgMap, nil } -// transformConfig returns old config and new config instead of difference between they, +// transformConfig returns old config and new config instead of difference between them, // because apply command can provide stable API through this way. // If dryRun is true, repo's config should not be updated and persisted // to storage. Otherwise, repo's config should be updated and persisted From a006ded0101c679d6bc38ef3aee36c2d4e04ea43 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 28 Apr 2021 10:59:37 -0700 Subject: [PATCH 099/161] chore: update webui to 2.12.1 --- core/corehttp/webui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/corehttp/webui.go b/core/corehttp/webui.go index b52644c96b0..69e848140b9 100644 --- a/core/corehttp/webui.go +++ b/core/corehttp/webui.go @@ -1,11 +1,12 @@ package corehttp // TODO: move to IPNS -const WebUIPath = "/ipfs/bafybeif4zkmu7qdhkpf3pnhwxipylqleof7rl6ojbe7mq3fzogz6m4xk3i" // v2.11.4 +const WebUIPath = "/ipfs/bafybeid3rof2bfszwia2g7ijjzac5ycaczje3vr3sxdtcxziaf6fvi6mwu" // v2.12.1 // this is a list of all past webUI paths. var WebUIPaths = []string{ WebUIPath, + "/ipfs/bafybeif4zkmu7qdhkpf3pnhwxipylqleof7rl6ojbe7mq3fzogz6m4xk3i", "/ipfs/bafybeianwe4vy7sprht5sm3hshvxjeqhwcmvbzq73u55sdhqngmohkjgs4", "/ipfs/bafybeicitin4p7ggmyjaubqpi3xwnagrwarsy6hiihraafk5rcrxqxju6m", "/ipfs/bafybeihpetclqvwb4qnmumvcn7nh4pxrtugrlpw4jgjpqicdxsv7opdm6e", From 8c1e4e99d115f8481136b8c12293a58acdcc7872 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 30 Apr 2021 01:27:43 +0200 Subject: [PATCH 100/161] docs: deprecate object commands Part of https://github.com/ipfs/go-ipfs/issues/7936 This PR makes it very explicit that 'ipfs object' are deprecated by removing examples and pointing at modern replacements under 'ipfs dag' and 'ipfs files' Taglines are longer and include alternatives because we use them on: https://docs.ipfs.io/reference/http/api/ --- README.md | 1 - core/commands/object/object.go | 102 +++++++++++++++------------------ core/commands/object/patch.go | 52 ++++++++++++----- core/commands/root.go | 1 - 4 files changed, 84 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index 81b4e89fed4..2dafe8a739c 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,6 @@ SUBCOMMANDS DATA STRUCTURE COMMANDS dag Interact with IPLD DAG nodes files Interact with files as if they were a unix filesystem - object Interact with dag-pb objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore ADVANCED COMMANDS diff --git a/core/commands/object/object.go b/core/commands/object/object.go index 1e52f231566..1e145208a59 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -48,7 +48,7 @@ const ( var ObjectCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Interact with dag-pb objects (deprecated, use generic 'dag')", + Tagline: "Deprecated commands to interact with dag-pb objects. Use 'dag' or 'files' instead.", ShortDescription: ` 'ipfs object' is a legacy plumbing command used to manipulate dag-pb objects directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`, @@ -69,14 +69,16 @@ directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`, // ObjectDataCmd object data command var ObjectDataCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Output the raw bytes of a dag-pb object.", + Tagline: "Deprecated way to read the raw bytes of a dag-pb object: use 'dag get' instead.", ShortDescription: ` -'ipfs object data' is a plumbing command for retrieving the raw bytes stored -in a dag-pb node. It outputs to stdout, and is a base58 encoded multihash. +'ipfs object data' is a deprecated plumbing command for retrieving the raw +bytes stored in a dag-pb node. It outputs to stdout, and is a base58 +encoded multihash. Provided for legacy reasons. Use 'ipfs dag get' instead. `, LongDescription: ` -'ipfs object data' is a plumbing command for retrieving the raw bytes stored -in a dag-pb node. It outputs to stdout, and is a base58 encoded multihash. +'ipfs object data' is a deprecated plumbing command for retrieving the raw +bytes stored in a dag-pb node. It outputs to stdout, and is a base58 +encoded multihash. Provided for legacy reasons. Use 'ipfs dag get' instead. Note that the "--encoding" option does not affect the output, since the output is the raw data of the object. @@ -106,11 +108,11 @@ is the raw data of the object. // ObjectLinksCmd object links command var ObjectLinksCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Output the links pointed to by the specified dag-pb object.", + Tagline: "Deprecated way to output links in the specified dag-pb object: use 'dag get' instead.", ShortDescription: ` 'ipfs object links' is a plumbing command for retrieving the links from a dag-pb node. It outputs to stdout, and is a base58 encoded -multihash. +multihash. Provided for legacy reasons. Use 'ipfs dag get' instead. `, }, @@ -180,29 +182,13 @@ multihash. // ObjectGetCmd object get command var ObjectGetCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Get and serialize the dag-pb node named by .", + Tagline: "Deprecated way to get and serialize the dag-pb node. Use 'dag get' instead", ShortDescription: ` 'ipfs object get' is a plumbing command for retrieving dag-pb nodes. It serializes the DAG node to the format specified by the "--encoding" flag. It outputs to stdout, and is a base58 encoded multihash. -`, - LongDescription: ` -'ipfs object get' is a plumbing command for retrieving dag-pb nodes. -It serializes the DAG node to the format specified by the "--encoding" -flag. It outputs to stdout, and is a base58 encoded multihash. - -This command outputs data in the following encodings: - * "protobuf" - * "json" - * "xml" -(Specified by the "--encoding" or "--enc" flag) - -The encoding of the object's data field can be specified by using the ---data-encoding flag -Supported values are: - * "text" (default) - * "base64" +DEPRECATED and provided for legacy reasons. Use 'ipfs dag get' instead. `, }, @@ -287,9 +273,15 @@ Supported values are: // ObjectStatCmd object stat command var ObjectStatCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Get stats for the dag-pb node named by .", + Tagline: "Deprecated way to read stats for the dag-pb node. Use 'files stat' instead.", ShortDescription: ` 'ipfs object stat' is a plumbing command to print dag-pb node statistics. + is a base58 encoded multihash. + +DEPRECATED: modern replacements are 'files stat' and 'dag stat' +`, + LongDescription: ` +'ipfs object stat' is a plumbing command to print dag-pb node statistics. is a base58 encoded multihash. It outputs to stdout: NumLinks int number of links in link table @@ -297,6 +289,26 @@ var ObjectStatCmd = &cmds.Command{ LinksSize int size of the links segment DataSize int size of the data segment CumulativeSize int cumulative size of object and its references + +DEPRECATED: Provided for legacy reasons. Modern replacements: + + For unixfs, 'ipfs files stat' can be used: + + $ ipfs files stat --with-local /ipfs/QmWfVY9y3xjsixTgbd9AorQxH7VtMpzfx2HaWtsoUYecaX + QmWfVY9y3xjsixTgbd9AorQxH7VtMpzfx2HaWtsoUYecaX + Size: 5 + CumulativeSize: 13 + ChildBlocks: 0 + Type: file + Local: 13 B of 13 B (100.00%) + + Reported sizes are based on metadata present in root block, and should not be + trusted. A slower, but more secure alternative is 'ipfs dag stat', which + will work for every DAG type. It comes with a benefit of calculating the + size by walking the DAG: + + $ ipfs dag stat /ipfs/QmWfVY9y3xjsixTgbd9AorQxH7VtMpzfx2HaWtsoUYecaX + Size: 13, NumBlocks: 1 `, }, @@ -360,39 +372,12 @@ var ObjectStatCmd = &cmds.Command{ // ObjectPutCmd object put command var ObjectPutCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Store input as a dag-pb object, print its key.", + Tagline: "Deprecated way to store input as a DAG object. Use 'dag put' instead.", ShortDescription: ` 'ipfs object put' is a plumbing command for storing dag-pb nodes. It reads from stdin, and the output is a base58 encoded multihash. -`, - LongDescription: ` -'ipfs object put' is a plumbing command for storing dag-pb nodes. -It reads from stdin, and the output is a base58 encoded multihash. - -Data should be in the format specified by the --inputenc flag. ---inputenc may be one of the following: - * "protobuf" - * "json" (default) -Examples: - - $ echo '{ "Data": "abc" }' | ipfs object put - -This creates a node with the data 'abc' and no links. For an object with -links, create a file named 'node.json' with the contents: - - { - "Data": "another", - "Links": [ { - "Name": "some link", - "Hash": "QmXg9Pp2ytZ14xgmQjYEiHjVjMFXzCVVEcRTWJBmLgR39V", - "Size": 8 - } ] - } - -And then run: - - $ ipfs object put node.json +DEPRECATED and provided for legacy reasons. Use 'ipfs dag put' instead. `, }, @@ -466,9 +451,10 @@ And then run: // ObjectNewCmd object new command var ObjectNewCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Create a new dag-pb object from a template.", + Tagline: "Deprecated way to create a new dag-pb object from a template.", ShortDescription: ` 'ipfs object new' is a plumbing command for creating new dag-pb nodes. +DEPRECATED and provided for legacy reasons. Use 'dag put' and 'files' instead. `, LongDescription: ` 'ipfs object new' is a plumbing command for creating new dag-pb nodes. @@ -478,6 +464,8 @@ node. Available templates: * unixfs-dir + +DEPRECATED and provided for legacy reasons. Use 'dag put' and 'files' instead. `, }, Arguments: []cmds.Argument{ diff --git a/core/commands/object/patch.go b/core/commands/object/patch.go index 2f0239cec10..c98f125065c 100644 --- a/core/commands/object/patch.go +++ b/core/commands/object/patch.go @@ -13,11 +13,25 @@ import ( var ObjectPatchCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Create a new merkledag object based on an existing one.", + Tagline: "Deprecated way to create a new merkledag object based on an existing one. Use MFS with 'files cp|rm' instead.", ShortDescription: ` 'ipfs object patch ' is a plumbing command used to -build custom DAG objects. It mutates objects, creating new objects as a +build custom dag-pb objects. It mutates objects, creating new objects as a result. This is the Merkle-DAG version of modifying an object. + +DEPRECATED and provided for legacy reasons. +For modern use cases, use MFS with 'files' commands: 'ipfs files --help'. + + $ ipfs files cp /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn /some-dir + $ ipfs files cp /ipfs/Qmayz4F4UzqcAMitTzU4zCSckDofvxstDuj3y7ajsLLEVs /some-dir/added-file.jpg + $ ipfs files stat --hash /some-dir + + The above will add 'added-file.jpg' to the directory placed under /some-dir + and the CID of updated directory is returned by 'files stat' + + 'files cp' does not download the data, only the root block, which makes it + possible to build arbitrary directory trees without fetching them in full to + the local node. `, }, Arguments: []cmds.Argument{}, @@ -31,7 +45,7 @@ result. This is the Merkle-DAG version of modifying an object. var patchAppendDataCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Append data to the data segment of a DAG node.", + Tagline: "Deprecated way to append data to the data segment of a DAG node.", ShortDescription: ` Append data to what already exists in the data segment in the given object. @@ -40,8 +54,10 @@ Example: $ echo "hello" | ipfs object patch $HASH append-data NOTE: This does not append data to a file - it modifies the actual raw -data within an object. Objects have a max size of 1MB and objects larger than +data within a dag-pb object. Blocks have a max size of 1MB and objects larger than the limit will not be respected by the network. + +DEPRECATED and provided for legacy reasons. Use 'ipfs add' or 'ipfs files' instead. `, }, Arguments: []cmds.Argument{ @@ -79,13 +95,15 @@ the limit will not be respected by the network. var patchSetDataCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Set the data field of an IPFS object.", + Tagline: "Deprecated way to set the data field of dag-pb object.", ShortDescription: ` Set the data of an IPFS object from stdin or with the contents of a file. Example: $ echo "my data" | ipfs object patch $MYHASH set-data + +DEPRECATED and provided for legacy reasons. Use 'files cp' and 'dag put' instead. `, }, Arguments: []cmds.Argument{ @@ -123,9 +141,11 @@ Example: var patchRmLinkCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Remove a link from a given object.", + Tagline: "Deprecated way to remove a link from dag-pb object.", ShortDescription: ` Remove a Merkle-link from the given object and return the hash of the result. + +DEPRECATED and provided for legacy reasons. Use 'files rm' instead. `, }, Arguments: []cmds.Argument{ @@ -163,18 +183,24 @@ const ( var patchAddLinkCmd = &cmds.Command{ Helptext: cmds.HelpText{ - Tagline: "Add a link to a given object.", + Tagline: "Deprecated way to add a link to a given dag-pb.", ShortDescription: ` Add a Merkle-link to the given object and return the hash of the result. -Example: +DEPRECATED and provided for legacy reasons. + +Use MFS and 'files' commands instead: + + $ ipfs files cp /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn /some-dir + $ ipfs files cp /ipfs/Qmayz4F4UzqcAMitTzU4zCSckDofvxstDuj3y7ajsLLEVs /some-dir/added-file.jpg + $ ipfs files stat --hash /some-dir - $ EMPTY_DIR=$(ipfs object new unixfs-dir) - $ BAR=$(echo "bar" | ipfs add -q) - $ ipfs object patch $EMPTY_DIR add-link foo $BAR + The above will add 'added-file.jpg' to the directory placed under /some-dir + and the CID of updated directory is returned by 'files stat' -This takes an empty directory, and adds a link named 'foo' under it, pointing -to a file containing 'bar', and returns the hash of the new object. + 'files cp' does not download the data, only the root block, which makes it + possible to build arbitrary directory trees without fetching them in full to + the local node. `, }, Arguments: []cmds.Argument{ diff --git a/core/commands/root.go b/core/commands/root.go index 8aa1d7e1e45..b6a7f639fef 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -42,7 +42,6 @@ BASIC COMMANDS DATA STRUCTURE COMMANDS dag Interact with IPLD DAG nodes files Interact with files as if they were a unix filesystem - object Interact with dag-pb objects (deprecated, use 'dag' or 'files') block Interact with raw blocks in the datastore cid Convert and discover properties of CIDs From a9868105f09438d3d6dd3fc3b2a2c85d1bc3fde8 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 30 Apr 2021 16:12:21 +0200 Subject: [PATCH 101/161] feat: ipfs-webui v2.12.2 https://github.com/ipfs/ipfs-webui/releases/tag/v2.12.2 --- core/corehttp/webui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/corehttp/webui.go b/core/corehttp/webui.go index 69e848140b9..6191119cab9 100644 --- a/core/corehttp/webui.go +++ b/core/corehttp/webui.go @@ -1,7 +1,7 @@ package corehttp // TODO: move to IPNS -const WebUIPath = "/ipfs/bafybeid3rof2bfszwia2g7ijjzac5ycaczje3vr3sxdtcxziaf6fvi6mwu" // v2.12.1 +const WebUIPath = "/ipfs/bafybeifuexpvt6g4bkbmsrlb7rnudskfakn6vdrtoja4ml4zbxne2hu6bq" // v2.12.2 // this is a list of all past webUI paths. var WebUIPaths = []string{ From 0f1e5be1be94656ffd3ffb26350e0aeca64644e4 Mon Sep 17 00:00:00 2001 From: Oli Evans Date: Wed, 5 May 2021 15:32:26 +0100 Subject: [PATCH 102/161] feat: expose dag/export on read-only gateway api MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add dag/export to read-only root. it's ready only, so why the heck not! - test that i didn't expose other dag subcommands § License: MIT Signed-off-by: Oli Evans --- core/commands/root.go | 1 + test/sharness/t0110-gateway.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/commands/root.go b/core/commands/root.go index b6a7f639fef..fbe2006e542 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -194,6 +194,7 @@ var rootROSubcommands = map[string]*cmds.Command{ "get": dag.DagGetCmd, "resolve": dag.DagResolveCmd, "stat": dag.DagStatCmd, + "export": dag.DagExportCmd, }, }, "resolve": ResolveCmd, diff --git a/test/sharness/t0110-gateway.sh b/test/sharness/t0110-gateway.sh index 84bc963410d..cdeeaae6d23 100755 --- a/test/sharness/t0110-gateway.sh +++ b/test/sharness/t0110-gateway.sh @@ -199,6 +199,8 @@ for cmd in add \ block/put \ bootstrap \ config \ + dag/put \ + dag/import \ dht \ diag \ id \ From 7406b8399084dbf5c17c66f357b6c458cf46ce45 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 5 May 2021 22:32:28 +0200 Subject: [PATCH 103/161] test: dag export in TestROCommands on gateway --- core/commands/commands_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index 657ed2f4069..ef106acb393 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -26,6 +26,7 @@ func TestROCommands(t *testing.T) { "/dag/get", "/dag/resolve", "/dag/stat", + "/dag/export", "/dns", "/get", "/ls", From a158036deefaa1da2b17f4596ecc067df12a4b3d Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 7 May 2021 16:26:23 +0200 Subject: [PATCH 104/161] feat: allow key export in online mode Export does not require repo lock and it is safe to do even when ipfs daemon is running. This enables apps like Brave browser to do import/export without stopping/starting daemon. Ref. https://github.com/brave/brave-browser/issues/15422 --- core/commands/keystore.go | 10 ++++++---- test/sharness/t0165-keystore.sh | 9 +++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 85c6ae1a3df..8a806113c0f 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -12,6 +12,7 @@ import ( cmds "github.com/ipfs/go-ipfs-cmds" config "github.com/ipfs/go-ipfs-config" + keystore "github.com/ipfs/go-ipfs-keystore" oldcmds "github.com/ipfs/go-ipfs/commands" cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" "github.com/ipfs/go-ipfs/core/commands/e" @@ -150,7 +151,6 @@ path can be specified with '--output=' or '-o='. cmds.StringOption(outputOptionName, "o", "The path where the output should be stored."), }, NoRemote: true, - PreRun: DaemonNotRunning, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { name := req.Arguments[0] @@ -163,13 +163,15 @@ path can be specified with '--output=' or '-o='. return err } - r, err := fsrepo.Open(cfgRoot) + // Export is read-only: safe to read it without acquiring repo lock + // (this makes export work when ipfs daemon is already running) + ksp := filepath.Join(cfgRoot, "keystore") + ks, err := keystore.NewFSKeystore(ksp) if err != nil { return err } - defer r.Close() - sk, err := r.Keystore().Get(name) + sk, err := ks.Get(name) if err != nil { return fmt.Errorf("key with name '%s' doesn't exist", name) } diff --git a/test/sharness/t0165-keystore.sh b/test/sharness/t0165-keystore.sh index b3ae12fefd7..0bd8f74e69c 100755 --- a/test/sharness/t0165-keystore.sh +++ b/test/sharness/t0165-keystore.sh @@ -175,8 +175,13 @@ ipfs key rm key_ed25519 test_cmp rsa_key_id roundtrip_rsa_key_id ' - test_expect_success "online export rsa key" ' - test_must_fail ipfs key export generated_rsa_key + test_expect_success "export and import ed25519 key while daemon is running" ' + edhash=$(ipfs key gen exported_ed25519_key --type=ed25519) + echo $edhash > ed25519_key_id + ipfs key export exported_ed25519_key && + ipfs key rm exported_ed25519_key && + ipfs key import exported_ed25519_key exported_ed25519_key.key > roundtrip_ed25519_key_id && + test_cmp ed25519_key_id roundtrip_ed25519_key_id ' test_expect_success "online rotate rsa key" ' From d91ff2102b6756471fa92145ef2d99d621dac039 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 10 May 2021 20:02:45 -0700 Subject: [PATCH 105/161] update go-libp2p to v0.14.0 --- cmd/ipfs/dnsresolve_test.go | 17 +++++--- go.mod | 14 +++--- go.sum | 86 ++++++++++++++++++++++++++----------- 3 files changed, 78 insertions(+), 39 deletions(-) diff --git a/cmd/ipfs/dnsresolve_test.go b/cmd/ipfs/dnsresolve_test.go index 060581a8cfb..7c0404523a9 100644 --- a/cmd/ipfs/dnsresolve_test.go +++ b/cmd/ipfs/dnsresolve_test.go @@ -16,24 +16,26 @@ var ( testAddr, _ = ma.NewMultiaddr("/dns4/example.com/tcp/5001") ) -func makeResolver(n uint8) *madns.Resolver { +func makeResolver(t *testing.T, n uint8) *madns.Resolver { results := make([]net.IPAddr, n) for i := uint8(0); i < n; i++ { results[i] = net.IPAddr{IP: net.ParseIP(fmt.Sprintf("192.0.2.%d", i))} } - backend := &madns.MockBackend{ + backend := &madns.MockResolver{ IP: map[string][]net.IPAddr{ "example.com": results, }} - return &madns.Resolver{ - Backend: backend, + resolver, err := madns.NewResolver(madns.WithDefaultResolver(backend)) + if err != nil { + t.Fatal(err) } + return resolver } func TestApiEndpointResolveDNSOneResult(t *testing.T) { - dnsResolver = makeResolver(1) + dnsResolver = makeResolver(t, 1) addr, err := resolveAddr(ctx, testAddr) if err != nil { @@ -46,7 +48,7 @@ func TestApiEndpointResolveDNSOneResult(t *testing.T) { } func TestApiEndpointResolveDNSMultipleResults(t *testing.T) { - dnsResolver = makeResolver(4) + dnsResolver = makeResolver(t, 4) addr, err := resolveAddr(ctx, testAddr) if err != nil { @@ -59,7 +61,7 @@ func TestApiEndpointResolveDNSMultipleResults(t *testing.T) { } func TestApiEndpointResolveDNSNoResults(t *testing.T) { - dnsResolver = makeResolver(0) + dnsResolver = makeResolver(t, 0) addr, err := resolveAddr(ctx, testAddr) if addr != nil || err == nil { @@ -70,3 +72,4 @@ func TestApiEndpointResolveDNSNoResults(t *testing.T) { t.Errorf("expected error not thrown; actual: %v", err) } } + diff --git a/go.mod b/go.mod index fc11cad29e0..2a93b083335 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/jbenet/goprocess v0.1.4 - github.com/libp2p/go-libp2p v0.13.0 + github.com/libp2p/go-libp2p v0.14.0 github.com/libp2p/go-libp2p-circuit v0.4.0 github.com/libp2p/go-libp2p-connmgr v0.2.4 github.com/libp2p/go-libp2p-core v0.8.5 @@ -69,24 +69,24 @@ require ( github.com/libp2p/go-libp2p-kbucket v0.4.7 github.com/libp2p/go-libp2p-loggables v0.1.0 github.com/libp2p/go-libp2p-mplex v0.4.1 - github.com/libp2p/go-libp2p-noise v0.1.3 - github.com/libp2p/go-libp2p-peerstore v0.2.6 + github.com/libp2p/go-libp2p-noise v0.2.0 + github.com/libp2p/go-libp2p-peerstore v0.2.7 github.com/libp2p/go-libp2p-pubsub v0.4.1 github.com/libp2p/go-libp2p-pubsub-router v0.4.0 github.com/libp2p/go-libp2p-quic-transport v0.10.0 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 - github.com/libp2p/go-libp2p-swarm v0.4.1 + github.com/libp2p/go-libp2p-swarm v0.5.0 github.com/libp2p/go-libp2p-testing v0.4.0 github.com/libp2p/go-libp2p-tls v0.1.3 - github.com/libp2p/go-libp2p-yamux v0.5.1 + github.com/libp2p/go-libp2p-yamux v0.5.3 github.com/libp2p/go-socket-activation v0.0.2 github.com/libp2p/go-tcp-transport v0.2.1 github.com/libp2p/go-ws-transport v0.4.0 github.com/lucas-clemente/quic-go v0.19.3 github.com/mitchellh/go-homedir v1.1.0 github.com/multiformats/go-multiaddr v0.3.1 - github.com/multiformats/go-multiaddr-dns v0.2.0 + github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multibase v0.0.3 github.com/multiformats/go-multihash v0.0.14 github.com/opentracing/opentracing-go v1.2.0 @@ -103,7 +103,7 @@ require ( golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 + golang.org/x/sys v0.0.0-20210426080607-c94f62235c83 ) go 1.14 diff --git a/go.sum b/go.sum index 1397f4bee33..13650c2d02a 100644 --- a/go.sum +++ b/go.sum @@ -82,14 +82,18 @@ github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dm github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= +github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= @@ -137,8 +141,10 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018 h1:6xT9KW8zLC5IlbaIF5Q7JNieBoACT7iW0YTxQHR0in0= github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= +github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= +github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= @@ -171,8 +177,9 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= +github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ= +github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -253,8 +260,9 @@ github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+u github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= -github.com/google/gopacket v1.1.18 h1:lum7VRA9kdlvBi7/v2p7/zcbkduHaCH/SVVyurs7OpY= github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= +github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -552,8 +560,9 @@ github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jv github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= @@ -569,8 +578,9 @@ github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0 github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= -github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= +github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= +github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= @@ -586,8 +596,9 @@ github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xS github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= -github.com/libp2p/go-libp2p v0.13.0 h1:tDdrXARSghmusdm0nf1U/4M8aj8Rr0V2IzQOXmbzQ3s= github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= +github.com/libp2p/go-libp2p v0.14.0 h1:mYab0qShfAojYN/QTOtxPyQoK9knUHbUncwst4+wBcA= +github.com/libp2p/go-libp2p v0.14.0/go.mod h1:dsQrWLAoIn+GkHPN/U+yypizkHiB9tnv79Os+kSgQ4Q= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= @@ -596,8 +607,9 @@ github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/ github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= +github.com/libp2p/go-libp2p-autonat v0.4.2 h1:YMp7StMi2dof+baaxkbxaizXjY1RPvU71CXfxExzcUU= +github.com/libp2p/go-libp2p-autonat v0.4.2/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= @@ -633,6 +645,7 @@ github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= +github.com/libp2p/go-libp2p-core v0.8.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.5 h1:aEgbIcPGsKy6zYcC+5AJivYFedhYa4sW7mIpWpUaLKw= github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= @@ -682,8 +695,8 @@ github.com/libp2p/go-libp2p-netutil v0.0.1/go.mod h1:GdusFvujWZI9Vt0X5BKqwWWmZFx github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ= github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM= -github.com/libp2p/go-libp2p-noise v0.1.3 h1:Akt9iJ4lsV/H/m/1F6M3SDdhSHLk541iUKXdb/n/lz4= -github.com/libp2p/go-libp2p-noise v0.1.3/go.mod h1:2LDlAB9ctnK4yL9KnipwcOdwdpwjupwh5SwI+ls1kGQ= +github.com/libp2p/go-libp2p-noise v0.2.0 h1:wmk5nhB9a2w2RxMOyvsoKjizgJOEaJdfAakr0jN8gds= +github.com/libp2p/go-libp2p-noise v0.2.0/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q= github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= @@ -695,8 +708,9 @@ github.com/libp2p/go-libp2p-peerstore v0.1.4/go.mod h1:+4BDbDiiKf4PzpANZDAT+knVd github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= +github.com/libp2p/go-libp2p-peerstore v0.2.7 h1:83JoLxyR9OYTnNfB5vvFqvMUv/xDNa6NoPHnENhBsGw= +github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= @@ -730,8 +744,8 @@ github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0 github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= github.com/libp2p/go-libp2p-swarm v0.4.0/go.mod h1:XVFcO52VoLoo0eitSxNQWYq4D6sydGOweTOAjJNraCw= -github.com/libp2p/go-libp2p-swarm v0.4.1 h1:5e08LZ8I1HLDyutZr5m5OSCHV5pUVTsUHb5aVAljDC0= -github.com/libp2p/go-libp2p-swarm v0.4.1/go.mod h1:lZ3rjk0+w4cO7d4yhBlvYoH/2nuS5E8PU+uYuC7pwtE= +github.com/libp2p/go-libp2p-swarm v0.5.0 h1:HIK0z3Eqoo8ugmN8YqWAhD2RORgR+3iNXYG4U2PFd1E= +github.com/libp2p/go-libp2p-swarm v0.5.0/go.mod h1:sU9i6BoHE0Ve5SKz3y9WfKrh8dUat6JknzUehFx8xW4= github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -750,8 +764,9 @@ github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2 github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.0 h1:xwj4h3hJdBrxqMOyMUjwscjoVst0AASTsKtZiTChoHI= github.com/libp2p/go-libp2p-transport-upgrader v0.4.0/go.mod h1:J4ko0ObtZSmgn5BX5AmegP+dK3CSnU2lMCKsSq/EY0s= +github.com/libp2p/go-libp2p-transport-upgrader v0.4.2 h1:4JsnbfJzgZeRS9AWN7B9dPqn/LY/HoQTlO9gtdJTIYM= +github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8= github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= @@ -762,11 +777,13 @@ github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhL github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= -github.com/libp2p/go-libp2p-yamux v0.5.1 h1:sX4WQPHMhRxJE5UZTfjEuBvlQWXB5Bo3A2JK9ZJ9EM0= github.com/libp2p/go-libp2p-yamux v0.5.1/go.mod h1:dowuvDu8CRWmr0iqySMiSxK+W0iL5cMVO9S94Y6gkv4= +github.com/libp2p/go-libp2p-yamux v0.5.3 h1:x2bK2BWktdMdTrciiDmgTMIxYNBdkxewQFEjHDl7VgU= +github.com/libp2p/go-libp2p-yamux v0.5.3/go.mod h1:Vy3TMonBAfTMXHWopsMc8iX/XGRYrRlpUaMzaeuHV/s= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= +github.com/libp2p/go-maddr-filter v0.1.0 h1:4ACqZKw8AqiuJfwFGq1CYDFugfXTOos+qQ3DETkhtCE= github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUhgnKqNEmIAz/bPU= github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.0.4/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= @@ -786,8 +803,9 @@ github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/ github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-netroute v0.1.3 h1:1ngWRx61us/EpaKkdqkMjKk/ufr/JlIFYQAxV2XX8Ig= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= +github.com/libp2p/go-netroute v0.1.6 h1:ruPJStbYyXVYGQ81uzEDzuvbYRLKRrLvTYd33yomC38= +github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= @@ -801,8 +819,9 @@ github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA2 github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= -github.com/libp2p/go-sockaddr v0.0.2 h1:tCuXfpA9rq7llM/v834RKc/Xvovy/AqM9kHvTV/jY/Q= github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= +github.com/libp2p/go-sockaddr v0.1.1 h1:yD80l2ZOdGksnOyHrhxDdTDFrf7Oy+v3FMVArIRgZxQ= +github.com/libp2p/go-sockaddr v0.1.1/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-socket-activation v0.0.2 h1:VLU3IbrUUqu4DMhxA9857Q63qUpEAbCz5RqSnLCx5jE= github.com/libp2p/go-socket-activation v0.0.2/go.mod h1:KP44C+yZ7gA8sTxavgaD0b8vXVFJwam2CEW0s7+f094= github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14= @@ -836,8 +855,9 @@ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux/v2 v2.0.0 h1:vSGhAy5u6iHBq11ZDcyHH4Blcf9xlBhT4WQDoOE90LU= github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= +github.com/libp2p/go-yamux/v2 v2.1.1 h1:3RkXAnDmaXJPckF/QbDnNbA6lZXMgycNTVMMTQ2YlAI= +github.com/libp2p/go-yamux/v2 v2.1.1/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= @@ -874,8 +894,9 @@ github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00v github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo= github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= @@ -920,8 +941,9 @@ github.com/multiformats/go-multiaddr v0.3.1 h1:1bxa+W7j9wZKTZREySx1vPMs2TqrYWjVZ github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= -github.com/multiformats/go-multiaddr-dns v0.2.0 h1:YWJoIDwLePniH7OU5hBnDZV6SWuvJqJ0YtN6pLeH9zA= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= +github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= +github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= @@ -949,8 +971,10 @@ github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= +github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= +github.com/multiformats/go-multistream v0.2.2 h1:TCYu1BHTDr1F/Qm75qwYISQdzGcRdC21nFgQW7l7GBo= +github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -979,6 +1003,7 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -1251,6 +1276,8 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= @@ -1275,6 +1302,7 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -1286,6 +1314,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1322,8 +1351,9 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk= +golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1393,22 +1423,27 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210309074719-68d13333faf2 h1:46ULzRKLh1CwgRq2dC5SlBzEqqNCi8rreOZnNrbqcIY= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426080607-c94f62235c83 h1:kHSDPqCtsHZOg0nVylfTo20DDhE9gG4Y0jn7hKQ0QAM= +golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1533,8 +1568,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= From c9a0a03969a345f2a704fdbee530e1f40eb52ce2 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 12 Apr 2021 13:45:37 +0300 Subject: [PATCH 106/161] gomod: deps, tidy --- go.mod | 4 ++-- go.sum | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 2a93b083335..9f122f6f208 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 - github.com/ipfs/go-ipfs-config v0.12.0 + github.com/ipfs/go-ipfs-config v0.12.1-0.20210415091656-d75a8c68b4c4 github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-offline v0.0.1 github.com/ipfs/go-ipfs-files v0.0.8 @@ -48,7 +48,7 @@ require ( github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 github.com/ipfs/go-mfs v0.1.2 - github.com/ipfs/go-namesys v0.1.1 + github.com/ipfs/go-namesys v0.1.2-0.20210423173001-2454122ef30e github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 github.com/ipfs/go-unixfs v0.2.5 diff --git a/go.sum b/go.sum index 13650c2d02a..db8bf067137 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,6 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= -github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d h1:QgeLLoPD3kRVmeu/1al9iIpIANMi9O1zXFm8BnYGCJg= -github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d/go.mod h1:Jbj8eKecMNwf0KFI75skSUZqMB4UCRcndUScVBTWyUI= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= @@ -410,8 +408,8 @@ github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7Na github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw= github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= -github.com/ipfs/go-ipfs-config v0.12.0 h1:wxqN3ohBlis1EkhkzIKuF+XLx4YNn9rNpiSOYw3DFZc= -github.com/ipfs/go-ipfs-config v0.12.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= +github.com/ipfs/go-ipfs-config v0.12.1-0.20210415091656-d75a8c68b4c4 h1:3Hoy9E3cnxCbeGNs3+PilCyhoZMlW9aekheyT0xWBys= +github.com/ipfs/go-ipfs-config v0.12.1-0.20210415091656-d75a8c68b4c4/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -482,8 +480,8 @@ github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZa github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= -github.com/ipfs/go-namesys v0.1.1 h1:HwJWd1h0Z4oALjdOz8aP/38SHgyOfh0MUUaanvEUUn8= -github.com/ipfs/go-namesys v0.1.1/go.mod h1:JITpuwDgYYh84sXxw8bQXY3aTlEdyJqkbzvE12YzXgM= +github.com/ipfs/go-namesys v0.1.2-0.20210423173001-2454122ef30e h1:yBTC5lwYjUGrfk8mNdcqUV1ewbmrWFf2ksskqOhl2pY= +github.com/ipfs/go-namesys v0.1.2-0.20210423173001-2454122ef30e/go.mod h1:j1ttlrLy7/NhtwrXOqwMty749Fe3yEKt2yaYR3XJQPE= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= @@ -580,6 +578,8 @@ github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0 github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= +github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= +github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= @@ -896,6 +896,8 @@ github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= @@ -943,6 +945,8 @@ github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/94 github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= +github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= +github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= @@ -973,6 +977,7 @@ github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= +github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.2 h1:TCYu1BHTDr1F/Qm75qwYISQdzGcRdC21nFgQW7l7GBo= github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= From 543c5da34a9678b72dfeaaa28bcb66e8d57cd263 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 12 Apr 2021 13:46:24 +0300 Subject: [PATCH 107/161] explicit construction of DNS resolver --- core/commands/dns.go | 7 ++++++- core/commands/swarm.go | 22 ++++++++++++++++------ core/core.go | 2 ++ core/coreapi/coreapi.go | 9 ++++++--- core/coreapi/name.go | 2 +- core/node/dns.go | 11 +++++++++++ core/node/groups.go | 3 +++ core/node/ipns.go | 7 ++++--- core/node/libp2p/dns.go | 11 +++++++++++ 9 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 core/node/dns.go create mode 100644 core/node/libp2p/dns.go diff --git a/core/commands/dns.go b/core/commands/dns.go index 43c5f3d78bf..42a7c98c1a2 100644 --- a/core/commands/dns.go +++ b/core/commands/dns.go @@ -61,9 +61,14 @@ The resolver can recursively resolve: cmds.BoolOption(dnsRecursiveOptionName, "r", "Resolve until the result is not a DNS link.").WithDefault(true), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + node, err := cmdenv.GetNode(env) + if err != nil { + return err + } + recursive, _ := req.Options[dnsRecursiveOptionName].(bool) name := req.Arguments[0] - resolver := namesys.NewDNSResolver() + resolver := namesys.NewDNSResolver(node.DNSResolver.LookupTXT) var routing []nsopts.ResolveOpt if !recursive { diff --git a/core/commands/swarm.go b/core/commands/swarm.go index ad0526a25ec..b82a95630dc 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -360,6 +360,11 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N cmds.StringArg("address", true, true, "Address of peer to connect to.").EnableStdin(), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + node, err := cmdenv.GetNode(env) + if err != nil { + return err + } + api, err := cmdenv.GetApi(env, req) if err != nil { return err @@ -367,7 +372,7 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N addrs := req.Arguments - pis, err := parseAddresses(req.Context, addrs) + pis, err := parseAddresses(req.Context, addrs, node.DNSResolver) if err != nil { return err } @@ -408,12 +413,17 @@ it will reconnect. cmds.StringArg("address", true, true, "Address of peer to disconnect from.").EnableStdin(), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + node, err := cmdenv.GetNode(env) + if err != nil { + return err + } + api, err := cmdenv.GetApi(env, req) if err != nil { return err } - addrs, err := parseAddresses(req.Context, req.Arguments) + addrs, err := parseAddresses(req.Context, req.Arguments, node.DNSResolver) if err != nil { return err } @@ -453,9 +463,9 @@ it will reconnect. // parseAddresses is a function that takes in a slice of string peer addresses // (multiaddr + peerid) and returns a slice of properly constructed peers -func parseAddresses(ctx context.Context, addrs []string) ([]peer.AddrInfo, error) { +func parseAddresses(ctx context.Context, addrs []string, rslv *madns.Resolver) ([]peer.AddrInfo, error) { // resolve addresses - maddrs, err := resolveAddresses(ctx, addrs) + maddrs, err := resolveAddresses(ctx, addrs, rslv) if err != nil { return nil, err } @@ -464,7 +474,7 @@ func parseAddresses(ctx context.Context, addrs []string) ([]peer.AddrInfo, error } // resolveAddresses resolves addresses parallelly -func resolveAddresses(ctx context.Context, addrs []string) ([]ma.Multiaddr, error) { +func resolveAddresses(ctx context.Context, addrs []string, rslv *madns.Resolver) ([]ma.Multiaddr, error) { ctx, cancel := context.WithTimeout(ctx, dnsResolveTimeout) defer cancel() @@ -488,7 +498,7 @@ func resolveAddresses(ctx context.Context, addrs []string) ([]ma.Multiaddr, erro wg.Add(1) go func(maddr ma.Multiaddr) { defer wg.Done() - raddrs, err := madns.Resolve(ctx, maddr) + raddrs, err := rslv.Resolve(ctx, maddr) if err != nil { resolveErrC <- err return diff --git a/core/core.go b/core/core.go index 7c8737a6a41..75fc95ff7d8 100644 --- a/core/core.go +++ b/core/core.go @@ -40,6 +40,7 @@ import ( "github.com/libp2p/go-libp2p/p2p/discovery" p2pbhost "github.com/libp2p/go-libp2p/p2p/host/basic" ma "github.com/multiformats/go-multiaddr" + madns "github.com/multiformats/go-multiaddr-dns" "github.com/ipfs/go-ipfs/core/bootstrap" "github.com/ipfs/go-ipfs/core/node" @@ -88,6 +89,7 @@ type IpfsNode struct { Filters *ma.Filters `optional:"true"` Bootstrapper io.Closer `optional:"true"` // the periodic bootstrapper Routing routing.Routing `optional:"true"` // the routing system. recommend ipfs-dht + DNSResolver *madns.Resolver // the DNS resolver Exchange exchange.Interface // the block exchange + strategy (bitswap) Namesys namesys.NameSystem // the name system, resolves paths to hashes Provider provider.System // the value provider system diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 672b426456f..309f4863c62 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -36,6 +36,7 @@ import ( routing "github.com/libp2p/go-libp2p-core/routing" pubsub "github.com/libp2p/go-libp2p-pubsub" record "github.com/libp2p/go-libp2p-record" + madns "github.com/multiformats/go-multiaddr-dns" "github.com/ipfs/go-ipfs/core" "github.com/ipfs/go-ipfs/core/node" @@ -62,8 +63,9 @@ type CoreAPI struct { recordValidator record.Validator exchange exchange.Interface - namesys namesys.NameSystem - routing routing.Routing + namesys namesys.NameSystem + routing routing.Routing + dnsResolver *madns.Resolver provider provider.System @@ -174,6 +176,7 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e recordValidator: n.RecordValidator, exchange: n.Exchange, routing: n.Routing, + dnsResolver: n.DNSResolver, provider: n.Provider, @@ -212,7 +215,7 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e } subApi.routing = offlineroute.NewOfflineRouter(subApi.repo.Datastore(), subApi.recordValidator) - subApi.namesys = namesys.NewNameSystem(subApi.routing, subApi.repo.Datastore(), cs) + subApi.namesys = namesys.NewNameSystem(subApi.routing, subApi.repo.Datastore(), subApi.dnsResolver, cs) subApi.provider = provider.NewOfflineProvider() subApi.peerstore = nil diff --git a/core/coreapi/name.go b/core/coreapi/name.go index babb7c4a8b7..213e7f6afa3 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -95,7 +95,7 @@ func (api *NameAPI) Search(ctx context.Context, name string, opts ...caopts.Name var resolver namesys.Resolver = api.namesys if !options.Cache { - resolver = namesys.NewNameSystem(api.routing, api.repo.Datastore(), 0) + resolver = namesys.NewNameSystem(api.routing, api.repo.Datastore(), api.dnsResolver, 0) } if !strings.HasPrefix(name, "/ipns/") { diff --git a/core/node/dns.go b/core/node/dns.go new file mode 100644 index 00000000000..72c89903c42 --- /dev/null +++ b/core/node/dns.go @@ -0,0 +1,11 @@ +package node + +import ( + config "github.com/ipfs/go-ipfs-config" + madns "github.com/multiformats/go-multiaddr-dns" +) + +func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { + // TODO custom resolvers from config + return madns.DefaultResolver, nil +} diff --git a/core/node/groups.go b/core/node/groups.go index 90245ba0517..6863043396c 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -30,6 +30,7 @@ var BaseLibP2P = fx.Options( fx.Provide(libp2p.PNet), fx.Provide(libp2p.ConnectionManager), fx.Provide(libp2p.Host), + fx.Provide(libp2p.MultiaddrResolver), fx.Provide(libp2p.DiscoveryHandler), @@ -264,6 +265,7 @@ func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option { return fx.Options( fx.Provide(OnlineExchange(shouldBitswapProvide)), maybeProvide(Graphsync, cfg.Experimental.GraphsyncEnabled), + fx.Provide(DNSResolver), fx.Provide(Namesys(ipnsCacheSize)), fx.Provide(Peering), PeerWith(cfg.Peering.Peers...), @@ -281,6 +283,7 @@ func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option { func Offline(cfg *config.Config) fx.Option { return fx.Options( fx.Provide(offline.Exchange), + fx.Provide(DNSResolver), fx.Provide(Namesys(0)), fx.Provide(offroute.NewOfflineRouter), OfflineProviders(cfg.Experimental.StrategicProviding, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), diff --git a/core/node/ipns.go b/core/node/ipns.go index 4b2c1738923..98f2de79cd5 100644 --- a/core/node/ipns.go +++ b/core/node/ipns.go @@ -10,6 +10,7 @@ import ( "github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp2p/go-libp2p-core/routing" "github.com/libp2p/go-libp2p-record" + madns "github.com/multiformats/go-multiaddr-dns" "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-namesys" @@ -27,9 +28,9 @@ func RecordValidator(ps peerstore.Peerstore) record.Validator { } // Namesys creates new name system -func Namesys(cacheSize int) func(rt routing.Routing, repo repo.Repo) (namesys.NameSystem, error) { - return func(rt routing.Routing, repo repo.Repo) (namesys.NameSystem, error) { - return namesys.NewNameSystem(rt, repo.Datastore(), cacheSize), nil +func Namesys(cacheSize int) func(rt routing.Routing, rslv *madns.Resolver, repo repo.Repo) (namesys.NameSystem, error) { + return func(rt routing.Routing, rslv *madns.Resolver, repo repo.Repo) (namesys.NameSystem, error) { + return namesys.NewNameSystem(rt, repo.Datastore(), rslv, cacheSize), nil } } diff --git a/core/node/libp2p/dns.go b/core/node/libp2p/dns.go new file mode 100644 index 00000000000..1c56a2c0a87 --- /dev/null +++ b/core/node/libp2p/dns.go @@ -0,0 +1,11 @@ +package libp2p + +import ( + "github.com/libp2p/go-libp2p" + madns "github.com/multiformats/go-multiaddr-dns" +) + +func MultiaddrResolver(rslv *madns.Resolver) (opts Libp2pOpts, err error) { + opts.Opts = append(opts.Opts, libp2p.MultiaddrResolver(rslv)) + return opts, nil +} From aca3a201963bca90ab2802120738f779aabf26c4 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 12 Apr 2021 14:34:53 +0300 Subject: [PATCH 108/161] fix dns test --- cmd/ipfs/dnsresolve_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/ipfs/dnsresolve_test.go b/cmd/ipfs/dnsresolve_test.go index 7c0404523a9..fcba5d69702 100644 --- a/cmd/ipfs/dnsresolve_test.go +++ b/cmd/ipfs/dnsresolve_test.go @@ -72,4 +72,3 @@ func TestApiEndpointResolveDNSNoResults(t *testing.T) { t.Errorf("expected error not thrown; actual: %v", err) } } - From b6a1ba9617a1667df806e15fe7b809074c423f39 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 12 Apr 2021 14:01:27 +0300 Subject: [PATCH 109/161] create custom resolvers from config --- core/node/dns.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/node/dns.go b/core/node/dns.go index 72c89903c42..878ebc43d8d 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -1,11 +1,27 @@ package node import ( + "fmt" + "strings" + config "github.com/ipfs/go-ipfs-config" + doh "github.com/libp2p/go-doh-resolver" madns "github.com/multiformats/go-multiaddr-dns" ) func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { - // TODO custom resolvers from config - return madns.DefaultResolver, nil + var opts []madns.Option + if url := cfg.DNS.DefaultResolver; url != "" { + if !strings.HasPrefix(url, "https://") { + return nil, fmt.Errorf("invalid default resolver url: %s", url) + } + opts = append(opts, madns.WithDefaultResolver(doh.NewResolver(url))) + } + for domain, url := range cfg.DNS.CustomResolvers { + if !strings.HasPrefix(url, "https://") { + return nil, fmt.Errorf("invalid domain resolver url for %s: %s", domain, url) + } + opts = append(opts, madns.WithDomainResolver(domain, doh.NewResolver(url))) + } + return madns.NewResolver(opts...) } From 0ef2f8c9eac4b4f2716f4d4e3d10bbfeefdced5e Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 13 Apr 2021 17:48:20 +0300 Subject: [PATCH 110/161] update resolver config parsing, add eth. resolver by default --- core/node/dns.go | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/core/node/dns.go b/core/node/dns.go index 878ebc43d8d..50f0f609e67 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -7,21 +7,48 @@ import ( config "github.com/ipfs/go-ipfs-config" doh "github.com/libp2p/go-doh-resolver" madns "github.com/multiformats/go-multiaddr-dns" + + "github.com/miekg/dns" ) +const ethResolverURL = "https://eth.link/dns-query" + +func newResolver(url string) (madns.BasicResolver, error) { + if !strings.HasPrefix(url, "https://") { + return nil, fmt.Errorf("invalid resolver url: %s", url) + } + + return doh.NewResolver(url), nil +} + func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { var opts []madns.Option - if url := cfg.DNS.DefaultResolver; url != "" { - if !strings.HasPrefix(url, "https://") { - return nil, fmt.Errorf("invalid default resolver url: %s", url) + + hasEth := false + for domain, url := range cfg.DNS.Resolvers { + if !dns.IsFqdn(domain) { + return nil, fmt.Errorf("invalid domain %s; must be FQDN", domain) } - opts = append(opts, madns.WithDefaultResolver(doh.NewResolver(url))) - } - for domain, url := range cfg.DNS.CustomResolvers { - if !strings.HasPrefix(url, "https://") { - return nil, fmt.Errorf("invalid domain resolver url for %s: %s", domain, url) + + rslv, err := newResolver(url) + if err != nil { + return nil, fmt.Errorf("bad resolver for %s: %w", domain, err) + } + + if domain != "." { + opts = append(opts, madns.WithDomainResolver(domain, rslv)) + } else { + opts = append(opts, madns.WithDefaultResolver(rslv)) + } + + if domain == "eth." { + hasEth = true } - opts = append(opts, madns.WithDomainResolver(domain, doh.NewResolver(url))) } + + if !hasEth { + opts = append(opts, madns.WithDomainResolver("eth.", doh.NewResolver(ethResolverURL))) + } + return madns.NewResolver(opts...) } From 531e9c137d571699dd19f2ed3aed195f03c8d57b Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 13 Apr 2021 17:51:21 +0300 Subject: [PATCH 111/161] use NilDNSResolver for offline operation --- core/node/dns.go | 4 ++++ core/node/groups.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/node/dns.go b/core/node/dns.go index 50f0f609e67..b47e68a7e0f 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -52,3 +52,7 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { return madns.NewResolver(opts...) } + +func NilDNSResolver() (*madns.Resolver, error) { + return madns.NewResolver(madns.WithDefaultResolver(&madns.MockResolver{})) +} diff --git a/core/node/groups.go b/core/node/groups.go index 6863043396c..7ff0103ef7a 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -283,7 +283,7 @@ func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option { func Offline(cfg *config.Config) fx.Option { return fx.Options( fx.Provide(offline.Exchange), - fx.Provide(DNSResolver), + fx.Provide(NilDNSResolver), fx.Provide(Namesys(0)), fx.Provide(offroute.NewOfflineRouter), OfflineProviders(cfg.Experimental.StrategicProviding, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), From 5a1593e87cb0fd466f34605b08edeba55fb47df0 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 13 Apr 2021 18:06:02 +0300 Subject: [PATCH 112/161] update config documentation --- docs/config.md | 67 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/docs/config.md b/docs/config.md index ef1ff5477f2..a6ea0d549ea 100644 --- a/docs/config.md +++ b/docs/config.md @@ -79,7 +79,7 @@ documented in `ipfs config profile --help`. enabled block-level garbage collection), you plan on storing very little data in your IPFS node, and disk usage is more critical than performance, consider using flatfs. - - This datastore uses up to several gigabytes of memory. + - This datastore uses up to several gigabytes of memory. This profile may only be applied when first initializing the node. @@ -218,6 +218,8 @@ does (e.g, `"1d2h4m40.01s"`). - [`Swarm.Transports.Network.QUIC`](#swarmtransportsnetworkquic) - [`Swarm.Transports.Network.Websocket`](#swarmtransportsnetworkwebsocket) - [`Swarm.Transports.Network.Relay`](#swarmtransportsnetworkrelay) +- [`DNS`](#dns) + - [`DNS.Resolvers`](#dnsresolvers) ## `Addresses` @@ -608,7 +610,7 @@ Examples: Array of paths that should be exposed on the hostname. -Example: +Example: ```json { "Gateway": { @@ -692,7 +694,7 @@ If additional config is provided for those hostnames, it will be merged on top o } ``` -It is also possible to remove a default by setting it to `null`. +It is also possible to remove a default by setting it to `null`. For example, to disable subdomain gateway on `localhost` and make that hostname act the same as `127.0.0.1`: @@ -713,14 +715,14 @@ Below is a list of the most common public gateway setups. } }' ``` - **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains: - `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link` - **X-Forwarded-Proto:** if you run go-ipfs behind a reverse proxy that provides TLS, make it add a `X-Forwarded-Proto: https` HTTP header to ensure users are redirected to `https://`, not `http://`. It will also ensure DNSLink names are inlined to fit in a single DNS label, so they work fine with a wildcart TLS cert ([details](https://github.com/ipfs/in-web-browsers/issues/169)). The NGINX directive is `proxy_set_header X-Forwarded-Proto "https";`.: - `http://dweb.link/ipfs/{cid}` → `https://{cid}.ipfs.dweb.link` - `http://dweb.link/ipns/your-dnslink.site.example.com` → `https://your--dnslink-site-example-com.ipfs.dweb.link` + **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains: + `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link` + **X-Forwarded-Proto:** if you run go-ipfs behind a reverse proxy that provides TLS, make it add a `X-Forwarded-Proto: https` HTTP header to ensure users are redirected to `https://`, not `http://`. It will also ensure DNSLink names are inlined to fit in a single DNS label, so they work fine with a wildcart TLS cert ([details](https://github.com/ipfs/in-web-browsers/issues/169)). The NGINX directive is `proxy_set_header X-Forwarded-Proto "https";`.: + `http://dweb.link/ipfs/{cid}` → `https://{cid}.ipfs.dweb.link` + `http://dweb.link/ipns/your-dnslink.site.example.com` → `https://your--dnslink-site-example-com.ipfs.dweb.link` **X-Forwarded-Host:** we also support `X-Forwarded-Host: example.com` if you want to override subdomain gateway host from the original request: `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.example.com` - + * Public [path gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://ipfs.io/ipfs/{cid}` (no Origin separation) ```console @@ -738,7 +740,7 @@ Below is a list of the most common public gateway setups. ``` * Note that `NoDNSLink: false` is the default (it works out of the box unless set to `true` manually) -* Hardened, site-specific [DNSLink gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#dnslink-gateway). +* Hardened, site-specific [DNSLink gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#dnslink-gateway). Disable fetching of remote data (`NoFetch: true`) and resolving DNSLink at unknown hostnames (`NoDNSLink: true`). Then, enable DNSLink gateway only for the specific hostname (for which data @@ -898,7 +900,7 @@ Type: `bool` ###### `Pinning.RemoteServices: Policies.MFS.PinName` -Optional name to use for a remote pin that represents the MFS root CID. +Optional name to use for a remote pin that represents the MFS root CID. When left empty, a default name will be generated. Default: `"policy/{PeerID}/mfs"`, e.g. `"policy/12.../mfs"` @@ -907,7 +909,7 @@ Type: `string` ###### `Pinning.RemoteServices: Policies.MFS.RepinInterval` -Defines how often (at most) the pin request should be sent to the remote service. +Defines how often (at most) the pin request should be sent to the remote service. If left empty, the default interval will be used. Values lower than `1m` will be ignored. Default: `"5m"` @@ -927,7 +929,7 @@ Sets the default router used by pubsub to route messages to peers. This can be o connected peers. This router is extremely inefficient but _very_ reliable. * `"gossipsub"` - [gossipsub][] is a more advanced routing algorithm that will build an overlay mesh from a subset of the links in the network. - + Default: `"gossipsub"` Type: `string` (one of `"floodsub"`, `"gossipsub"`, or `""` (apply default)) @@ -1035,7 +1037,7 @@ Tells reprovider what should be announced. Valid strategies are: - "all" - announce all stored data - "pinned" - only announce pinned data - "roots" - only announce directly pinned keys and root keys of recursive pins - + Default: all Type: `string` (or unset for the default) @@ -1070,7 +1072,7 @@ public internet (e.g., it's not behind a firewall). To force a specific DHT mode, client or server, set `Routing.Type` to `dhtclient` or `dhtserver` respectively. Please do not set this to `dhtserver` unless you're sure your node is reachable from the public network. - + **Example:** ```json @@ -1079,8 +1081,8 @@ unless you're sure your node is reachable from the public network. "Type": "dhtclient" } } -``` - +``` + Default: dht Type: `string` (or unset for the default) @@ -1294,7 +1296,7 @@ Type: `flag` Listen Addresses: * /ip4/0.0.0.0/tcp/4001 (default) -* /ip6/::/tcp/4001 (default) +* /ip6/::/tcp/4001 (default) #### `Swarm.Transports.Network.Websocket` @@ -1423,3 +1425,32 @@ other IPFS and libp2p implementations. Unlike Yamux: Default: `200` Type: `priority` + +## `DNS` + +Options for configuring DNS resolution. + +## `DNS.Resolvers` + +Map of FQDNs to resolver URLs. + +This option allows you to specify domain-specific resolvers for custom DNS resolution. +Currently only https URLs are supported, using DNS over HTTPS. + +The default resolver can be overriden by specifying a URL for `.`. + +Example: +``` + "DNS": { + "Resolvers": { + "eth.": "https://different-ens.example.net/dns-query", + "crypto.": "https://unstoppablesomething.example.com/dns-query", + "libre.": "https://ns1.iriseden.fr/dns-query", + ".": "https://doh-ch.blahdns.com:4443/dns-query" + } + } +``` + +Default: `null` + +Type: `object[string -> string]` From b8eb1bbd5ba80a84a69f2c15ce58f21baa8da3af Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 13 Apr 2021 23:56:10 +0300 Subject: [PATCH 113/161] the dot is not really an FQDN --- core/node/dns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/node/dns.go b/core/node/dns.go index b47e68a7e0f..51fba7cb193 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -26,7 +26,7 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { hasEth := false for domain, url := range cfg.DNS.Resolvers { - if !dns.IsFqdn(domain) { + if domain != "." && !dns.IsFqdn(domain) { return nil, fmt.Errorf("invalid domain %s; must be FQDN", domain) } From 0a4defe87b52d7f88aa453286e4dad3c129981ca Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 13 Apr 2021 23:09:42 +0200 Subject: [PATCH 114/161] docs: fix formatting and add links to DNS section --- docs/config.md | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/docs/config.md b/docs/config.md index a6ea0d549ea..0c349f9070c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -695,6 +695,7 @@ If additional config is provided for those hostnames, it will be merged on top o ``` It is also possible to remove a default by setting it to `null`. + For example, to disable subdomain gateway on `localhost` and make that hostname act the same as `127.0.0.1`: @@ -715,13 +716,19 @@ Below is a list of the most common public gateway setups. } }' ``` - **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains: - `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link` - **X-Forwarded-Proto:** if you run go-ipfs behind a reverse proxy that provides TLS, make it add a `X-Forwarded-Proto: https` HTTP header to ensure users are redirected to `https://`, not `http://`. It will also ensure DNSLink names are inlined to fit in a single DNS label, so they work fine with a wildcart TLS cert ([details](https://github.com/ipfs/in-web-browsers/issues/169)). The NGINX directive is `proxy_set_header X-Forwarded-Proto "https";`.: - `http://dweb.link/ipfs/{cid}` → `https://{cid}.ipfs.dweb.link` - `http://dweb.link/ipns/your-dnslink.site.example.com` → `https://your--dnslink-site-example-com.ipfs.dweb.link` - **X-Forwarded-Host:** we also support `X-Forwarded-Host: example.com` if you want to override subdomain gateway host from the original request: - `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.example.com` + - **Backward-compatible:** this feature enables automatic redirects from content paths to subdomains: + + `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.dweb.link` + + - **X-Forwarded-Proto:** if you run go-ipfs behind a reverse proxy that provides TLS, make it add a `X-Forwarded-Proto: https` HTTP header to ensure users are redirected to `https://`, not `http://`. It will also ensure DNSLink names are inlined to fit in a single DNS label, so they work fine with a wildcart TLS cert ([details](https://github.com/ipfs/in-web-browsers/issues/169)). The NGINX directive is `proxy_set_header X-Forwarded-Proto "https";`.: + + `http://dweb.link/ipfs/{cid}` → `https://{cid}.ipfs.dweb.link` + + `http://dweb.link/ipns/your-dnslink.site.example.com` → `https://your--dnslink-site-example-com.ipfs.dweb.link` + + - **X-Forwarded-Host:** we also support `X-Forwarded-Host: example.com` if you want to override subdomain gateway host from the original request: + + `http://dweb.link/ipfs/{cid}` → `http://{cid}.ipfs.example.com` * Public [path gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://ipfs.io/ipfs/{cid}` (no Origin separation) @@ -741,12 +748,11 @@ Below is a list of the most common public gateway setups. * Note that `NoDNSLink: false` is the default (it works out of the box unless set to `true` manually) * Hardened, site-specific [DNSLink gateway](https://docs.ipfs.io/how-to/address-ipfs-on-web/#dnslink-gateway). - Disable fetching of remote data (`NoFetch: true`) - and resolving DNSLink at unknown hostnames (`NoDNSLink: true`). + + Disable fetching of remote data (`NoFetch: true`) and resolving DNSLink at unknown hostnames (`NoDNSLink: true`). Then, enable DNSLink gateway only for the specific hostname (for which data is already present on the node), without exposing any content-addressing `Paths`: - "NoFetch": true, - "NoDNSLink": true, + ```console $ ipfs config --json Gateway.NoFetch true $ ipfs config --json Gateway.NoDNSLink true @@ -1428,27 +1434,29 @@ Type: `priority` ## `DNS` -Options for configuring DNS resolution. +Options for configuring DNS resolution for [DNSLink](https://docs.ipfs.io/concepts/dnslink/) and `/dns*` [Multiaddrs](https://github.com/multiformats/multiaddr/). ## `DNS.Resolvers` -Map of FQDNs to resolver URLs. +Map of [FQDNs](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) to custom resolver URLs. -This option allows you to specify domain-specific resolvers for custom DNS resolution. -Currently only https URLs are supported, using DNS over HTTPS. - -The default resolver can be overriden by specifying a URL for `.`. +- This allows for overriding the default cleartext DNS resolver provided by the operating system, + and using different resolvers per domain or TLD (including ones from alternative, non-ICANN naming systems). +- Currently only `https://` URLs for [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS) endpoints are supported. +- The default resolver can be overriden by adding an entry for the DNS root indicated by `.` Example: -``` +```json +{ "DNS": { "Resolvers": { "eth.": "https://different-ens.example.net/dns-query", - "crypto.": "https://unstoppablesomething.example.com/dns-query", + "crypto.": "https://resolver.unstoppable.io/dns-query", "libre.": "https://ns1.iriseden.fr/dns-query", ".": "https://doh-ch.blahdns.com:4443/dns-query" } } +} ``` Default: `null` From 77d6a08598180b8a4d546f2338809a3c3ebde214 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 14 Apr 2021 10:01:20 +0300 Subject: [PATCH 115/161] better handling of implicit defaults, reuse resolver object for the same URL --- core/node/dns.go | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/core/node/dns.go b/core/node/dns.go index 51fba7cb193..39b870e704e 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -11,7 +11,10 @@ import ( "github.com/miekg/dns" ) -const ethResolverURL = "https://eth.link/dns-query" +var defaultResolvers = map[string]string{ + "eth.": "https://resolver.cloudflare-eth.com/dns-query", + "crypto.": "https://resolver.cloudflare-eth.com/dns-query", +} func newResolver(url string) (madns.BasicResolver, error) { if !strings.HasPrefix(url, "https://") { @@ -23,16 +26,23 @@ func newResolver(url string) (madns.BasicResolver, error) { func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { var opts []madns.Option + var err error + + domains := make(map[string]struct{}) // to track overriden default resolvers + rslvrs := make(map[string]madns.BasicResolver) // to reuse resolvers for the same URL - hasEth := false for domain, url := range cfg.DNS.Resolvers { if domain != "." && !dns.IsFqdn(domain) { return nil, fmt.Errorf("invalid domain %s; must be FQDN", domain) } - rslv, err := newResolver(url) - if err != nil { - return nil, fmt.Errorf("bad resolver for %s: %w", domain, err) + rslv, ok := rslvrs[url] + if !ok { + rslv, err = newResolver(url) + if err != nil { + return nil, fmt.Errorf("bad resolver for %s: %w", domain, err) + } + rslvrs[url] = rslv } if domain != "." { @@ -41,13 +51,26 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { opts = append(opts, madns.WithDefaultResolver(rslv)) } - if domain == "eth." { - hasEth = true - } + domains[domain] = struct{}{} } - if !hasEth { - opts = append(opts, madns.WithDomainResolver("eth.", doh.NewResolver(ethResolverURL))) + // fill in defaults if not overriden by the user + for domain, url := range defaultResolvers { + _, ok := domains[domain] + if ok { + continue + } + + rslv, ok := rslvrs[url] + if !ok { + rslv, err = newResolver(url) + if err != nil { + return nil, fmt.Errorf("bad resolver for %s: %w", domain, err) + } + rslvrs[url] = rslv + } + + opts = append(opts, madns.WithDomainResolver(domain, rslv)) } return madns.NewResolver(opts...) From 9866c13bdad67e1033f80765f9bb0e874352fb68 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 14 Apr 2021 10:03:28 +0300 Subject: [PATCH 116/161] use {} as default for DNS.Resolvers in config --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index 0c349f9070c..dc30d88e2e3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1459,6 +1459,6 @@ Example: } ``` -Default: `null` +Default: `{}` Type: `object[string -> string]` From 35fe392491558bf661153778e47615cb24f27331 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 14 Apr 2021 16:45:32 +0200 Subject: [PATCH 117/161] docs: clarify DNS.Resolvers - document implicit defaults for eth and crypto TLDs - be very honest and link to ToS of cloudflare-eth.com - provide suggestion that one should run own resolver if they really care about decentralization --- docs/config.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/config.md b/docs/config.md index dc30d88e2e3..e41c8b1414c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1440,17 +1440,15 @@ Options for configuring DNS resolution for [DNSLink](https://docs.ipfs.io/concep Map of [FQDNs](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) to custom resolver URLs. -- This allows for overriding the default cleartext DNS resolver provided by the operating system, - and using different resolvers per domain or TLD (including ones from alternative, non-ICANN naming systems). -- Currently only `https://` URLs for [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS) endpoints are supported. -- The default resolver can be overriden by adding an entry for the DNS root indicated by `.` +This allows for overriding the default DNS resolver provided by the operating system, +and using different resolvers per domain or TLD (including ones from alternative, non-ICANN naming systems). Example: ```json { "DNS": { "Resolvers": { - "eth.": "https://different-ens.example.net/dns-query", + "eth.": "https://eth.link/dns-query", "crypto.": "https://resolver.unstoppable.io/dns-query", "libre.": "https://ns1.iriseden.fr/dns-query", ".": "https://doh-ch.blahdns.com:4443/dns-query" @@ -1459,6 +1457,18 @@ Example: } ``` +Be mindful that: +- Currently only `https://` URLs for [DNS over HTTPS (DoH)](https://en.wikipedia.org/wiki/DNS_over_HTTPS) endpoints are supported as values. +- The default catch-all resolver is the cleartext one provided by your operating system. It can be overriden by adding a DoH entry for the DNS root indicated by `.` as illustrated above. +- Out-of-the-box support for selected decentralized TLDs relies on a [centralized service which is provided on best-effort basis](https://www.cloudflare.com/distributed-web-gateway-terms/). The implicit DoH resolvers are: + ```json + { + "eth.": "https://resolver.cloudflare-eth.com/dns-query", + "crypto.": "https://resolver.cloudflare-eth.com/dns-query + } + ``` + To get all the benefits of a decentralized naming system we strongly suggest setting DoH endpoint to an empty string and running own decentralized resolver as catch-all one on localhost. + Default: `{}` Type: `object[string -> string]` From 0b4037c7cd2766fbd39ab2e34dcf5d89c3401908 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 14 Apr 2021 19:03:59 +0300 Subject: [PATCH 118/161] allow overriding implicit defaults with the default resolver License: MIT Signed-off-by: vyzo --- core/node/dns.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/node/dns.go b/core/node/dns.go index 39b870e704e..408f08a4c1c 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -36,6 +36,12 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { return nil, fmt.Errorf("invalid domain %s; must be FQDN", domain) } + domains[domain] = struct{}{} + if url == "" { + // allow overriding of implicit defaults with the default resolver + continue + } + rslv, ok := rslvrs[url] if !ok { rslv, err = newResolver(url) @@ -50,8 +56,6 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { } else { opts = append(opts, madns.WithDefaultResolver(rslv)) } - - domains[domain] = struct{}{} } // fill in defaults if not overriden by the user From eb7456d38fb6455d31a239c2558bfc73af094e57 Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 16 Apr 2021 01:05:35 +0300 Subject: [PATCH 119/161] update for the new namesys api --- core/coreapi/coreapi.go | 10 +++++++++- core/coreapi/name.go | 8 ++++++-- core/node/ipns.go | 11 ++++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 309f4863c62..f8c165a0cd3 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -215,7 +215,15 @@ func (api *CoreAPI) WithOptions(opts ...options.ApiOption) (coreiface.CoreAPI, e } subApi.routing = offlineroute.NewOfflineRouter(subApi.repo.Datastore(), subApi.recordValidator) - subApi.namesys = namesys.NewNameSystem(subApi.routing, subApi.repo.Datastore(), subApi.dnsResolver, cs) + + subApi.namesys, err = namesys.NewNameSystem(subApi.routing, + namesys.WithDatastore(subApi.repo.Datastore()), + namesys.WithDNSResolver(subApi.dnsResolver), + namesys.WithCache(cs)) + if err != nil { + return nil, fmt.Errorf("error constructing namesys: %w", err) + } + subApi.provider = provider.NewOfflineProvider() subApi.peerstore = nil diff --git a/core/coreapi/name.go b/core/coreapi/name.go index 213e7f6afa3..b007ccd7d5c 100644 --- a/core/coreapi/name.go +++ b/core/coreapi/name.go @@ -93,9 +93,13 @@ func (api *NameAPI) Search(ctx context.Context, name string, opts ...caopts.Name } var resolver namesys.Resolver = api.namesys - if !options.Cache { - resolver = namesys.NewNameSystem(api.routing, api.repo.Datastore(), api.dnsResolver, 0) + resolver, err = namesys.NewNameSystem(api.routing, + namesys.WithDatastore(api.repo.Datastore()), + namesys.WithDNSResolver(api.dnsResolver)) + if err != nil { + return nil, err + } } if !strings.HasPrefix(name, "/ipns/") { diff --git a/core/node/ipns.go b/core/node/ipns.go index 98f2de79cd5..a178ee3321e 100644 --- a/core/node/ipns.go +++ b/core/node/ipns.go @@ -30,7 +30,16 @@ func RecordValidator(ps peerstore.Peerstore) record.Validator { // Namesys creates new name system func Namesys(cacheSize int) func(rt routing.Routing, rslv *madns.Resolver, repo repo.Repo) (namesys.NameSystem, error) { return func(rt routing.Routing, rslv *madns.Resolver, repo repo.Repo) (namesys.NameSystem, error) { - return namesys.NewNameSystem(rt, repo.Datastore(), rslv, cacheSize), nil + opts := []namesys.Option{ + namesys.WithDatastore(repo.Datastore()), + namesys.WithDNSResolver(rslv), + } + + if cacheSize > 0 { + opts = append(opts, namesys.WithCache(cacheSize)) + } + + return namesys.NewNameSystem(rt, opts...) } } From 664c66c3f374706dc05c90590c960df4ad994535 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 20 Apr 2021 08:57:20 +0300 Subject: [PATCH 120/161] undo dns neutering from offline mode --- core/node/dns.go | 4 ---- core/node/groups.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/core/node/dns.go b/core/node/dns.go index 408f08a4c1c..1aafbf107a4 100644 --- a/core/node/dns.go +++ b/core/node/dns.go @@ -79,7 +79,3 @@ func DNSResolver(cfg *config.Config) (*madns.Resolver, error) { return madns.NewResolver(opts...) } - -func NilDNSResolver() (*madns.Resolver, error) { - return madns.NewResolver(madns.WithDefaultResolver(&madns.MockResolver{})) -} diff --git a/core/node/groups.go b/core/node/groups.go index 7ff0103ef7a..6863043396c 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -283,7 +283,7 @@ func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option { func Offline(cfg *config.Config) fx.Option { return fx.Options( fx.Provide(offline.Exchange), - fx.Provide(NilDNSResolver), + fx.Provide(DNSResolver), fx.Provide(Namesys(0)), fx.Provide(offroute.NewOfflineRouter), OfflineProviders(cfg.Experimental.StrategicProviding, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), From 75e0141ad11bdb22160dbb30e6814495c9c66cdc Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 10 May 2021 21:08:42 -0700 Subject: [PATCH 121/161] chore: update deps --- go.mod | 6 ++++-- go.sum | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9f122f6f208..14310541058 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 - github.com/ipfs/go-ipfs-config v0.12.1-0.20210415091656-d75a8c68b4c4 + github.com/ipfs/go-ipfs-config v0.13.0 github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-offline v0.0.1 github.com/ipfs/go-ipfs-files v0.0.8 @@ -48,7 +48,7 @@ require ( github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 github.com/ipfs/go-mfs v0.1.2 - github.com/ipfs/go-namesys v0.1.2-0.20210423173001-2454122ef30e + github.com/ipfs/go-namesys v0.2.0 github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 github.com/ipfs/go-unixfs v0.2.5 @@ -59,6 +59,7 @@ require ( github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/jbenet/goprocess v0.1.4 + github.com/libp2p/go-doh-resolver v0.3.0 github.com/libp2p/go-libp2p v0.14.0 github.com/libp2p/go-libp2p-circuit v0.4.0 github.com/libp2p/go-libp2p-connmgr v0.2.4 @@ -84,6 +85,7 @@ require ( github.com/libp2p/go-tcp-transport v0.2.1 github.com/libp2p/go-ws-transport v0.4.0 github.com/lucas-clemente/quic-go v0.19.3 + github.com/miekg/dns v1.1.41 github.com/mitchellh/go-homedir v1.1.0 github.com/multiformats/go-multiaddr v0.3.1 github.com/multiformats/go-multiaddr-dns v0.3.1 diff --git a/go.sum b/go.sum index db8bf067137..6b1ebc171f5 100644 --- a/go.sum +++ b/go.sum @@ -408,8 +408,8 @@ github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7Na github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw= github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= -github.com/ipfs/go-ipfs-config v0.12.1-0.20210415091656-d75a8c68b4c4 h1:3Hoy9E3cnxCbeGNs3+PilCyhoZMlW9aekheyT0xWBys= -github.com/ipfs/go-ipfs-config v0.12.1-0.20210415091656-d75a8c68b4c4/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= +github.com/ipfs/go-ipfs-config v0.13.0 h1:ZH3dTmkVR9TTFBIbfWnFNC1JdwHbj8F0ryiaIFo7U/o= +github.com/ipfs/go-ipfs-config v0.13.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -480,8 +480,8 @@ github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZa github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= -github.com/ipfs/go-namesys v0.1.2-0.20210423173001-2454122ef30e h1:yBTC5lwYjUGrfk8mNdcqUV1ewbmrWFf2ksskqOhl2pY= -github.com/ipfs/go-namesys v0.1.2-0.20210423173001-2454122ef30e/go.mod h1:j1ttlrLy7/NhtwrXOqwMty749Fe3yEKt2yaYR3XJQPE= +github.com/ipfs/go-namesys v0.2.0 h1:QoxOsYl5sufEqE/kP7v6b9IbOTxM4LO88GGmiXWPekI= +github.com/ipfs/go-namesys v0.2.0/go.mod h1:j1ttlrLy7/NhtwrXOqwMty749Fe3yEKt2yaYR3XJQPE= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= @@ -581,6 +581,8 @@ github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDa github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= +github.com/libp2p/go-doh-resolver v0.3.0 h1:YePXUmvjyFT7NsqgnEkhEi5d/Nqab97QZf7BPNUWSqo= +github.com/libp2p/go-doh-resolver v0.3.0/go.mod h1:y5go1ZppAq9N2eppbX0xON01CyPBeUg2yS6BTssssog= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= @@ -944,6 +946,7 @@ github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWz github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= +github.com/multiformats/go-multiaddr-dns v0.3.0/go.mod h1:mNzQ4eTGDg0ll1N9jKPOUogZPoJ30W8a7zk66FQPpdQ= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= From 3b254a631f57d6290ab8179c0cacd72f24ca7dea Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 10 May 2021 21:34:49 -0700 Subject: [PATCH 122/161] test(sharness): fix test for updated address filters --- test/sharness/t0020-init.sh | 2 +- test/sharness/t0021-config.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 2cabe3d8f75..55ae34eadb9 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -202,7 +202,7 @@ test_expect_success "'ipfs init --profile' succeeds" ' test_expect_success "'ipfs config Swarm.AddrFilters' looks good" ' ipfs config Swarm.AddrFilters > actual_config && - test $(cat actual_config | wc -l) = 22 + test $(cat actual_config | wc -l) = 18 ' test_expect_success "clean up ipfs dir" ' diff --git a/test/sharness/t0021-config.sh b/test/sharness/t0021-config.sh index c417ba4de57..ee0e81988dd 100755 --- a/test/sharness/t0021-config.sh +++ b/test/sharness/t0021-config.sh @@ -209,7 +209,7 @@ test_config_cmd() { test_expect_success "'ipfs config Swarm.AddrFilters' looks good with server profile" ' ipfs config Swarm.AddrFilters > actual_config && - test $(cat actual_config | wc -l) = 22 + test $(cat actual_config | wc -l) = 18 ' test_expect_success "'ipfs config profile apply local-discovery' works" ' From 48bc5735fcd0477970644dcd3fbec2487816e71a Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 11 May 2021 18:07:32 +0200 Subject: [PATCH 123/161] test: confirm /api/v0/key/export is HTTP 404 This ensures key export endpoint is never exposed over HTTP API --- test/sharness/t0165-keystore.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/sharness/t0165-keystore.sh b/test/sharness/t0165-keystore.sh index 0bd8f74e69c..4a4378692f0 100755 --- a/test/sharness/t0165-keystore.sh +++ b/test/sharness/t0165-keystore.sh @@ -175,6 +175,7 @@ ipfs key rm key_ed25519 test_cmp rsa_key_id roundtrip_rsa_key_id ' + # export works directly on the keystore present in IPFS_PATH test_expect_success "export and import ed25519 key while daemon is running" ' edhash=$(ipfs key gen exported_ed25519_key --type=ed25519) echo $edhash > ed25519_key_id @@ -184,10 +185,15 @@ ipfs key rm key_ed25519 test_cmp ed25519_key_id roundtrip_ed25519_key_id ' + test_expect_success "key export over HTTP /api/v0/key/export is not possible" ' + ipfs key gen nohttpexporttest_key --type=ed25519 && + test_curl_resp_http_code "http://127.0.0.1:$API_PORT/api/v0/key/export&arg=nohttpexporttest_key" "HTTP/1.1 404 Not Found" + ' + test_expect_success "online rotate rsa key" ' test_must_fail ipfs key rotate ' - + test_kill_ipfs_daemon } From 6b63de8a5ad6b9063bd1b65a41f355543ead0511 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 11 May 2021 19:39:47 +0200 Subject: [PATCH 124/161] fix: check repo version before key export https://github.com/ipfs/go-ipfs/pull/8113#discussion_r628314443 --- core/commands/keystore.go | 10 ++++++++++ test/sharness/t0165-keystore.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 8a806113c0f..56e7de18319 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -18,6 +18,7 @@ import ( "github.com/ipfs/go-ipfs/core/commands/e" ke "github.com/ipfs/go-ipfs/core/commands/keyencode" fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo" + migrations "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" options "github.com/ipfs/interface-go-ipfs-core/options" "github.com/libp2p/go-libp2p-core/crypto" peer "github.com/libp2p/go-libp2p-core/peer" @@ -163,6 +164,15 @@ path can be specified with '--output=' or '-o='. return err } + // Check repo version, and error out if not matching + ver, err := migrations.RepoVersion(cfgRoot) + if err != nil { + return err + } + if ver > fsrepo.RepoVersion { + return fmt.Errorf("key export expects repo version (%d) but found (%d)", fsrepo.RepoVersion, ver) + } + // Export is read-only: safe to read it without acquiring repo lock // (this makes export work when ipfs daemon is already running) ksp := filepath.Join(cfgRoot, "keystore") diff --git a/test/sharness/t0165-keystore.sh b/test/sharness/t0165-keystore.sh index 4a4378692f0..ad4b6a6c7c7 100755 --- a/test/sharness/t0165-keystore.sh +++ b/test/sharness/t0165-keystore.sh @@ -187,7 +187,7 @@ ipfs key rm key_ed25519 test_expect_success "key export over HTTP /api/v0/key/export is not possible" ' ipfs key gen nohttpexporttest_key --type=ed25519 && - test_curl_resp_http_code "http://127.0.0.1:$API_PORT/api/v0/key/export&arg=nohttpexporttest_key" "HTTP/1.1 404 Not Found" + curl -X POST -sI "http://$API_ADDR/api/v0/key/export&arg=nohttpexporttest_key" | grep -q "^HTTP/1.1 404 Not Found" ' test_expect_success "online rotate rsa key" ' From 1d77f9d33d65b7948dbac79abc4776661345d6e1 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 11 May 2021 20:11:12 +0200 Subject: [PATCH 125/161] refactor: key export requires exact repo ver --- core/commands/keystore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 56e7de18319..bd3146ca57c 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -169,7 +169,7 @@ path can be specified with '--output=' or '-o='. if err != nil { return err } - if ver > fsrepo.RepoVersion { + if ver != fsrepo.RepoVersion { return fmt.Errorf("key export expects repo version (%d) but found (%d)", fsrepo.RepoVersion, ver) } From c54cdaa1f87507ba1048c8d450dc43e6db6eb1d7 Mon Sep 17 00:00:00 2001 From: Andrew Gillis Date: Wed, 12 May 2021 09:33:14 -0700 Subject: [PATCH 126/161] Feat/migration ipfs download (#8064) * Enable downloading migrations over IPFS There are now options in the config file that control how migrations are downloaded. This includes enabling downloading migrations using IPFS by (when migrations are required) spinning up a temporary node for fetching the migrations before running them. There is also a config option to decide what to do with the migrations binaries once they are downloaded (e.g. cache or pin them in your node, or just throw out the data). Co-authored-by: Steven Allen --- cmd/ipfs/daemon.go | 58 +++- cmd/ipfs/migration.go | 300 +++++++++++++++++ cmd/ipfs/migration_test.go | 312 ++++++++++++++++++ docs/config.md | 19 ++ go.mod | 4 +- go.sum | 6 +- repo/fsrepo/fsrepo.go | 2 +- repo/fsrepo/migrations/fetch.go | 31 +- repo/fsrepo/migrations/fetch_test.go | 10 +- repo/fsrepo/migrations/fetcher.go | 33 +- repo/fsrepo/migrations/httpfetcher.go | 8 +- .../migrations/ipfsfetcher/ipfsfetcher.go | 279 ++++++++++++++++ .../ipfsfetcher/ipfsfetcher_test.go | 144 ++++++++ repo/fsrepo/migrations/migrations.go | 3 +- repo/fsrepo/migrations/migrations_test.go | 3 +- repo/fsrepo/migrations/unpack.go | 1 - 16 files changed, 1186 insertions(+), 27 deletions(-) create mode 100644 cmd/ipfs/migration.go create mode 100644 cmd/ipfs/migration_test.go create mode 100644 repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go create mode 100644 repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher_test.go diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index e0f3f0e2980..d8461c9a8ab 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -4,6 +4,7 @@ import ( "errors" _ "expvar" "fmt" + "io/ioutil" "net" "net/http" _ "net/http/pprof" @@ -268,6 +269,9 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment } } + var cacheMigrations, pinMigrations bool + var fetcher migrations.Fetcher + // acquire the repo lock _before_ constructing a node. we need to make // sure we are permitted to access the resources (datastore, etc.) repo, err := fsrepo.Open(cctx.ConfigRoot) @@ -288,8 +292,38 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment return fmt.Errorf("fs-repo requires migration") } - // Fetch migrations from current distribution, or location from environ - fetcher := migrations.NewHttpFetcher(migrations.GetDistPathEnv(migrations.CurrentIpfsDist), "", "go-ipfs", 0) + migrationCfg, err := readMigrationConfig(cctx.ConfigRoot) + if err != nil { + return err + } + + fetcher, err = getMigrationFetcher(migrationCfg, &cctx.ConfigRoot) + if err != nil { + return err + } + defer fetcher.Close() + + if migrationCfg.Keep == "cache" { + cacheMigrations = true + } else if migrationCfg.Keep == "pin" { + pinMigrations = true + } + + if cacheMigrations || pinMigrations { + // Create temp directory to store downloaded migration archives + migrations.DownloadDirectory, err = ioutil.TempDir("", "migrations") + if err != nil { + return err + } + // Defer cleanup of download directory so that it gets cleaned up + // if daemon returns early due to error + defer func() { + if migrations.DownloadDirectory != "" { + os.RemoveAll(migrations.DownloadDirectory) + } + }() + } + err = migrations.RunMigration(cctx.Context(), fetcher, fsrepo.RepoVersion, "", false) if err != nil { fmt.Println("The migrations of fs-repo failed:") @@ -420,6 +454,26 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment return err } + // Add any files downloaded by migration. + if cacheMigrations || pinMigrations { + err = addMigrations(cctx.Context(), node, fetcher, pinMigrations) + if err != nil { + fmt.Fprintln(os.Stderr, "Could not add migragion to IPFS:", err) + } + // Remove download directory so that it does not remain for lifetime of + // daemon or get left behind if daemon has a hard exit + os.RemoveAll(migrations.DownloadDirectory) + migrations.DownloadDirectory = "" + } + if fetcher != nil { + // If there is an error closing the IpfsFetcher, then print error, but + // do not fail because of it. + err = fetcher.Close() + if err != nil { + log.Errorf("error closing IPFS fetcher: %s", err) + } + } + // construct http gateway gwErrc, err := serveHTTPGateway(req, cctx) if err != nil { diff --git a/cmd/ipfs/migration.go b/cmd/ipfs/migration.go new file mode 100644 index 00000000000..d4e3e15b9d0 --- /dev/null +++ b/cmd/ipfs/migration.go @@ -0,0 +1,300 @@ +package main + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "net/url" + "os" + "path/filepath" + "strings" + + config "github.com/ipfs/go-ipfs-config" + "github.com/ipfs/go-ipfs-files" + "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/core/coreapi" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations/ipfsfetcher" + coreiface "github.com/ipfs/interface-go-ipfs-core" + "github.com/ipfs/interface-go-ipfs-core/options" + ipath "github.com/ipfs/interface-go-ipfs-core/path" + "github.com/libp2p/go-libp2p-core/peer" +) + +// readMigrationConfig reads the migration config out of the config, avoiding +// reading anything other than the migration section. That way, we're free to +// make arbitrary changes to all _other_ sections in migrations. +func readMigrationConfig(repoRoot string) (*config.Migration, error) { + var cfg struct { + Migration config.Migration + } + + cfgPath, err := config.Filename(repoRoot) + if err != nil { + return nil, err + } + + cfgFile, err := os.Open(cfgPath) + if err != nil { + return nil, err + } + defer cfgFile.Close() + + err = json.NewDecoder(cfgFile).Decode(&cfg) + if err != nil { + return nil, err + } + + switch cfg.Migration.Keep { + case "": + cfg.Migration.Keep = config.DefaultMigrationKeep + case "discard", "cache", "keep": + default: + return nil, errors.New("unknown config value, Migrations.Keep must be 'cache', 'pin', or 'discard'") + } + + if len(cfg.Migration.DownloadSources) == 0 { + cfg.Migration.DownloadSources = config.DefaultMigrationDownloadSources + } + + return &cfg.Migration, nil +} + +func readIpfsConfig(repoRoot *string) (bootstrap []string, peers []peer.AddrInfo) { + if repoRoot == nil { + return + } + + cfgPath, err := config.Filename(*repoRoot) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + + cfgFile, err := os.Open(cfgPath) + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + defer cfgFile.Close() + + // Attempt to read bootstrap addresses + var bootstrapCfg struct { + Bootstrap []string + } + err = json.NewDecoder(cfgFile).Decode(&bootstrapCfg) + if err != nil { + fmt.Fprintln(os.Stderr, "cannot read bootstrap peers from config") + } else { + bootstrap = bootstrapCfg.Bootstrap + } + + if _, err = cfgFile.Seek(0, 0); err != nil { + fmt.Fprintln(os.Stderr, err) + } + + // Attempt to read peers + var peeringCfg struct { + Peering config.Peering + } + err = json.NewDecoder(cfgFile).Decode(&peeringCfg) + if err != nil { + fmt.Fprintln(os.Stderr, "cannot read peering from config") + } else { + peers = peeringCfg.Peering.Peers + } + + return +} + +// getMigrationFetcher creates one or more fetchers according to +// config.Migration.DownloadSources. If an IpfsFetcher is required, then +// bootstrap and peer information in read from the config file in repoRoot, +// unless repoRoot is nil. +func getMigrationFetcher(cfg *config.Migration, repoRoot *string) (migrations.Fetcher, error) { + const httpUserAgent = "go-ipfs" + + // Fetch migrations from current distribution, or location from environ + fetchDistPath := migrations.GetDistPathEnv(migrations.CurrentIpfsDist) + + var fetchers []migrations.Fetcher + for _, src := range cfg.DownloadSources { + src := strings.TrimSpace(src) + switch src { + case "IPFS", "ipfs": + bootstrap, peers := readIpfsConfig(repoRoot) + fetchers = append(fetchers, ipfsfetcher.NewIpfsFetcher(fetchDistPath, 0, bootstrap, peers)) + case "HTTPS", "https", "HTTP", "http": + fetchers = append(fetchers, migrations.NewHttpFetcher(fetchDistPath, "", httpUserAgent, 0)) + default: + u, err := url.Parse(src) + if err != nil { + return nil, fmt.Errorf("bad gateway address: %s", err) + } + switch u.Scheme { + case "": + u.Scheme = "https" + case "https", "http": + default: + return nil, errors.New("bad gateway address: url scheme must be http or https") + } + fetchers = append(fetchers, migrations.NewHttpFetcher(fetchDistPath, u.String(), httpUserAgent, 0)) + case "": + // Ignore empty string + } + } + if len(fetchers) == 0 { + return nil, errors.New("no sources specified") + } + + if len(fetchers) == 1 { + return fetchers[0], nil + } + + // Wrap fetchers in a MultiFetcher to try them in order + return migrations.NewMultiFetcher(fetchers...), nil +} + +func addMigrations(ctx context.Context, node *core.IpfsNode, fetcher migrations.Fetcher, pin bool) error { + var fetchers []migrations.Fetcher + if mf, ok := fetcher.(*migrations.MultiFetcher); ok { + fetchers = mf.Fetchers() + } else { + fetchers = []migrations.Fetcher{fetcher} + } + + for _, fetcher := range fetchers { + switch f := fetcher.(type) { + case *ipfsfetcher.IpfsFetcher: + // Add migrations by connecting to temp node and getting from IPFS + err := addMigrationPaths(ctx, node, f.AddrInfo(), f.FetchedPaths(), pin) + if err != nil { + return err + } + case *migrations.HttpFetcher: + // Add the downloaded migration files directly + if migrations.DownloadDirectory != "" { + var paths []string + err := filepath.Walk(migrations.DownloadDirectory, func(filePath string, info os.FileInfo, err error) error { + if info.IsDir() { + return nil + } + paths = append(paths, filePath) + return nil + }) + if err != nil { + return err + } + err = addMigrationFiles(ctx, node, paths, pin) + if err != nil { + return err + } + } + default: + return errors.New("Cannot get migrations from unknown fetcher type") + } + } + + return nil +} + +// addMigrationFiles adds the files at paths to IPFS, optionally pinning them +func addMigrationFiles(ctx context.Context, node *core.IpfsNode, paths []string, pin bool) error { + if len(paths) == 0 { + return nil + } + ifaceCore, err := coreapi.NewCoreAPI(node) + if err != nil { + return err + } + ufs := ifaceCore.Unixfs() + + // Add migration files + for _, filePath := range paths { + f, err := os.Open(filePath) + if err != nil { + return err + } + + fi, err := f.Stat() + if err != nil { + return err + } + + ipfsPath, err := ufs.Add(ctx, files.NewReaderStatFile(f, fi), options.Unixfs.Pin(pin)) + if err != nil { + return err + } + fmt.Printf("Added migration file %q: %s\n", filepath.Base(filePath), ipfsPath) + } + + return nil +} + +// addMigrationPaths adds the files at paths to IPFS, optionally pinning +// them. This is done after connecting to the peer. +func addMigrationPaths(ctx context.Context, node *core.IpfsNode, peerInfo peer.AddrInfo, paths []ipath.Path, pin bool) error { + if len(paths) == 0 { + return errors.New("nothing downloaded by ipfs fetcher") + } + if len(peerInfo.Addrs) == 0 { + return errors.New("no local swarm address for migration node") + } + + ipfs, err := coreapi.NewCoreAPI(node) + if err != nil { + return err + } + + // Connect to temp node + if err := ipfs.Swarm().Connect(ctx, peerInfo); err != nil { + return fmt.Errorf("could not connect to migration peer %q: %s", peerInfo.ID, err) + } + fmt.Printf("connected to migration peer %q\n", peerInfo) + + if pin { + pinApi := ipfs.Pin() + for _, ipfsPath := range paths { + err := pinApi.Add(ctx, ipfsPath) + if err != nil { + return err + } + fmt.Printf("Added and pinned migration file: %q\n", ipfsPath) + } + return nil + } + + ufs := ipfs.Unixfs() + + // Add migration files + for _, ipfsPath := range paths { + err = ipfsGet(ctx, ufs, ipfsPath) + if err != nil { + return err + } + } + + return nil +} + +func ipfsGet(ctx context.Context, ufs coreiface.UnixfsAPI, ipfsPath ipath.Path) error { + nd, err := ufs.Get(ctx, ipfsPath) + if err != nil { + return err + } + defer nd.Close() + + fnd, ok := nd.(files.File) + if !ok { + return fmt.Errorf("not a file node: %q", ipfsPath) + } + _, err = io.Copy(ioutil.Discard, fnd) + if err != nil { + return fmt.Errorf("cannot read migration: %w", err) + } + fmt.Printf("Added migration file: %q\n", ipfsPath) + return nil +} diff --git a/cmd/ipfs/migration_test.go b/cmd/ipfs/migration_test.go new file mode 100644 index 00000000000..da35bf3029c --- /dev/null +++ b/cmd/ipfs/migration_test.go @@ -0,0 +1,312 @@ +package main + +import ( + "io/ioutil" + "os" + "path/filepath" + "strings" + "testing" + + config "github.com/ipfs/go-ipfs-config" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations/ipfsfetcher" +) + +var testConfig = ` +{ + "Bootstrap": [ + "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", + "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" + ], + "Migration": { + "DownloadSources": ["IPFS", "HTTP", "127.0.0.1", "https://127.0.1.1"], + "Keep": "cache" + }, + "Peering": { + "Peers": [ + { + "ID": "12D3KooWGC6TvWhfapngX6wvJHMYvKpDMXPb3ZnCZ6dMoaMtimQ5", + "Addrs": ["/ip4/127.0.0.1/tcp/4001", "/ip4/127.0.0.1/udp/4001/quic"] + } + ] + } +} +` + +func TestReadMigrationConfigDefaults(t *testing.T) { + tmpDir := makeConfig("{}") + defer os.RemoveAll(tmpDir) + + cfg, err := readMigrationConfig(tmpDir) + if err != nil { + t.Fatal(err) + } + + if cfg.Keep != config.DefaultMigrationKeep { + t.Error("expected default value for Keep") + } + + if len(cfg.DownloadSources) != len(config.DefaultMigrationDownloadSources) { + t.Fatal("expected default number of download sources") + } + for i, src := range config.DefaultMigrationDownloadSources { + if cfg.DownloadSources[i] != src { + t.Errorf("wrong DownloadSource: %s", cfg.DownloadSources[i]) + } + } +} + +func TestReadMigrationConfigErrors(t *testing.T) { + tmpDir := makeConfig(`{"Migration": {"Keep": "badvalue"}}`) + defer os.RemoveAll(tmpDir) + + _, err := readMigrationConfig(tmpDir) + if err == nil { + t.Fatal("expected error") + } + if !strings.HasPrefix(err.Error(), "unknown") { + t.Fatal("did not get expected error:", err) + } + + os.RemoveAll(tmpDir) + _, err = readMigrationConfig(tmpDir) + if err == nil { + t.Fatal("expected error") + } + + bootstrap, peers := readIpfsConfig(&tmpDir) + if bootstrap != nil { + t.Error("expected nil bootstrap") + } + if peers != nil { + t.Error("expected nil peers") + } + + tmpDir = makeConfig(`}{`) + defer os.RemoveAll(tmpDir) + _, err = readMigrationConfig(tmpDir) + if err == nil { + t.Fatal("expected error") + } +} + +func TestReadMigrationConfig(t *testing.T) { + tmpDir := makeConfig(testConfig) + defer os.RemoveAll(tmpDir) + + cfg, err := readMigrationConfig(tmpDir) + if err != nil { + t.Fatal(err) + } + + if len(cfg.DownloadSources) != 4 { + t.Fatal("wrong number of DownloadSources") + } + expect := []string{"IPFS", "HTTP", "127.0.0.1", "https://127.0.1.1"} + for i := range expect { + if cfg.DownloadSources[i] != expect[i] { + t.Errorf("wrong DownloadSource at %d", i) + } + } + + if cfg.Keep != "cache" { + t.Error("wrong value for Keep") + } +} + +func TestReadIpfsConfig(t *testing.T) { + tmpDir := makeConfig(testConfig) + defer os.RemoveAll(tmpDir) + + bootstrap, peers := readIpfsConfig(nil) + if bootstrap != nil || peers != nil { + t.Fatal("expected nil ipfs config items") + } + + bootstrap, peers = readIpfsConfig(&tmpDir) + if len(bootstrap) != 2 { + t.Fatal("wrong number of bootstrap addresses") + } + if bootstrap[0] != "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt" { + t.Fatal("wrong bootstrap address") + } + + if len(peers) != 1 { + t.Fatal("wrong number of peers") + } + + peer := peers[0] + if peer.ID.String() != "12D3KooWGC6TvWhfapngX6wvJHMYvKpDMXPb3ZnCZ6dMoaMtimQ5" { + t.Errorf("wrong ID for first peer") + } + if len(peer.Addrs) != 2 { + t.Error("wrong number of addrs for first peer") + } +} + +func TestReadPartialIpfsConfig(t *testing.T) { + const ( + configBadBootstrap = ` +{ + "Bootstrap": "unreadable", + "Migration": { + "DownloadSources": ["IPFS", "HTTP", "127.0.0.1"], + "Keep": "cache" + }, + "Peering": { + "Peers": [ + { + "ID": "12D3KooWGC6TvWhfapngX6wvJHMYvKpDMXPb3ZnCZ6dMoaMtimQ5", + "Addrs": ["/ip4/127.0.0.1/tcp/4001", "/ip4/127.0.0.1/udp/4001/quic"] + } + ] + } +} +` + configBadPeers = ` +{ + "Bootstrap": [ + "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", + "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ" + ], + "Migration": { + "DownloadSources": ["IPFS", "HTTP", "127.0.0.1"], + "Keep": "cache" + }, + "Peering": "Unreadable-data" +} +` + ) + + tmpDir := makeConfig(configBadBootstrap) + defer os.RemoveAll(tmpDir) + + bootstrap, peers := readIpfsConfig(&tmpDir) + if bootstrap != nil { + t.Fatal("expected nil bootstrap") + } + if len(peers) != 1 { + t.Fatal("wrong number of peers") + } + if len(peers[0].Addrs) != 2 { + t.Error("wrong number of addrs for first peer") + } + os.RemoveAll(tmpDir) + + tmpDir = makeConfig(configBadPeers) + defer os.RemoveAll(tmpDir) + + bootstrap, peers = readIpfsConfig(&tmpDir) + if peers != nil { + t.Fatal("expected nil peers") + } + if len(bootstrap) != 2 { + t.Fatal("wrong number of bootstrap addresses") + } + if bootstrap[0] != "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt" { + t.Fatal("wrong bootstrap address") + } +} + +func makeConfig(configData string) string { + tmpDir, err := ioutil.TempDir("", "migration_test") + if err != nil { + panic(err) + } + + cfgFile, err := os.Create(filepath.Join(tmpDir, "config")) + if err != nil { + panic(err) + } + if _, err = cfgFile.Write([]byte(configData)); err != nil { + panic(err) + } + if err = cfgFile.Close(); err != nil { + panic(err) + } + return tmpDir +} + +func TestGetMigrationFetcher(t *testing.T) { + var f migrations.Fetcher + var err error + + cfg := &config.Migration{} + + cfg.DownloadSources = []string{"ftp://bad.gateway.io"} + _, err = getMigrationFetcher(cfg, nil) + if err == nil || !strings.HasPrefix(err.Error(), "bad gateway addr") { + t.Fatal("Expected bad gateway address error, got:", err) + } + + cfg.DownloadSources = []string{"::bad.gateway.io"} + _, err = getMigrationFetcher(cfg, nil) + if err == nil || !strings.HasPrefix(err.Error(), "bad gateway addr") { + t.Fatal("Expected bad gateway address error, got:", err) + } + + cfg.DownloadSources = []string{"http://localhost"} + f, err = getMigrationFetcher(cfg, nil) + if err != nil { + t.Fatal(err) + } + if _, ok := f.(*migrations.HttpFetcher); !ok { + t.Fatal("expected HttpFetcher") + } + + cfg.DownloadSources = []string{"ipfs"} + f, err = getMigrationFetcher(cfg, nil) + if err != nil { + t.Fatal(err) + } + if _, ok := f.(*ipfsfetcher.IpfsFetcher); !ok { + t.Fatal("expected IpfsFetcher") + } + + cfg.DownloadSources = []string{"http"} + f, err = getMigrationFetcher(cfg, nil) + if err != nil { + t.Fatal(err) + } + if _, ok := f.(*migrations.HttpFetcher); !ok { + t.Fatal("expected HttpFetcher") + } + + cfg.DownloadSources = []string{"IPFS", "HTTPS"} + f, err = getMigrationFetcher(cfg, nil) + if err != nil { + t.Fatal(err) + } + mf, ok := f.(*migrations.MultiFetcher) + if !ok { + t.Fatal("expected MultiFetcher") + } + if mf.Len() != 2 { + t.Fatal("expected 2 fetchers in MultiFetcher") + } + + cfg.DownloadSources = []string{"ipfs", "https", "some.domain.io"} + f, err = getMigrationFetcher(cfg, nil) + if err != nil { + t.Fatal(err) + } + mf, ok = f.(*migrations.MultiFetcher) + if !ok { + t.Fatal("expected MultiFetcher") + } + if mf.Len() != 3 { + t.Fatal("expected 3 fetchers in MultiFetcher") + } + + cfg.DownloadSources = nil + _, err = getMigrationFetcher(cfg, nil) + if err == nil { + t.Fatal("expected error when no sources specified") + } + + cfg.DownloadSources = []string{"", ""} + _, err = getMigrationFetcher(cfg, nil) + if err == nil { + t.Fatal("expected error when empty string fetchers specified") + } +} diff --git a/docs/config.md b/docs/config.md index e41c8b1414c..87a2ea14c0a 100644 --- a/docs/config.md +++ b/docs/config.md @@ -172,6 +172,9 @@ does (e.g, `"1d2h4m40.01s"`). - [`Ipns.RepublishPeriod`](#ipnsrepublishperiod) - [`Ipns.RecordLifetime`](#ipnsrecordlifetime) - [`Ipns.ResolveCacheSize`](#ipnsresolvecachesize) +- [`Migration`](#migration) + - [`Migration.DownloadSources`](#migrationdownloadsources) + - [`Migration.Keep`](#migrationkeep) - [`Mounts`](#mounts) - [`Mounts.IPFS`](#mountsipfs) - [`Mounts.IPNS`](#mountsipns) @@ -809,6 +812,22 @@ Default: `128` Type: `integer` (non-negative, 0 means the default) +## `Migration` + +Migration configures how migrations are downloaded and if the downloads are added to IPFS locally. + +### `Migration.DownloadSources` + +Sources in order of preference, where "IPFS" means use IPFS and "HTTPS" means use default gateways. Any other values are interpreted as hostnames for custom gateways. An empty list means "use default sources". + +Default: `["HTTPS", "IPFS"]` + +### `Migration.Keep` + +Specifies whether or not to keep the migration after downloading it. Options are "discard", "cache", "pin". Empty string for default. + +Default: `cache` + ## `Mounts` FUSE mount point configuration options. diff --git a/go.mod b/go.mod index 14310541058..7c404c35045 100644 --- a/go.mod +++ b/go.mod @@ -102,10 +102,10 @@ require ( go.opencensus.io v0.23.0 go.uber.org/fx v1.13.1 go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 + golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210426080607-c94f62235c83 + golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 ) go 1.14 diff --git a/go.sum b/go.sum index 6b1ebc171f5..2a853f578a1 100644 --- a/go.sum +++ b/go.sum @@ -1288,8 +1288,9 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1441,8 +1442,9 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426080607-c94f62235c83 h1:kHSDPqCtsHZOg0nVylfTo20DDhE9gG4Y0jn7hKQ0QAM= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c= +golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go index 456cdcee8df..dcb09e979a7 100644 --- a/repo/fsrepo/fsrepo.go +++ b/repo/fsrepo/fsrepo.go @@ -14,7 +14,6 @@ import ( keystore "github.com/ipfs/go-ipfs-keystore" repo "github.com/ipfs/go-ipfs/repo" "github.com/ipfs/go-ipfs/repo/common" - "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" dir "github.com/ipfs/go-ipfs/thirdparty/dir" ds "github.com/ipfs/go-datastore" @@ -23,6 +22,7 @@ import ( config "github.com/ipfs/go-ipfs-config" serialize "github.com/ipfs/go-ipfs-config/serialize" util "github.com/ipfs/go-ipfs-util" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" logging "github.com/ipfs/go-log" homedir "github.com/mitchellh/go-homedir" ma "github.com/multiformats/go-multiaddr" diff --git a/repo/fsrepo/migrations/fetch.go b/repo/fsrepo/migrations/fetch.go index 0682aea532a..a3493e75009 100644 --- a/repo/fsrepo/migrations/fetch.go +++ b/repo/fsrepo/migrations/fetch.go @@ -14,6 +14,12 @@ import ( "strings" ) +// DownloadDirectory can be set as the location for FetchBinary to save the +// downloaded archive file in. If not set, then FetchBinary saves the archive +// in a temporary directory that is removed after the contents of the archive +// is extracted. +var DownloadDirectory string + // FetchBinary downloads an archive from the distribution site and unpacks it. // // The base name of the binary inside the archive may differ from the base @@ -68,12 +74,27 @@ func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out s } } - // Create temp directory to store download - tmpDir, err := ioutil.TempDir("", arcName) - if err != nil { - return "", err + tmpDir := DownloadDirectory + if tmpDir != "" { + fi, err = os.Stat(tmpDir) + if err != nil { + return "", err + } + if !fi.IsDir() { + return "", &os.PathError{ + Op: "FetchBinary", + Path: tmpDir, + Err: os.ErrExist, + } + } + } else { + // Create temp directory to store download + tmpDir, err = ioutil.TempDir("", arcName) + if err != nil { + return "", err + } + defer os.RemoveAll(tmpDir) } - defer os.RemoveAll(tmpDir) atype := "tar.gz" if runtime.GOOS == "windows" { diff --git a/repo/fsrepo/migrations/fetch_test.go b/repo/fsrepo/migrations/fetch_test.go index 36cfb466217..c78063da0f5 100644 --- a/repo/fsrepo/migrations/fetch_test.go +++ b/repo/fsrepo/migrations/fetch_test.go @@ -102,21 +102,21 @@ func TestHttpFetch(t *testing.T) { } defer rc.Close() - var out []string + var lines []string scan := bufio.NewScanner(rc) for scan.Scan() { - out = append(out, scan.Text()) + lines = append(lines, scan.Text()) } err = scan.Err() if err != nil { t.Fatal("could not read versions:", err) } - if len(out) < 6 { + if len(lines) < 6 { t.Fatal("do not get all expected data") } - if out[0] != "v1.0.0" { - t.Fatal("expected v1.0.0 as first line, got", out[0]) + if lines[0] != "v1.0.0" { + t.Fatal("expected v1.0.0 as first line, got", lines[0]) } // Check not found diff --git a/repo/fsrepo/migrations/fetcher.go b/repo/fsrepo/migrations/fetcher.go index f6d5f66861a..e70a9ae11e8 100644 --- a/repo/fsrepo/migrations/fetcher.go +++ b/repo/fsrepo/migrations/fetcher.go @@ -4,6 +4,8 @@ import ( "context" "io" "os" + + "github.com/hashicorp/go-multierror" ) const ( @@ -20,6 +22,8 @@ type Fetcher interface { // Fetch attempts to fetch the file at the given ipfs path. // Returns io.ReadCloser on success, which caller must close. Fetch(ctx context.Context, filePath string) (io.ReadCloser, error) + // Close performs any cleanup after the fetcher is not longer needed. + Close() error } // MultiFetcher holds multiple Fetchers and provides a Fetch that tries each @@ -45,15 +49,34 @@ func NewMultiFetcher(f ...Fetcher) Fetcher { // Fetch attempts to fetch the file at each of its fetchers until one succeeds. // Returns io.ReadCloser on success, which caller must close. -func (f *MultiFetcher) Fetch(ctx context.Context, ipfsPath string) (rc io.ReadCloser, err error) { +func (f *MultiFetcher) Fetch(ctx context.Context, ipfsPath string) (io.ReadCloser, error) { + var errs error for _, fetcher := range f.fetchers { - rc, err = fetcher.Fetch(ctx, ipfsPath) + rc, err := fetcher.Fetch(ctx, ipfsPath) if err == nil { - // Transferred using this fetcher - return + return rc, nil + } + errs = multierror.Append(errs, err) + } + return nil, errs +} + +func (f *MultiFetcher) Close() error { + var errs error + for _, fetcher := range f.fetchers { + if err := fetcher.Close(); err != nil { + errs = multierror.Append(errs, err) } } - return + return errs +} + +func (f *MultiFetcher) Len() int { + return len(f.fetchers) +} + +func (f *MultiFetcher) Fetchers() []Fetcher { + return f.fetchers } // NewLimitReadCloser returns a new io.ReadCloser with the reader wrappen in a diff --git a/repo/fsrepo/migrations/httpfetcher.go b/repo/fsrepo/migrations/httpfetcher.go index 876457f106c..6fb20bb45c2 100644 --- a/repo/fsrepo/migrations/httpfetcher.go +++ b/repo/fsrepo/migrations/httpfetcher.go @@ -12,6 +12,7 @@ import ( const ( defaultGatewayURL = "https://ipfs.io" + // Default maximum download size defaultFetchLimit = 1024 * 1024 * 512 ) @@ -49,7 +50,7 @@ func NewHttpFetcher(distPath, gateway, userAgent string, fetchLimit int64) *Http } if fetchLimit != 0 { - if fetchLimit == -1 { + if fetchLimit < 0 { fetchLimit = 0 } f.limit = fetchLimit @@ -63,6 +64,7 @@ func NewHttpFetcher(distPath, gateway, userAgent string, fetchLimit int64) *Http // which caller must close. func (f *HttpFetcher) Fetch(ctx context.Context, filePath string) (io.ReadCloser, error) { gwURL := f.gateway + path.Join(f.distPath, filePath) + fmt.Printf("Fetching with HTTP: %q\n", gwURL) req, err := http.NewRequestWithContext(ctx, http.MethodGet, gwURL, nil) if err != nil { @@ -92,3 +94,7 @@ func (f *HttpFetcher) Fetch(ctx context.Context, filePath string) (io.ReadCloser } return resp.Body, nil } + +func (f *HttpFetcher) Close() error { + return nil +} diff --git a/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go b/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go new file mode 100644 index 00000000000..0a133a83311 --- /dev/null +++ b/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher.go @@ -0,0 +1,279 @@ +package ipfsfetcher + +import ( + "context" + "fmt" + "io" + "io/ioutil" + "net/url" + "os" + "path" + "strings" + "sync" + + "github.com/ipfs/go-ipfs-config" + files "github.com/ipfs/go-ipfs-files" + "github.com/ipfs/go-ipfs/core" + "github.com/ipfs/go-ipfs/core/coreapi" + "github.com/ipfs/go-ipfs/core/node/libp2p" + "github.com/ipfs/go-ipfs/repo/fsrepo" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" + iface "github.com/ipfs/interface-go-ipfs-core" + "github.com/ipfs/interface-go-ipfs-core/options" + ipath "github.com/ipfs/interface-go-ipfs-core/path" + peer "github.com/libp2p/go-libp2p-core/peer" +) + +const ( + // Default maximum download size + defaultFetchLimit = 1024 * 1024 * 512 + + tempNodeTcpAddr = "/ip4/127.0.0.1/tcp/0" +) + +type IpfsFetcher struct { + distPath string + limit int64 + bootstrap []string + peers []peer.AddrInfo + + openOnce sync.Once + openErr error + closeOnce sync.Once + closeErr error + + ipfs iface.CoreAPI + ipfsTmpDir string + ipfsStopFunc func() + + fetched []ipath.Path + mutex sync.Mutex + + addrInfo peer.AddrInfo +} + +// NewIpfsFetcher creates a new IpfsFetcher +// +// Specifying "" for distPath sets the default IPNS path. +// Specifying 0 for fetchLimit sets the default, -1 means no limit. +func NewIpfsFetcher(distPath string, fetchLimit int64, bootstrap []string, peers []peer.AddrInfo) *IpfsFetcher { + f := &IpfsFetcher{ + limit: defaultFetchLimit, + distPath: migrations.LatestIpfsDist, + bootstrap: bootstrap, + peers: peers, + } + + if distPath != "" { + if !strings.HasPrefix(distPath, "/") { + distPath = "/" + distPath + } + f.distPath = distPath + } + + if fetchLimit != 0 { + if fetchLimit < 0 { + fetchLimit = 0 + } + f.limit = fetchLimit + } + + return f +} + +// Fetch attempts to fetch the file at the given path, from the distribution +// site configured for this HttpFetcher. Returns io.ReadCloser on success, +// which caller must close. +func (f *IpfsFetcher) Fetch(ctx context.Context, filePath string) (io.ReadCloser, error) { + // Initialize and start IPFS node on first call to Fetch, since the fetcher + // may be created by not used. + f.openOnce.Do(func() { + f.ipfsTmpDir, f.openErr = initTempNode(ctx, f.bootstrap, f.peers) + if f.openErr != nil { + return + } + + f.openErr = f.startTempNode(ctx) + }) + + fmt.Printf("Fetching with IPFS: %q\n", filePath) + + if f.openErr != nil { + return nil, f.openErr + } + + iPath, err := parsePath(path.Join(f.distPath, filePath)) + if err != nil { + return nil, err + } + + nd, err := f.ipfs.Unixfs().Get(ctx, iPath) + if err != nil { + return nil, err + } + + f.recordFetched(iPath) + + fileNode, ok := nd.(files.File) + if !ok { + return nil, fmt.Errorf("%q is not a file", filePath) + } + + if f.limit != 0 { + return migrations.NewLimitReadCloser(fileNode, f.limit), nil + } + return fileNode, nil +} + +func (f *IpfsFetcher) Close() error { + f.closeOnce.Do(func() { + if f.ipfsStopFunc != nil { + // Tell ipfs node to stop and wait for it to stop + f.ipfsStopFunc() + } + + if f.ipfsTmpDir != "" { + // Remove the temp ipfs dir + f.closeErr = os.RemoveAll(f.ipfsTmpDir) + } + }) + return f.closeErr +} + +func (f *IpfsFetcher) AddrInfo() peer.AddrInfo { + return f.addrInfo +} + +// FetchedPaths returns the IPFS paths of all items fetched by this fetcher +func (f *IpfsFetcher) FetchedPaths() []ipath.Path { + f.mutex.Lock() + defer f.mutex.Unlock() + return f.fetched +} + +func (f *IpfsFetcher) recordFetched(fetchedPath ipath.Path) { + // Mutex protects against update by concurrent calls to Fetch + f.mutex.Lock() + defer f.mutex.Unlock() + f.fetched = append(f.fetched, fetchedPath) +} + +func initTempNode(ctx context.Context, bootstrap []string, peers []peer.AddrInfo) (string, error) { + identity, err := config.CreateIdentity(ioutil.Discard, []options.KeyGenerateOption{ + options.Key.Type(options.Ed25519Key), + }) + if err != nil { + return "", err + } + cfg, err := config.InitWithIdentity(identity) + if err != nil { + return "", err + } + + // create temporary ipfs directory + dir, err := ioutil.TempDir("", "ipfs-temp") + if err != nil { + return "", fmt.Errorf("failed to get temp dir: %s", err) + } + + // configure the temporary node + cfg.Routing.Type = "dhtclient" + + // Disable listening for inbound connections + cfg.Addresses.Gateway = []string{} + cfg.Addresses.API = []string{} + cfg.Addresses.Swarm = []string{tempNodeTcpAddr} + + if len(bootstrap) != 0 { + cfg.Bootstrap = bootstrap + } + + if len(peers) != 0 { + cfg.Peering.Peers = peers + } + + // Assumes that repo plugins are already loaded + err = fsrepo.Init(dir, cfg) + if err != nil { + os.RemoveAll(dir) + return "", fmt.Errorf("failed to initialize ephemeral node: %s", err) + } + + return dir, nil +} + +func (f *IpfsFetcher) startTempNode(ctx context.Context) error { + // Open the repo + r, err := fsrepo.Open(f.ipfsTmpDir) + if err != nil { + return err + } + + // Create a new lifetime context that is used to stop the temp ipfs node + ctxIpfsLife, cancel := context.WithCancel(context.Background()) + + // Construct the node + node, err := core.NewNode(ctxIpfsLife, &core.BuildCfg{ + Online: true, + Routing: libp2p.DHTClientOption, + Repo: r, + }) + if err != nil { + cancel() + r.Close() + return err + } + + ipfs, err := coreapi.NewCoreAPI(node) + if err != nil { + cancel() + return err + } + + stopFunc := func() { + // Tell ipfs to stop + cancel() + // Wait until ipfs is stopped + <-node.Context().Done() + + fmt.Println("migration peer", node.Identity, "shutdown") + } + + addrs, err := ipfs.Swarm().LocalAddrs(ctx) + if err != nil { + // Failure to get the local swarm address only means that the + // downloaded migrations cannot be fetched through the temporary node. + // So, print the error message and keep going. + fmt.Fprintln(os.Stderr, "cannot get local swarm address:", err) + } + + f.addrInfo = peer.AddrInfo{ + ID: node.Identity, + Addrs: addrs, + } + + f.ipfs = ipfs + f.ipfsStopFunc = stopFunc + + return nil +} + +func parsePath(fetchPath string) (ipath.Path, error) { + ipfsPath := ipath.New(fetchPath) + if ipfsPath.IsValid() == nil { + return ipfsPath, nil + } + + u, err := url.Parse(fetchPath) + if err != nil { + return nil, fmt.Errorf("%q could not be parsed: %s", fetchPath, err) + } + + switch proto := u.Scheme; proto { + case "ipfs", "ipld", "ipns": + ipfsPath = ipath.New(path.Join("/", proto, u.Host, u.Path)) + default: + return nil, fmt.Errorf("%q is not an IPFS path", fetchPath) + } + return ipfsPath, ipfsPath.IsValid() +} diff --git a/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher_test.go b/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher_test.go new file mode 100644 index 00000000000..4c4d5b2d662 --- /dev/null +++ b/repo/fsrepo/migrations/ipfsfetcher/ipfsfetcher_test.go @@ -0,0 +1,144 @@ +package ipfsfetcher + +import ( + "bufio" + "context" + "fmt" + "os" + "path/filepath" + "testing" + + "github.com/ipfs/go-ipfs/plugin/loader" + "github.com/ipfs/go-ipfs/repo/fsrepo/migrations" +) + +func init() { + err := setupPlugins() + if err != nil { + panic(err) + } +} + +func TestIpfsFetcher(t *testing.T) { + skipUnlessEpic(t) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + fetcher := NewIpfsFetcher("", 0, nil, nil) + defer fetcher.Close() + + rc, err := fetcher.Fetch(ctx, "go-ipfs/versions") + if err != nil { + t.Fatal(err) + } + defer rc.Close() + + var lines []string + scan := bufio.NewScanner(rc) + for scan.Scan() { + lines = append(lines, scan.Text()) + } + err = scan.Err() + if err != nil { + t.Fatal("could not read versions:", err) + } + + if len(lines) < 6 { + t.Fatal("do not get all expected data") + } + if lines[0] != "v0.3.2" { + t.Fatal("expected v1.0.0 as first line, got", lines[0]) + } + + // Check not found + _, err = fetcher.Fetch(ctx, "/no_such_file") + if err == nil { + t.Fatal("expected error 404") + } + +} + +func TestInitIpfsFetcher(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + f := NewIpfsFetcher("", 0, nil, nil) + defer f.Close() + + // Init ipfs repo + f.ipfsTmpDir, f.openErr = initTempNode(ctx, f.bootstrap, f.peers) + if f.openErr != nil { + t.Fatalf("failed to initialize ipfs node: %s", f.openErr) + } + + // Start ipfs node + f.openErr = f.startTempNode(ctx) + if f.openErr != nil { + t.Errorf("failed to start ipfs node: %s", f.openErr) + return + } + + var stopFuncCalled bool + stopFunc := f.ipfsStopFunc + f.ipfsStopFunc = func() { + stopFuncCalled = true + stopFunc() + } + + addrInfo := f.AddrInfo() + if string(addrInfo.ID) == "" { + t.Error("AddInfo ID not set") + } + if len(addrInfo.Addrs) == 0 { + t.Error("AddInfo Addrs not set") + } + t.Log("Temp node listening on:", addrInfo.Addrs) + + err := f.Close() + if err != nil { + t.Fatalf("failed to close fetcher: %s", err) + } + + if stopFunc != nil && !stopFuncCalled { + t.Error("Close did not call stop function") + } + + err = f.Close() + if err != nil { + t.Fatalf("failed to close fetcher 2nd time: %s", err) + } +} + +func skipUnlessEpic(t *testing.T) { + if os.Getenv("IPFS_EPIC_TEST") == "" { + t.SkipNow() + } +} + +func setupPlugins() error { + defaultPath, err := migrations.IpfsDir("") + if err != nil { + return err + } + + // Load plugins. This will skip the repo if not available. + plugins, err := loader.NewPluginLoader(filepath.Join(defaultPath, "plugins")) + if err != nil { + return fmt.Errorf("error loading plugins: %w", err) + } + + if err := plugins.Initialize(); err != nil { + // Need to ignore errors here because plugins may already be loaded when + // run from ipfs daemon. + return fmt.Errorf("error initializing plugins: %w", err) + } + + if err := plugins.Inject(); err != nil { + // Need to ignore errors here because plugins may already be loaded when + // run from ipfs daemon. + return fmt.Errorf("error injecting plugins: %w", err) + } + + return nil +} diff --git a/repo/fsrepo/migrations/migrations.go b/repo/fsrepo/migrations/migrations.go index b3a3b534f54..2cb13619aef 100644 --- a/repo/fsrepo/migrations/migrations.go +++ b/repo/fsrepo/migrations/migrations.go @@ -26,7 +26,7 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s if err != nil { return err } - fromVer, err := repoVersion(ipfsDir) + fromVer, err := RepoVersion(ipfsDir) if err != nil { return fmt.Errorf("could not get repo version: %s", err) } @@ -69,6 +69,7 @@ func RunMigration(ctx context.Context, fetcher Fetcher, targetVer int, ipfsDir s logger.Print("Failed to download migrations.") return err } + for i := range missing { binPaths[missing[i]] = fetched[i] } diff --git a/repo/fsrepo/migrations/migrations_test.go b/repo/fsrepo/migrations/migrations_test.go index 2735f26216e..66827d8c749 100644 --- a/repo/fsrepo/migrations/migrations_test.go +++ b/repo/fsrepo/migrations/migrations_test.go @@ -157,8 +157,7 @@ func TestFetchMigrations(t *testing.T) { } func TestRunMigrations(t *testing.T) { - var err error - fakeHome, err = ioutil.TempDir("", "testhome") + fakeHome, err := ioutil.TempDir("", "testhome") if err != nil { panic(err) } diff --git a/repo/fsrepo/migrations/unpack.go b/repo/fsrepo/migrations/unpack.go index 485d983cfc1..3f9d60cb65a 100644 --- a/repo/fsrepo/migrations/unpack.go +++ b/repo/fsrepo/migrations/unpack.go @@ -23,7 +23,6 @@ func unpackArchive(arcPath, atype, root, name, out string) error { if err != nil { return err } - os.Remove(arcPath) return nil } From 3f7e23e640d166e08e87d285fd53e98a1542ad6d Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Wed, 12 May 2021 12:47:08 -0400 Subject: [PATCH 127/161] chore: update deps --- core/node/graphsync.go | 3 +-- go.mod | 10 +++++----- go.sum | 40 +++++++++++++++++++++++++--------------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/core/node/graphsync.go b/core/node/graphsync.go index 32ffbfd268a..521a62a6a55 100644 --- a/core/node/graphsync.go +++ b/core/node/graphsync.go @@ -18,7 +18,6 @@ func Graphsync(lc fx.Lifecycle, mctx helpers.MetricsCtx, host libp2p.Host, bs bl network := network.NewFromLibp2pHost(host) return gsimpl.New(ctx, network, - storeutil.LoaderForBlockstore(bs), - storeutil.StorerForBlockstore(bs), + storeutil.LinkSystemForBlockstore(bs), ) } diff --git a/go.mod b/go.mod index 7c404c35045..0765952ed26 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/ipfs/go-ds-measure v0.1.0 github.com/ipfs/go-filestore v0.0.3 github.com/ipfs/go-fs-lock v0.0.6 - github.com/ipfs/go-graphsync v0.7.0 + github.com/ipfs/go-graphsync v0.8.0 github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 @@ -42,19 +42,19 @@ require ( github.com/ipfs/go-ipld-cbor v0.0.5 github.com/ipfs/go-ipld-format v0.2.0 github.com/ipfs/go-ipld-git v0.0.4 - github.com/ipfs/go-ipns v0.0.2 + github.com/ipfs/go-ipns v0.1.0 github.com/ipfs/go-log v1.0.5 github.com/ipfs/go-merkledag v0.3.2 github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 github.com/ipfs/go-mfs v0.1.2 - github.com/ipfs/go-namesys v0.2.0 + github.com/ipfs/go-namesys v0.3.0 github.com/ipfs/go-path v0.0.9 github.com/ipfs/go-pinning-service-http-client v0.1.0 github.com/ipfs/go-unixfs v0.2.5 github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 - github.com/ipld/go-car v0.2.2 + github.com/ipld/go-car v0.3.0 github.com/jbenet/go-is-domain v1.0.5 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 @@ -90,7 +90,7 @@ require ( github.com/multiformats/go-multiaddr v0.3.1 github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multibase v0.0.3 - github.com/multiformats/go-multihash v0.0.14 + github.com/multiformats/go-multihash v0.0.15 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.10.0 diff --git a/go.sum b/go.sum index 2a853f578a1..739512dff94 100644 --- a/go.sum +++ b/go.sum @@ -182,6 +182,8 @@ github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJn github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -395,8 +397,8 @@ github.com/ipfs/go-filestore v0.0.3 h1:MhZ1jT5K3NewZwim6rS/akcJLm1xM+r6nz6foeB9E github.com/ipfs/go-filestore v0.0.3/go.mod h1:dvXRykFzyyXN2CdNlRGzDAkXMDPyI+D7JE066SiKLSE= github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= -github.com/ipfs/go-graphsync v0.7.0 h1:ZdyU2otZYPjcvduAPwVjCdijmkPtHI1mm1VyZbRQ5KI= -github.com/ipfs/go-graphsync v0.7.0/go.mod h1:YRQg0TyvD2HzFansAZdMcUFBJ8zIJ4K+32kNdnHfHZc= +github.com/ipfs/go-graphsync v0.8.0 h1:Zhh6QdTqdipYHD71ncLO8eA6c8EGUTOoJ4Rqybw3K+o= +github.com/ipfs/go-graphsync v0.8.0/go.mod h1:CLxN859dUTcXCav1DvNvmAUWPZfmNLjlGLJYy+c3dlM= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= @@ -451,8 +453,9 @@ github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL3 github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= github.com/ipfs/go-ipld-git v0.0.4 h1:fQv2Alq72g6mH+heDWQ9Awu5FQYc3hcCUVtzuWj/Mno= github.com/ipfs/go-ipld-git v0.0.4/go.mod h1:RuvMXa9qtJpDbqngyICCU/d+cmLFXxLsbIclmD0Lcr0= -github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= +github.com/ipfs/go-ipns v0.1.0 h1:jk03sneWwh+/bSHrFjRfE38xHDnTzqCsx2wsJ8ipukM= +github.com/ipfs/go-ipns v0.1.0/go.mod h1:3IbsuPkR6eAGcnx+E7j6HpOSbSQJPZ6zlRj+NK3jPxQ= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.1/go.mod h1:HuWlQttfN6FWNHRhlY5yMk/lW7evQC0HHGOxEwMRR8I= github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= @@ -480,8 +483,8 @@ github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZa github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-mfs v0.1.2 h1:DlelNSmH+yz/Riy0RjPKlooPg0KML4lXGdLw7uZkfAg= github.com/ipfs/go-mfs v0.1.2/go.mod h1:T1QBiZPEpkPLzDqEJLNnbK55BVKVlNi2a+gVm4diFo0= -github.com/ipfs/go-namesys v0.2.0 h1:QoxOsYl5sufEqE/kP7v6b9IbOTxM4LO88GGmiXWPekI= -github.com/ipfs/go-namesys v0.2.0/go.mod h1:j1ttlrLy7/NhtwrXOqwMty749Fe3yEKt2yaYR3XJQPE= +github.com/ipfs/go-namesys v0.3.0 h1:6lytKWj1rG0Ot6J0nTHvFw+06q1a6n7DLA2CbSGmZco= +github.com/ipfs/go-namesys v0.3.0/go.mod h1:/BL4xk8LP5Lq82AmaRKyxZv/eYRlumNiU9SZUe1Hlps= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-path v0.0.9 h1:BIi831cNED8YnIlIKo9y1SI3u+E+FwQQD+rIIw8PwFA= github.com/ipfs/go-path v0.0.9/go.mod h1:VpDkSBKQ9EFQOUgi54Tq/O/tGi8n1RfYNks13M3DEs8= @@ -500,12 +503,13 @@ github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2 github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/ipld/go-car v0.2.2 h1:Dq0Kl0XMaNMCNxATbYYu/EIgqWjo2w2W+Miu6npd20g= -github.com/ipld/go-car v0.2.2/go.mod h1:pPb7hzVBHBoRqU3GkPy1d6FZKQoGQ56yd3MyPGzZ0Xs= -github.com/ipld/go-ipld-prime v0.7.0 h1:eigF1ZpaL1prbsKYVMqPLoPJqD/pzkQOe2j1uzvVg7w= -github.com/ipld/go-ipld-prime v0.7.0/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime-proto v0.1.1 h1:EX4yWYaIqSLwtVE30nxEcZDcvsWDtx1vImSG+XCJebY= -github.com/ipld/go-ipld-prime-proto v0.1.1/go.mod h1:cI9NwYAUKCLUwqufoUjChISxuTEkaY2yvNYCRCuhRck= +github.com/ipld/go-car v0.3.0 h1:TV0Cb9k0Ux5lZ2h9+8xwQuIExYhHsllMGla1rB45lF4= +github.com/ipld/go-car v0.3.0/go.mod h1:dPkEWeAK8KaVvH5TahaCs6Mncpd4lDMpkbs0/SPzuVs= +github.com/ipld/go-codec-dagpb v1.2.0 h1:2umV7ud8HBMkRuJgd8gXw95cLhwmcYrihS3cQEy9zpI= +github.com/ipld/go-codec-dagpb v1.2.0/go.mod h1:6nBN7X7h8EOsEejZGqC7tej5drsdBAXbMHyBT+Fne5s= +github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= +github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db h1:kFwGn8rXa/Z31ev1OFNQsYeNKNCdifnTPl/NvPy5L38= +github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= @@ -550,6 +554,8 @@ github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHz github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/cpuid/v2 v2.0.4 h1:g0I61F2K2DjRHz1cnxlkNSBIaePVoJIjjnHui8QHbiw= +github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -907,8 +913,9 @@ github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+ github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -966,14 +973,17 @@ github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5 github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multicodec v0.2.0 h1:MUzKZWxOFagwLLtlx96pub9zwDQAbMAf1k9fXOdc3so= +github.com/multiformats/go-multicodec v0.2.0/go.mod h1:/y4YVwkfMyry5kFbMTbLJKErhycTIftytRV+llXdyS4= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.0.15 h1:hWOPdrNqDjwHDx82vsYGSDZNyktOJJ2dzZJzFkOV1jM= +github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= @@ -1281,13 +1291,13 @@ golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -1424,7 +1434,6 @@ golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1445,6 +1454,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 2ef501dec84f48064c1d561c9676c0e06a07afbc Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Fri, 23 Apr 2021 19:50:13 -0700 Subject: [PATCH 128/161] fix(sharness): switch insecure hash function test License: MIT Signed-off-by: hannahhoward --- test/sharness/t0275-cid-security.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sharness/t0275-cid-security.sh b/test/sharness/t0275-cid-security.sh index 6bf3a90cabf..b5612dfea6d 100755 --- a/test/sharness/t0275-cid-security.sh +++ b/test/sharness/t0275-cid-security.sh @@ -11,7 +11,7 @@ test_description="Cid Security" test_init_ipfs test_expect_success "adding using unsafe function fails with error" ' - echo foo | test_must_fail ipfs add --hash murmur3-128 2>add_out + echo foo | test_must_fail ipfs add --hash shake-128 2>add_out ' test_expect_success "error reason is pointed out" ' From 3d7ff24f8c7d48286c228c9f8c7e22072e80d2dd Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 12 May 2021 23:03:50 +0200 Subject: [PATCH 129/161] chore: use nodejs 14.x on ci 12 is no longer supported, latest js-ipfs requires 14 https://blog.ipfs.io/2021-05-11-js-ipfs-0-55/ --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8891a342da8..dd93f669b3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,13 +44,13 @@ executors: TEST_VERBOSE: 1 node: docker: - - image: circleci/node:12 + - image: circleci/node:14 working_directory: ~/ipfs/go-ipfs environment: <<: *default_environment node-browsers: docker: - - image: circleci/node:12-browsers + - image: circleci/node:14-browsers working_directory: ~/ipfs/go-ipfs environment: <<: *default_environment From 5a62025cc70a4b352f1d76f0041b638f076e9b7d Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 25 Feb 2021 16:33:03 -0500 Subject: [PATCH 130/161] chore: bump minimum go version to 1.15 --- .circleci/config.yml | 4 ++-- README.md | 4 ++-- go.mod | 2 +- mk/golang.mk | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8891a342da8..028d1a525c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ default_environment: &default_environment executors: golang: docker: - - image: circleci/golang:1.14.4 + - image: circleci/golang:1.15.8 working_directory: ~/ipfs/go-ipfs environment: <<: *default_environment @@ -60,7 +60,7 @@ executors: E2E_IPFSD_TYPE: go dockerizer: docker: - - image: circleci/golang:1.14.4 + - image: circleci/golang:1.15.8 environment: IMAGE_NAME: ipfs/go-ipfs WIP_IMAGE_TAG: wip diff --git a/README.md b/README.md index 2dafe8a739c..80539a73e67 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ PS> scoop install go-ipfs ### Build from Source -go-ipfs's build system requires Go 1.14.4 and some standard POSIX build tools: +go-ipfs's build system requires Go 1.15.8 and some standard POSIX build tools: * GNU make * Git @@ -170,7 +170,7 @@ To build without GCC, build with `CGO_ENABLED=0` (e.g., `make build CGO_ENABLED= #### Install Go -The build process for ipfs requires Go 1.14.4 or higher. If you don't have it: [Download Go 1.14+](https://golang.org/dl/). +The build process for ipfs requires Go 1.15.8 or higher. If you don't have it: [Download Go 1.15+](https://golang.org/dl/). You'll need to add Go's bin directories to your `$PATH` environment variable e.g., by adding these lines to your `/etc/profile` (for a system-wide installation) or `$HOME/.profile`: diff --git a/go.mod b/go.mod index 7c404c35045..03dffcc82da 100644 --- a/go.mod +++ b/go.mod @@ -108,4 +108,4 @@ require ( golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 ) -go 1.14 +go 1.15 diff --git a/mk/golang.mk b/mk/golang.mk index 210af085991..50bf4ce3cf5 100644 --- a/mk/golang.mk +++ b/mk/golang.mk @@ -1,5 +1,5 @@ # golang utilities -GO_MIN_VERSION = 1.14.4 +GO_MIN_VERSION = 1.15.8 export GO111MODULE=on From a81718f20a66012128464106c6b06ccf78b36f99 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Wed, 12 May 2021 17:20:44 -0400 Subject: [PATCH 131/161] bump dockerfile to Go 1.15.8 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7e10ea753b1..a11937dea0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Note: when updating the go minor version here, also update the go-channel in snap/snapcraft.yml -FROM golang:1.14.4-buster +FROM golang:1.15.8-buster LABEL maintainer="Steven Allen " # Install deps From 73e7e023c0620e6180828946c88e147dad1fc1d8 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Wed, 12 May 2021 17:59:20 -0400 Subject: [PATCH 132/161] downgrade to 1.15.2 --- .circleci/config.yml | 4 ++-- Dockerfile | 2 +- README.md | 4 ++-- mk/golang.mk | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 028d1a525c6..8636cb9f98e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ default_environment: &default_environment executors: golang: docker: - - image: circleci/golang:1.15.8 + - image: circleci/golang:1.15.2 working_directory: ~/ipfs/go-ipfs environment: <<: *default_environment @@ -60,7 +60,7 @@ executors: E2E_IPFSD_TYPE: go dockerizer: docker: - - image: circleci/golang:1.15.8 + - image: circleci/golang:1.15.2 environment: IMAGE_NAME: ipfs/go-ipfs WIP_IMAGE_TAG: wip diff --git a/Dockerfile b/Dockerfile index a11937dea0c..113c6599db1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Note: when updating the go minor version here, also update the go-channel in snap/snapcraft.yml -FROM golang:1.15.8-buster +FROM golang:1.15.2-buster LABEL maintainer="Steven Allen " # Install deps diff --git a/README.md b/README.md index 80539a73e67..67f229ee041 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ PS> scoop install go-ipfs ### Build from Source -go-ipfs's build system requires Go 1.15.8 and some standard POSIX build tools: +go-ipfs's build system requires Go 1.15.2 and some standard POSIX build tools: * GNU make * Git @@ -170,7 +170,7 @@ To build without GCC, build with `CGO_ENABLED=0` (e.g., `make build CGO_ENABLED= #### Install Go -The build process for ipfs requires Go 1.15.8 or higher. If you don't have it: [Download Go 1.15+](https://golang.org/dl/). +The build process for ipfs requires Go 1.15.2 or higher. If you don't have it: [Download Go 1.15+](https://golang.org/dl/). You'll need to add Go's bin directories to your `$PATH` environment variable e.g., by adding these lines to your `/etc/profile` (for a system-wide installation) or `$HOME/.profile`: diff --git a/mk/golang.mk b/mk/golang.mk index 50bf4ce3cf5..0b2a2c55ae2 100644 --- a/mk/golang.mk +++ b/mk/golang.mk @@ -1,5 +1,5 @@ # golang utilities -GO_MIN_VERSION = 1.15.8 +GO_MIN_VERSION = 1.15.2 export GO111MODULE=on From 473d7d5851783c45e95a27bf77ac3292918c641a Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 20 Mar 2021 12:54:36 +0800 Subject: [PATCH 133/161] update quic-go to v0.21.0-rc.1 --- core/corehttp/metrics.go | 5 -- go.mod | 8 +- go.sum | 26 ++++-- .../t0116-prometheus-data/prometheus_metrics | 86 +++++++++++++++++++ 4 files changed, 107 insertions(+), 18 deletions(-) diff --git a/core/corehttp/metrics.go b/core/corehttp/metrics.go index f84a6e18dba..f34881f41a5 100644 --- a/core/corehttp/metrics.go +++ b/core/corehttp/metrics.go @@ -10,7 +10,6 @@ import ( "go.opencensus.io/zpages" ocprom "contrib.go.opencensus.io/exporter/prometheus" - quicmetrics "github.com/lucas-clemente/quic-go/metrics" prometheus "github.com/prometheus/client_golang/prometheus" promhttp "github.com/prometheus/client_golang/prometheus/promhttp" ) @@ -44,10 +43,6 @@ func MetricsOpenCensusCollectionOption() ServeOption { view.RegisterExporter(pe) view.SetReportingPeriod(2 * time.Second) - if err := view.Register(quicmetrics.DefaultViews...); err != nil { - return nil, err - } - // Construct the mux zpages.Handle(mux, "/debug/metrics/oc/debugz") mux.Handle("/debug/metrics/oc", pe) diff --git a/go.mod b/go.mod index 772d1dae1bf..42c4ddcf7df 100644 --- a/go.mod +++ b/go.mod @@ -74,7 +74,7 @@ require ( github.com/libp2p/go-libp2p-peerstore v0.2.7 github.com/libp2p/go-libp2p-pubsub v0.4.1 github.com/libp2p/go-libp2p-pubsub-router v0.4.0 - github.com/libp2p/go-libp2p-quic-transport v0.10.0 + github.com/libp2p/go-libp2p-quic-transport v0.11.0-rc.1 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 github.com/libp2p/go-libp2p-swarm v0.5.0 @@ -84,7 +84,7 @@ require ( github.com/libp2p/go-socket-activation v0.0.2 github.com/libp2p/go-tcp-transport v0.2.1 github.com/libp2p/go-ws-transport v0.4.0 - github.com/lucas-clemente/quic-go v0.19.3 + github.com/lucas-clemente/quic-go v0.21.0-rc.2 github.com/miekg/dns v1.1.41 github.com/mitchellh/go-homedir v1.1.0 github.com/multiformats/go-multiaddr v0.3.1 @@ -102,10 +102,10 @@ require ( go.opencensus.io v0.23.0 go.uber.org/fx v1.13.1 go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b + golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 + golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 ) go 1.15 diff --git a/go.sum b/go.sum index 739512dff94..e0a01f40b19 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,9 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -554,6 +555,8 @@ github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHz github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid/v2 v2.0.4 h1:g0I61F2K2DjRHz1cnxlkNSBIaePVoJIjjnHui8QHbiw= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -728,8 +731,9 @@ github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDF github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub-router v0.4.0 h1:KjzTLIOBCt0+/4wH6epTxD/Qu4Up/IyeKHlj9MhWRJI= github.com/libp2p/go-libp2p-pubsub-router v0.4.0/go.mod h1:hs0j0ugcBjMOMgJ6diOlZM2rZEId/w5Gg86E+ac4SmQ= -github.com/libp2p/go-libp2p-quic-transport v0.10.0 h1:koDCbWD9CCHwcHZL3/WEvP2A+e/o5/W5L3QS/2SPMA0= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= +github.com/libp2p/go-libp2p-quic-transport v0.11.0-rc.1 h1:fq3BHwjS0zbU16zd0Yfuq2fSsGt/FhmSINQBOo334YM= +github.com/libp2p/go-libp2p-quic-transport v0.11.0-rc.1/go.mod h1:+6KxAO7wHfPQqNzvJHO3ItqbYfhMuI7qc/+u/Tjgh3k= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -868,18 +872,21 @@ github.com/libp2p/go-yamux/v2 v2.1.1 h1:3RkXAnDmaXJPckF/QbDnNbA6lZXMgycNTVMMTQ2Y github.com/libp2p/go-yamux/v2 v2.1.1/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= +github.com/lucas-clemente/quic-go v0.21.0-rc.2 h1:HWPytXS1LueuD6vIHwSMW0FQkmf4Rb4Keyk9Vvapm1A= +github.com/lucas-clemente/quic-go v0.21.0-rc.2/go.mod h1:T+SpiNEBFsIo/TO6N8XDIhpnx3LMlNL/b9vyQtuvj1M= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= -github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qtls-go1-15 v0.1.4 h1:RehYMOyRW8hPVEja1KBVsFVNSm35Jj9Mvs5yNoZZ28A= +github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qtls-go1-16 v0.1.3 h1:XEZ1xGorVy9u+lJq+WXNE+hiqRYLNvJGYmwfwKQN2gU= +github.com/marten-seemann/qtls-go1-16 v0.1.3/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -1299,8 +1306,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf h1:B2n+Zi5QeYRDAEodEu72OS36gmTWjgpXr2+cWcBW90o= +golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1447,13 +1454,14 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c= -golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q= +golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/test/sharness/t0116-prometheus-data/prometheus_metrics b/test/sharness/t0116-prometheus-data/prometheus_metrics index eb3e9211c3f..b037a31780d 100644 --- a/test/sharness/t0116-prometheus-data/prometheus_metrics +++ b/test/sharness/t0116-prometheus-data/prometheus_metrics @@ -570,3 +570,89 @@ process_resident_memory_bytes process_start_time_seconds process_virtual_memory_bytes process_virtual_memory_max_bytes +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_bucket +quic_connection_duration_count +quic_connection_duration_sum +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_bucket +quic_smoothed_rtt_count +quic_smoothed_rtt_sum From bc68e2d1c276113fe1f603af714ba3d6e946a849 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Wed, 12 May 2021 13:24:57 -0700 Subject: [PATCH 134/161] update go-tcp-transport to v0.2.2 --- go.mod | 2 +- go.sum | 17 +++- .../t0116-prometheus-data/prometheus_metrics | 88 +++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 42c4ddcf7df..120b1b1a0a2 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( github.com/libp2p/go-libp2p-tls v0.1.3 github.com/libp2p/go-libp2p-yamux v0.5.3 github.com/libp2p/go-socket-activation v0.0.2 - github.com/libp2p/go-tcp-transport v0.2.1 + github.com/libp2p/go-tcp-transport v0.2.2 github.com/libp2p/go-ws-transport v0.4.0 github.com/lucas-clemente/quic-go v0.21.0-rc.2 github.com/miekg/dns v1.1.41 diff --git a/go.sum b/go.sum index e0a01f40b19..f38777da70e 100644 --- a/go.sum +++ b/go.sum @@ -816,6 +816,7 @@ github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= +github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= github.com/libp2p/go-netroute v0.1.6 h1:ruPJStbYyXVYGQ81uzEDzuvbYRLKRrLvTYd33yomC38= github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= @@ -832,6 +833,7 @@ github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2 github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= +github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.1 h1:yD80l2ZOdGksnOyHrhxDdTDFrf7Oy+v3FMVArIRgZxQ= github.com/libp2p/go-sockaddr v0.1.1/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-socket-activation v0.0.2 h1:VLU3IbrUUqu4DMhxA9857Q63qUpEAbCz5RqSnLCx5jE= @@ -846,8 +848,9 @@ github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19 github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-tcp-transport v0.2.1 h1:ExZiVQV+h+qL16fzCWtd1HSzPsqWottJ8KXwWaVi8Ns= github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= +github.com/libp2p/go-tcp-transport v0.2.2 h1:vSjOYEJnfvAn20LJRuddghr+lrLDqU+DOV9fsCMG6zI= +github.com/libp2p/go-tcp-transport v0.2.2/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= github.com/libp2p/go-testutil v0.0.1/go.mod h1:iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= @@ -887,6 +890,8 @@ github.com/marten-seemann/qtls-go1-15 v0.1.4 h1:RehYMOyRW8hPVEja1KBVsFVNSm35Jj9M github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-16 v0.1.3 h1:XEZ1xGorVy9u+lJq+WXNE+hiqRYLNvJGYmwfwKQN2gU= github.com/marten-seemann/qtls-go1-16 v0.1.3/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -914,6 +919,12 @@ github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= +github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= @@ -1377,7 +1388,9 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1458,6 +1471,8 @@ golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q= diff --git a/test/sharness/t0116-prometheus-data/prometheus_metrics b/test/sharness/t0116-prometheus-data/prometheus_metrics index b037a31780d..f963a79dbf1 100644 --- a/test/sharness/t0116-prometheus-data/prometheus_metrics +++ b/test/sharness/t0116-prometheus-data/prometheus_metrics @@ -656,3 +656,91 @@ quic_smoothed_rtt_bucket quic_smoothed_rtt_bucket quic_smoothed_rtt_count quic_smoothed_rtt_sum +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_bucket +tcp_connection_duration_count +tcp_connection_duration_sum +tcp_rcvd_segments_total +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_bucket +tcp_rtt_count +tcp_rtt_sum +tcp_sent_segments_total From 24dd662d381cb60502a996e5be23e1bfd0c51a87 Mon Sep 17 00:00:00 2001 From: divingpetrel Date: Tue, 13 Apr 2021 16:53:22 +0100 Subject: [PATCH 135/161] feat support non-ICANN DNS --- core/corehttp/hostname.go | 9 ++++++--- core/corehttp/hostname_test.go | 2 +- go.mod | 1 - go.sum | 5 +---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index 6740f0e59f7..b6246e281e8 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -13,8 +13,9 @@ import ( core "github.com/ipfs/go-ipfs/core" coreapi "github.com/ipfs/go-ipfs/core/coreapi" namesys "github.com/ipfs/go-namesys" - isd "github.com/jbenet/go-is-domain" "github.com/libp2p/go-libp2p-core/peer" + dns "github.com/miekg/dns" + mbase "github.com/multiformats/go-multibase" config "github.com/ipfs/go-ipfs-config" @@ -351,9 +352,11 @@ func knownSubdomainDetails(hostname string, knownGateways gatewayHosts) (gw *con // isDNSLinkName returns bool if a valid DNS TXT record exist for provided host func isDNSLinkName(ctx context.Context, ipfs iface.CoreAPI, host string) bool { fqdn := stripPort(host) - if len(fqdn) == 0 && !isd.IsDomain(fqdn) { + + if _, ok := dns.IsDomainName(fqdn); !ok && len(fqdn) == 0 { return false } + name := "/ipns/" + fqdn // check if DNSLink exists depth := options.Name.ResolveOption(nsopts.Depth(1)) @@ -473,7 +476,7 @@ func toSubdomainURL(hostname, path string, r *http.Request, ipfs iface.CoreAPI) } // Normalize problematic PeerIDs (eg. ed25519+identity) to CID representation - if isPeerIDNamespace(ns) && !isd.IsDomain(rootID) { + if _, ok := dns.IsDomainName(rootID); !ok && isPeerIDNamespace(ns) { peerID, err := peer.Decode(rootID) // Note: PeerID CIDv1 with protobuf multicodec will fail, but we fix it // in the next block diff --git a/core/corehttp/hostname_test.go b/core/corehttp/hostname_test.go index 3ece5e88f8f..9bee6768ac7 100644 --- a/core/corehttp/hostname_test.go +++ b/core/corehttp/hostname_test.go @@ -55,7 +55,7 @@ func TestToSubdomainURL(t *testing.T) { {httpRequest, "localhost", "/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", "http://k2k4r8n0flx3ra0y5dr8fmyvwbzy3eiztmtq6th694k5a3rznayp3e4o.ipns.localhost/", nil}, {httpRequest, "localhost", "/ipns/bafybeickencdqw37dpz3ha36ewrh4undfjt2do52chtcky4rxkj447qhdm", "http://k2k4r8l9ja7hkzynavdqup76ou46tnvuaqegbd04a4o1mpbsey0meucb.ipns.localhost/", nil}, // PeerID: ed25519+identity multihash → CIDv1Base36 - {httpRequest, "localhost", "/ipns/12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5", "http://k51qzi5uqu5di608geewp3nqkg0bpujoasmka7ftkyxgcm3fh1aroup0gsdrna.ipns.localhost/", nil}, + {httpRequest, "localhost", "/ipns/12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5", "http://12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5.ipns.localhost/", nil}, {httpRequest, "sub.localhost", "/ipfs/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", "http://bafybeif7a7gdklt6hodwdrmwmxnhksctcuav6lfxlcyfz4khzl3qfmvcgu.ipfs.sub.localhost/", nil}, // HTTPS requires DNSLink name to fit in a single DNS label – see "Option C" from https://github.com/ipfs/in-web-browsers/issues/169 {httpRequest, "dweb.link", "/ipns/dnslink.long-name.example.com", "http://dnslink.long-name.example.com.ipns.dweb.link/", nil}, diff --git a/go.mod b/go.mod index 42c4ddcf7df..db8be4a1dcc 100644 --- a/go.mod +++ b/go.mod @@ -55,7 +55,6 @@ require ( github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 github.com/ipld/go-car v0.3.0 - github.com/jbenet/go-is-domain v1.0.5 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/jbenet/goprocess v0.1.4 diff --git a/go.sum b/go.sum index e0a01f40b19..7c4ffc92ecf 100644 --- a/go.sum +++ b/go.sum @@ -518,8 +518,6 @@ github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+ github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/go-is-domain v1.0.5 h1:r92uiHbMEJo9Fkey5pMBtZAzjPQWic0ieo7Jw1jEuQQ= -github.com/jbenet/go-is-domain v1.0.5/go.mod h1:xbRLRb0S7FgzDBTJlguhDVwLYM/5yNtvktxj2Ttfy7Q= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c h1:uUx61FiAa1GI6ZmVd2wf2vULeQZIKG66eybjNXKYCz4= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c/go.mod h1:sdx1xVM9UuLw1tXnhJWN3piypTUO3vCIHYmG15KE/dU= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= @@ -911,8 +909,6 @@ github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= -github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= @@ -1457,6 +1453,7 @@ golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 28d4d9b327b83cef407a8a79e7162ab54bcfa63d Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 21 Apr 2021 20:36:35 +0200 Subject: [PATCH 136/161] refactor: add isDomainNameAndNotPeerID This ensures we exclude valid PeerIDs from code paths that require DNSLink names. Ref. https://github.com/ipfs/go-ipfs/pull/8071#pullrequestreview-639409245 --- core/corehttp/hostname.go | 20 ++++++++++++++++---- core/corehttp/hostname_test.go | 21 ++++++++++++++++++++- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/core/corehttp/hostname.go b/core/corehttp/hostname.go index b6246e281e8..c02c3aeec0c 100644 --- a/core/corehttp/hostname.go +++ b/core/corehttp/hostname.go @@ -349,15 +349,27 @@ func knownSubdomainDetails(hostname string, knownGateways gatewayHosts) (gw *con return nil, "", "", "", false } +// isDomainNameAndNotPeerID returns bool if string looks like a valid DNS name AND is not a PeerID +func isDomainNameAndNotPeerID(hostname string) bool { + if len(hostname) == 0 { + return false + } + if _, err := peer.Decode(hostname); err == nil { + return false + } + _, ok := dns.IsDomainName(hostname) + return ok +} + // isDNSLinkName returns bool if a valid DNS TXT record exist for provided host func isDNSLinkName(ctx context.Context, ipfs iface.CoreAPI, host string) bool { - fqdn := stripPort(host) + dnslinkName := stripPort(host) - if _, ok := dns.IsDomainName(fqdn); !ok && len(fqdn) == 0 { + if !isDomainNameAndNotPeerID(dnslinkName) { return false } - name := "/ipns/" + fqdn + name := "/ipns/" + dnslinkName // check if DNSLink exists depth := options.Name.ResolveOption(nsopts.Depth(1)) _, err := ipfs.Name().Resolve(ctx, name, depth) @@ -476,7 +488,7 @@ func toSubdomainURL(hostname, path string, r *http.Request, ipfs iface.CoreAPI) } // Normalize problematic PeerIDs (eg. ed25519+identity) to CID representation - if _, ok := dns.IsDomainName(rootID); !ok && isPeerIDNamespace(ns) { + if isPeerIDNamespace(ns) && !isDomainNameAndNotPeerID(rootID) { peerID, err := peer.Decode(rootID) // Note: PeerID CIDv1 with protobuf multicodec will fail, but we fix it // in the next block diff --git a/core/corehttp/hostname_test.go b/core/corehttp/hostname_test.go index 9bee6768ac7..6575ee1e840 100644 --- a/core/corehttp/hostname_test.go +++ b/core/corehttp/hostname_test.go @@ -55,7 +55,7 @@ func TestToSubdomainURL(t *testing.T) { {httpRequest, "localhost", "/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", "http://k2k4r8n0flx3ra0y5dr8fmyvwbzy3eiztmtq6th694k5a3rznayp3e4o.ipns.localhost/", nil}, {httpRequest, "localhost", "/ipns/bafybeickencdqw37dpz3ha36ewrh4undfjt2do52chtcky4rxkj447qhdm", "http://k2k4r8l9ja7hkzynavdqup76ou46tnvuaqegbd04a4o1mpbsey0meucb.ipns.localhost/", nil}, // PeerID: ed25519+identity multihash → CIDv1Base36 - {httpRequest, "localhost", "/ipns/12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5", "http://12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5.ipns.localhost/", nil}, + {httpRequest, "localhost", "/ipns/12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5", "http://k51qzi5uqu5di608geewp3nqkg0bpujoasmka7ftkyxgcm3fh1aroup0gsdrna.ipns.localhost/", nil}, {httpRequest, "sub.localhost", "/ipfs/QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n", "http://bafybeif7a7gdklt6hodwdrmwmxnhksctcuav6lfxlcyfz4khzl3qfmvcgu.ipfs.sub.localhost/", nil}, // HTTPS requires DNSLink name to fit in a single DNS label – see "Option C" from https://github.com/ipfs/in-web-browsers/issues/169 {httpRequest, "dweb.link", "/ipns/dnslink.long-name.example.com", "http://dnslink.long-name.example.com.ipns.dweb.link/", nil}, @@ -144,6 +144,25 @@ func TestHasPrefix(t *testing.T) { } } +func TestIsDomainNameAndNotPeerID(t *testing.T) { + for _, test := range []struct { + hostname string + out bool + }{ + {"", false}, + {"example.com", true}, + {"non-icann.something", true}, + {"..", false}, + {"12D3KooWFB51PRY9BxcXSH6khFXw1BZeszeLDy7C8GciskqCTZn5", false}, // valid peerid + {"k51qzi5uqu5di608geewp3nqkg0bpujoasmka7ftkyxgcm3fh1aroup0gsdrna", false}, // valid peerid + } { + out := isDomainNameAndNotPeerID(test.hostname) + if out != test.out { + t.Errorf("(%s) returned '%t', expected '%t'", test.hostname, out, test.out) + } + } +} + func TestPortStripping(t *testing.T) { for _, test := range []struct { in string From 2fd55d198cb2dec4caf1170955a9934cbb3b64e1 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Mon, 5 Apr 2021 12:48:32 -0400 Subject: [PATCH 137/161] integrate experimental AcceleratedDHTClient The experimental AcceleratedDHTClient can be enabled from the config When enabled it modifies the output of the `ipfs stats dht` command. --- core/commands/dht.go | 56 ++++++++++++-------- core/commands/stat_dht.go | 54 ++++++++++++++++++- core/core.go | 7 ++- core/node/groups.go | 2 +- core/node/libp2p/host.go | 2 +- core/node/libp2p/routing.go | 97 +++++++++++++++++++++++++++++----- core/node/libp2p/routingopt.go | 1 - go.mod | 4 +- go.sum | 15 ++++-- 9 files changed, 190 insertions(+), 48 deletions(-) diff --git a/core/commands/dht.go b/core/commands/dht.go index 07136a72379..c481c776a99 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -45,6 +45,12 @@ const ( dhtVerboseOptionName = "verbose" ) +// kademlia extends the routing interface with a command to get the peers closest to the target +type kademlia interface { + routing.Routing + GetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) +} + var queryDhtCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Find the closest Peer IDs to a given Peer ID by querying the DHT.", @@ -63,7 +69,7 @@ var queryDhtCmd = &cmds.Command{ return err } - if nd.DHT == nil { + if nd.DHTClient == nil { return ErrNotDHT } @@ -73,40 +79,46 @@ var queryDhtCmd = &cmds.Command{ } ctx, cancel := context.WithCancel(req.Context) + defer cancel() ctx, events := routing.RegisterForQueryEvents(ctx) - dht := nd.DHT.WAN - if !nd.DHT.WANActive() { - dht = nd.DHT.LAN + client := nd.DHTClient + if client == nd.DHT { + client = nd.DHT.WAN + if !nd.DHT.WANActive() { + client = nd.DHT.LAN + } } - errCh := make(chan error, 1) - go func() { - defer close(errCh) - defer cancel() - closestPeers, err := dht.GetClosestPeers(ctx, string(id)) - if closestPeers != nil { - for p := range closestPeers { + if d, ok := client.(kademlia); !ok { + return fmt.Errorf("dht client does not support GetClosestPeers") + } else { + errCh := make(chan error, 1) + go func() { + defer close(errCh) + defer cancel() + closestPeers, err := d.GetClosestPeers(ctx, string(id)) + for _, p := range closestPeers { routing.PublishQueryEvent(ctx, &routing.QueryEvent{ ID: p, Type: routing.FinalPeer, }) } - } - if err != nil { - errCh <- err - return - } - }() + if err != nil { + errCh <- err + return + } + }() - for e := range events { - if err := res.Emit(e); err != nil { - return err + for e := range events { + if err := res.Emit(e); err != nil { + return err + } } - } - return <-errCh + return <-errCh + } }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *routing.QueryEvent) error { diff --git a/core/commands/stat_dht.go b/core/commands/stat_dht.go index a8b5323c507..c76fce2c05e 100644 --- a/core/commands/stat_dht.go +++ b/core/commands/stat_dht.go @@ -12,6 +12,7 @@ import ( "github.com/libp2p/go-libp2p-core/network" pstore "github.com/libp2p/go-libp2p-core/peerstore" dht "github.com/libp2p/go-libp2p-kad-dht" + "github.com/libp2p/go-libp2p-kad-dht/fullrt" kbucket "github.com/libp2p/go-libp2p-kbucket" ) @@ -43,7 +44,8 @@ This interface is not stable and may change from release to release. `, }, Arguments: []cmds.Argument{ - cmds.StringArg("dht", false, true, "The DHT whose table should be listed (wan or lan). Defaults to both."), + cmds.StringArg("dht", false, true, "The DHT whose table should be listed (wanserver, lanserver, wan, lan). "+ + "wan and lan refer to client routing tables. When using the experimental DHT client only WAN is supported. Defaults to wan and lan."), }, Options: []cmds.Option{}, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { @@ -67,12 +69,62 @@ This interface is not stable and may change from release to release. dhts = []string{"wan", "lan"} } + dhttypeloop: for _, name := range dhts { var dht *dht.IpfsDHT + + var separateClient bool + if nd.DHTClient != nd.DHT { + separateClient = true + } + switch name { case "wan": + if separateClient { + client, ok := nd.DHTClient.(*fullrt.FullRT) + if !ok { + return cmds.Errorf(cmds.ErrClient, "could not generate stats for the WAN DHT client type") + } + peerMap := client.Stat() + buckets := make([]dhtBucket, 1) + b := &dhtBucket{} + for _, p := range peerMap { + info := dhtPeerInfo{ID: p.String()} + + if ver, err := nd.Peerstore.Get(p, "AgentVersion"); err == nil { + info.AgentVersion, _ = ver.(string) + } else if err == pstore.ErrNotFound { + // ignore + } else { + // this is a bug, usually. + log.Errorw( + "failed to get agent version from peerstore", + "error", err, + ) + } + + info.Connected = nd.PeerHost.Network().Connectedness(p) == network.Connected + b.Peers = append(b.Peers, info) + } + buckets[0] = *b + + if err := res.Emit(dhtStat{ + Name: name, + Buckets: buckets, + }); err != nil { + return err + } + continue dhttypeloop + } + fallthrough + case "wanserver": dht = nd.DHT.WAN case "lan": + if separateClient { + return cmds.Errorf(cmds.ErrClient, "no LAN client found") + } + fallthrough + case "lanserver": dht = nd.DHT.LAN default: return cmds.Errorf(cmds.ErrClient, "unknown dht type: %s", name) diff --git a/core/core.go b/core/core.go index 75fc95ff7d8..49f1185646b 100644 --- a/core/core.go +++ b/core/core.go @@ -98,8 +98,11 @@ type IpfsNode struct { PubSub *pubsub.PubSub `optional:"true"` PSRouter *psrouter.PubsubValueStore `optional:"true"` - DHT *ddht.DHT `optional:"true"` - P2P *p2p.P2P `optional:"true"` + + DHT *ddht.DHT `optional:"true"` + DHTClient routing.Routing `name:"dhtc" optional:"true"` + + P2P *p2p.P2P `optional:"true"` Process goprocess.Process ctx context.Context diff --git a/core/node/groups.go b/core/node/groups.go index 6863043396c..f55b052c380 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -139,7 +139,7 @@ func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option { fx.Provide(libp2p.Security(!bcfg.DisableEncryptedConnections, cfg.Swarm.Transports)), fx.Provide(libp2p.Routing), - fx.Provide(libp2p.BaseRouting), + fx.Provide(libp2p.BaseRouting(cfg.Experimental.AcceleratedDHTClient)), maybeProvide(libp2p.PubsubRouter, bcfg.getOpt("ipnsps")), maybeProvide(libp2p.BandwidthCounter, !cfg.Swarm.DisableBandwidthMetrics), diff --git a/core/node/libp2p/host.go b/core/node/libp2p/host.go index 4005f0a7e74..04682682b48 100644 --- a/core/node/libp2p/host.go +++ b/core/node/libp2p/host.go @@ -34,7 +34,7 @@ type P2PHostOut struct { fx.Out Host host.Host - Routing BaseIpfsRouting + Routing routing.Routing `name:"initialrouting"` } func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (out P2PHostOut, err error) { diff --git a/core/node/libp2p/routing.go b/core/node/libp2p/routing.go index 14b8fa40c10..b249611cc49 100644 --- a/core/node/libp2p/routing.go +++ b/core/node/libp2p/routing.go @@ -7,9 +7,12 @@ import ( "github.com/ipfs/go-ipfs/core/node/helpers" + "github.com/ipfs/go-ipfs/repo" host "github.com/libp2p/go-libp2p-core/host" routing "github.com/libp2p/go-libp2p-core/routing" + dht "github.com/libp2p/go-libp2p-kad-dht" ddht "github.com/libp2p/go-libp2p-kad-dht/dual" + "github.com/libp2p/go-libp2p-kad-dht/fullrt" "github.com/libp2p/go-libp2p-pubsub" namesys "github.com/libp2p/go-libp2p-pubsub-router" record "github.com/libp2p/go-libp2p-record" @@ -32,23 +35,89 @@ type p2pRouterOut struct { Router Router `group:"routers"` } -func BaseRouting(lc fx.Lifecycle, in BaseIpfsRouting) (out p2pRouterOut, dr *ddht.DHT) { - if dht, ok := in.(*ddht.DHT); ok { - dr = dht +type processInitialRoutingIn struct { + fx.In + + Router routing.Routing `name:"initialrouting"` + + // For setting up experimental DHT client + Host host.Host + Repo repo.Repo + Validator record.Validator +} + +type processInitialRoutingOut struct { + fx.Out + + Router Router `group:"routers"` + DHT *ddht.DHT + DHTClient routing.Routing `name:"dhtc"` + BaseRT BaseIpfsRouting +} - lc.Append(fx.Hook{ - OnStop: func(ctx context.Context) error { - return dr.Close() +func BaseRouting(experimentalDHTClient bool) interface{} { + return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, in processInitialRoutingIn) (out processInitialRoutingOut, err error) { + var dr *ddht.DHT + if dht, ok := in.Router.(*ddht.DHT); ok { + dr = dht + + lc.Append(fx.Hook{ + OnStop: func(ctx context.Context) error { + return dr.Close() + }, + }) + } + + if dr != nil && experimentalDHTClient { + cfg, err := in.Repo.Config() + if err != nil { + return out, err + } + bspeers, err := cfg.BootstrapPeers() + if err != nil { + return out, err + } + + expClient, err := fullrt.NewFullRT(in.Host, + dht.DefaultPrefix, + fullrt.DHTOption( + dht.Validator(in.Validator), + dht.Datastore(in.Repo.Datastore()), + dht.BootstrapPeers(bspeers...), + dht.BucketSize(20), + ), + ) + if err != nil { + return out, err + } + + lc.Append(fx.Hook{ + OnStop: func(ctx context.Context) error { + return expClient.Close() + }, + }) + + return processInitialRoutingOut{ + Router: Router{ + Routing: expClient, + Priority: 1000, + }, + DHT: dr, + DHTClient: expClient, + BaseRT: expClient, + }, nil + } + + return processInitialRoutingOut{ + Router: Router{ + Priority: 1000, + Routing: in.Router, }, - }) + DHT: dr, + DHTClient: dr, + BaseRT: in.Router, + }, nil } - - return p2pRouterOut{ - Router: Router{ - Priority: 1000, - Routing: in, - }, - }, dr } type p2pOnlineRoutingIn struct { diff --git a/core/node/libp2p/routingopt.go b/core/node/libp2p/routingopt.go index 96bd8be4c26..6d29cb6caf1 100644 --- a/core/node/libp2p/routingopt.go +++ b/core/node/libp2p/routingopt.go @@ -2,7 +2,6 @@ package libp2p import ( "context" - "github.com/ipfs/go-datastore" host "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/peer" diff --git a/go.mod b/go.mod index f90636ae894..21388775322 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/ipfs/go-ipfs-blockstore v0.1.4 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 - github.com/ipfs/go-ipfs-config v0.13.0 + github.com/ipfs/go-ipfs-config v0.14.0 github.com/ipfs/go-ipfs-exchange-interface v0.0.1 github.com/ipfs/go-ipfs-exchange-offline v0.0.1 github.com/ipfs/go-ipfs-files v0.0.8 @@ -65,7 +65,7 @@ require ( github.com/libp2p/go-libp2p-core v0.8.5 github.com/libp2p/go-libp2p-discovery v0.5.0 github.com/libp2p/go-libp2p-http v0.2.0 - github.com/libp2p/go-libp2p-kad-dht v0.11.1 + github.com/libp2p/go-libp2p-kad-dht v0.12.0 github.com/libp2p/go-libp2p-kbucket v0.4.7 github.com/libp2p/go-libp2p-loggables v0.1.0 github.com/libp2p/go-libp2p-mplex v0.4.1 diff --git a/go.sum b/go.sum index b345652a262..b9772aeeef5 100644 --- a/go.sum +++ b/go.sum @@ -271,8 +271,9 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -411,8 +412,8 @@ github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7Na github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw= github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk= -github.com/ipfs/go-ipfs-config v0.13.0 h1:ZH3dTmkVR9TTFBIbfWnFNC1JdwHbj8F0ryiaIFo7U/o= -github.com/ipfs/go-ipfs-config v0.13.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= +github.com/ipfs/go-ipfs-config v0.14.0 h1:KijwGU788UycqPWv4GxzyfyN6EtfJjjDRzd/wSA86VU= +github.com/ipfs/go-ipfs-config v0.14.0/go.mod h1:Ei/FLgHGTdPyqCPK0oPCwGTe8VSnsjJjx7HZqUb6Ry0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= @@ -677,8 +678,10 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.1/go.mod h1:GarlRLH0LdeWcLnYM github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= -github.com/libp2p/go-libp2p-kad-dht v0.11.1 h1:FsriVQhOUZpCotWIjyFSjEDNJmUzuMma/RyyTDZanwc= github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= +github.com/libp2p/go-libp2p-kad-dht v0.12.0 h1:R5vvp8kuXjsyDE/HEMKgM8XIwlRsP5BdAZexM+tJxdU= +github.com/libp2p/go-libp2p-kad-dht v0.12.0/go.mod h1:zdQYru1c7dnluMpZls4i9Fj2TwYXS7YyDkJ1Yahv0w0= +github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= github.com/libp2p/go-libp2p-loggables v0.0.1/go.mod h1:lDipDlBNYbpyqyPX/KcoO+eq0sJYEVR2JgOexcivchg= @@ -777,6 +780,8 @@ github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D github.com/libp2p/go-libp2p-transport-upgrader v0.4.0/go.mod h1:J4ko0ObtZSmgn5BX5AmegP+dK3CSnU2lMCKsSq/EY0s= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2 h1:4JsnbfJzgZeRS9AWN7B9dPqn/LY/HoQTlO9gtdJTIYM= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= +github.com/libp2p/go-libp2p-xor v0.0.0-20200501025846-71e284145d58 h1:GcTNu27BMpOTtMnQqun03+kbtHA1qTxJ/J8cZRRYu2k= +github.com/libp2p/go-libp2p-xor v0.0.0-20200501025846-71e284145d58/go.mod h1:AYjOiqJIdcmI4SXE2ouKQuFrUbE5myv8txWaB2pl4TI= github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8= github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= @@ -1208,6 +1213,7 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20190328234359-8b3e70f8e830/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a h1:G++j5e0OC488te356JvdhaM8YS6nMsjLAYF7JxCv07w= @@ -1312,6 +1318,7 @@ golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf h1:B2n+Zi5QeYRDAEodEu72OS36gmTWjgpXr2+cWcBW90o= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= From cf45f1a8621b965eb89bebaca5574bb8cb53ca43 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Wed, 12 May 2021 23:56:19 -0400 Subject: [PATCH 138/161] added support for an experimental batched provider system The batched provider system is enabled when the experimental AcceleratedDHTClient is enabled There is also an `ipfs stats provide` command which gives stats about the providing/reproviding system when the batched provider system is enabled --- core/commands/commands_test.go | 1 + core/commands/stat.go | 1 + core/commands/stat_provide.go | 51 +++++++++++++++++++++++++++++ core/node/groups.go | 4 +-- core/node/provider.go | 60 +++++++++++++++++++++++++++++++--- go.mod | 2 +- go.sum | 4 +-- 7 files changed, 114 insertions(+), 9 deletions(-) create mode 100644 core/commands/stat_provide.go diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index ef106acb393..81f07c01bf4 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -210,6 +210,7 @@ func TestCommands(t *testing.T) { "/stats/bitswap", "/stats/bw", "/stats/dht", + "/stats/provide", "/stats/repo", "/swarm", "/swarm/addrs", diff --git a/core/commands/stat.go b/core/commands/stat.go index cc51d7123a7..e38b5b31b34 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -30,6 +30,7 @@ for your IPFS node.`, "repo": repoStatCmd, "bitswap": bitswapStatCmd, "dht": statDhtCmd, + "provide": statProvideCmd, }, } diff --git a/core/commands/stat_provide.go b/core/commands/stat_provide.go new file mode 100644 index 00000000000..ac02c344cd6 --- /dev/null +++ b/core/commands/stat_provide.go @@ -0,0 +1,51 @@ +package commands + +import ( + "fmt" + + cmds "github.com/ipfs/go-ipfs-cmds" + "github.com/ipfs/go-ipfs/core/commands/cmdenv" + + "github.com/ipfs/go-ipfs-provider/batched" +) + +var statProvideCmd = &cmds.Command{ + Helptext: cmds.HelpText{ + Tagline: "Returns statistics about the node's (re)provider system.", + ShortDescription: ` +Returns statistics about the content the node is advertising. + +This interface is not stable and may change from release to release. +`, + }, + Arguments: []cmds.Argument{}, + Options: []cmds.Option{}, + Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { + nd, err := cmdenv.GetNode(env) + if err != nil { + return err + } + + if !nd.IsOnline { + return ErrNotOnline + } + + sys, ok := nd.Provider.(*batched.BatchProvidingSystem) + if !ok { + return fmt.Errorf("can only return stats if Experimental.AcceleratedDHTClient is enabled") + } + + stats, err := sys.Stat(req.Context) + if err != nil { + return err + } + + if err := res.Emit(stats); err != nil { + return err + } + + return nil + }, + Encoders: cmds.EncoderMap{}, + Type: batched.BatchedProviderStats{}, +} diff --git a/core/node/groups.go b/core/node/groups.go index f55b052c380..8d37f84ce13 100644 --- a/core/node/groups.go +++ b/core/node/groups.go @@ -275,7 +275,7 @@ func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option { fx.Provide(p2p.New), LibP2P(bcfg, cfg), - OnlineProviders(cfg.Experimental.StrategicProviding, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), + OnlineProviders(cfg.Experimental.StrategicProviding, cfg.Experimental.AcceleratedDHTClient, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), ) } @@ -286,7 +286,7 @@ func Offline(cfg *config.Config) fx.Option { fx.Provide(DNSResolver), fx.Provide(Namesys(0)), fx.Provide(offroute.NewOfflineRouter), - OfflineProviders(cfg.Experimental.StrategicProviding, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), + OfflineProviders(cfg.Experimental.StrategicProviding, cfg.Experimental.AcceleratedDHTClient, cfg.Reprovider.Strategy, cfg.Reprovider.Interval), ) } diff --git a/core/node/provider.go b/core/node/provider.go index 52d48036efc..e865d2b5fd9 100644 --- a/core/node/provider.go +++ b/core/node/provider.go @@ -7,13 +7,16 @@ import ( "github.com/ipfs/go-ipfs-pinner" "github.com/ipfs/go-ipfs-provider" + "github.com/ipfs/go-ipfs-provider/batched" q "github.com/ipfs/go-ipfs-provider/queue" "github.com/ipfs/go-ipfs-provider/simple" ipld "github.com/ipfs/go-ipld-format" "github.com/libp2p/go-libp2p-core/routing" + "github.com/multiformats/go-multihash" "go.uber.org/fx" "github.com/ipfs/go-ipfs/core/node/helpers" + "github.com/ipfs/go-ipfs/core/node/libp2p" "github.com/ipfs/go-ipfs/repo" ) @@ -59,29 +62,78 @@ func SimpleProviderSys(isOnline bool) interface{} { } } +type provideMany interface { + ProvideMany(ctx context.Context, keys []multihash.Multihash) error + Ready() bool +} + +// BatchedProviderSys creates new provider system +func BatchedProviderSys(isOnline bool, reprovideInterval string) interface{} { + return func(lc fx.Lifecycle, cr libp2p.BaseIpfsRouting, q *q.Queue, keyProvider simple.KeyChanFunc, repo repo.Repo) (provider.System, error) { + r, ok := (cr).(provideMany) + if !ok { + return nil, fmt.Errorf("BatchedProviderSys requires a content router that supports provideMany") + } + + reprovideIntervalDuration := kReprovideFrequency + if reprovideInterval != "" { + dur, err := time.ParseDuration(reprovideInterval) + if err != nil { + return nil, err + } + + reprovideIntervalDuration = dur + } + + sys, err := batched.New(r, q, + batched.ReproviderInterval(reprovideIntervalDuration), + batched.Datastore(repo.Datastore()), + batched.KeyProvider(keyProvider)) + if err != nil { + return nil, err + } + + if isOnline { + lc.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + sys.Run() + return nil + }, + OnStop: func(ctx context.Context) error { + return sys.Close() + }, + }) + } + + return sys, nil + } +} + // ONLINE/OFFLINE // OnlineProviders groups units managing provider routing records online -func OnlineProviders(useStrategicProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option { +func OnlineProviders(useStrategicProviding bool, useBatchedProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option { if useStrategicProviding { return fx.Provide(provider.NewOfflineProvider) } return fx.Options( SimpleProviders(reprovideStrategy, reprovideInterval), - fx.Provide(SimpleProviderSys(true)), + maybeProvide(SimpleProviderSys(true), !useBatchedProviding), + maybeProvide(BatchedProviderSys(true, reprovideInterval), useBatchedProviding), ) } // OfflineProviders groups units managing provider routing records offline -func OfflineProviders(useStrategicProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option { +func OfflineProviders(useStrategicProviding bool, useBatchedProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option { if useStrategicProviding { return fx.Provide(provider.NewOfflineProvider) } return fx.Options( SimpleProviders(reprovideStrategy, reprovideInterval), - fx.Provide(SimpleProviderSys(false)), + maybeProvide(SimpleProviderSys(false), true), + //maybeProvide(BatchedProviderSys(false, reprovideInterval), useBatchedProviding), ) } diff --git a/go.mod b/go.mod index 21388775322..99c39198158 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/ipfs/go-ipfs-keystore v0.0.2 github.com/ipfs/go-ipfs-pinner v0.1.1 github.com/ipfs/go-ipfs-posinfo v0.0.1 - github.com/ipfs/go-ipfs-provider v0.4.3 + github.com/ipfs/go-ipfs-provider v0.4.4-0.20210513014626-1c19caa05024 github.com/ipfs/go-ipfs-routing v0.1.0 github.com/ipfs/go-ipfs-util v0.0.2 github.com/ipfs/go-ipld-cbor v0.0.5 diff --git a/go.sum b/go.sum index b9772aeeef5..49d9cc81d40 100644 --- a/go.sum +++ b/go.sum @@ -436,8 +436,8 @@ github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqt github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= -github.com/ipfs/go-ipfs-provider v0.4.3 h1:k54OHXZcFBkhL6l3GnPS9PfpaLeLqZjVASG1bgfBdfQ= -github.com/ipfs/go-ipfs-provider v0.4.3/go.mod h1:rcQBVqfblDQRk5LaCtf2uxuKxMJxvKmF5pLS0pO4au4= +github.com/ipfs/go-ipfs-provider v0.4.4-0.20210513014626-1c19caa05024 h1:eYfdZ27ogtwfnwKdfphOwcQ7PEOjKqXlWzVOakK0a60= +github.com/ipfs/go-ipfs-provider v0.4.4-0.20210513014626-1c19caa05024/go.mod h1:kUMTf1R8c+KgWUWKTGSZiXCDZWMCkxCX3wyepk0cYEA= github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= github.com/ipfs/go-ipfs-routing v0.1.0 h1:gAJTT1cEeeLj6/DlLX6t+NxD9fQe2ymTO6qWRDI/HQQ= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= From a67cab1c60bc3165d7492355863b6dd847c4fb14 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 13 May 2021 01:05:04 -0400 Subject: [PATCH 139/161] docs: added experimental features documentation on the Accelerated DHT Client and batched providing system --- docs/experimental-features.md | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/docs/experimental-features.md b/docs/experimental-features.md index 600bc1a0154..9b0bffa1e0f 100644 --- a/docs/experimental-features.md +++ b/docs/experimental-features.md @@ -26,6 +26,7 @@ the above issue. - [Strategic Providing](#strategic-providing) - [Graphsync](#graphsync) - [Noise](#noise) +- [Accelerated DHT Client](#accelerated-dht-client) --- @@ -547,3 +548,56 @@ ipfs config --json Experimental.GraphsyncEnabled true Stable, enabled by default [Noise](https://github.com/libp2p/specs/tree/master/noise) libp2p transport based on the [Noise Protocol Framework](https://noiseprotocol.org/noise.html). While TLS remains the default transport in go-ipfs, Noise is easier to implement and is thus the "interop" transport between IPFS and libp2p implementations. + +## Accelerated DHT Client + +### In Version + +0.9.0 + +### State + +Experimental, default-disabled. + +Utilizes an alternative DHT client that searches for and maintains more information about the network +in exchange for being more performant. + +When it is enabled: +- DHT operations should complete much faster than with it disabled +- A batching reprovider system will be enabled which takes advantage of some properties of the experimental client to + very efficiently put provider records into the network +- The standard DHT client (and server if enabled) are run alongside the alternative client +- The operations `ipfs stats dht` and `ipfs stats provide` will have different outputs + - `ipfs stats provide` only works when the accelerated DHT client is enabled and shows various statistics regarding + the provider/reprovider system + - `ipfs stats dht` will default to showing information about the new client + +**Caveats:** +1. Running the experimental client likely will result in more resource consumption (connections, RAM, CPU, bandwidth) + - Users that are limited in the number of parallel connections their machines/networks can perform will likely suffer + - Currently, the resource usage is not smooth as the client crawls the network in rounds and reproviding is similarly + done in rounds + - Users who previously had a lot of content but were unable to advertise it on the network will see an increase in + egress bandwidth as their nodes start to advertise all of their CIDs into the network. If you have lots of data + entering your node that you don't want to advertise consider using [Reprovider Strategies](config.md#reproviderstrategy) + to reduce the number of CIDs that you are reproviding. Similarly, if you are running a node that deals mostly with + short-lived temporary data (e.g. you use a separate node for ingesting data then for storing and serving it) then + you may benefit from using [Strategic Providing](#strategic-providing) to prevent advertising of data that you + ultimately will not have. +2. Currently, the DHT is not usable for queries for the first 5-10 minutes of operation as the routing table is being +prepared. This means operations like searching the DHT for particular peers or content will not work + - You can see if the DHT has been initially populated by running `ipfs stats dht` +3. Currently, the accelerated DHT client is not compatible with LAN-based DHTs and will not perform operations against +them + +### How to enable + +``` +ipfs config --json Experimental.AcceleratedDHTClient true +``` + +### Road to being a real feature + +- [ ] Needs more people to use and report on how well it works +- [ ] Should be usable for queries (even if slower/less efficient) shortly after startup +- [ ] Should be usable with non-WAN DHTs \ No newline at end of file From 01ef535aab8f531c78b18dd41ae71093642928b2 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Fri, 14 May 2021 06:14:27 -0400 Subject: [PATCH 140/161] Release v0.9.0-rc1 --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index 52e4c6daf3b..d3f4916d6dd 100644 --- a/version.go +++ b/version.go @@ -4,7 +4,7 @@ package ipfs var CurrentCommit string // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.9.0-dev" +const CurrentVersionNumber = "0.9.0-rc1" const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/" From 7881e518d6ea49065cae6aaf5b8e100f22ff3731 Mon Sep 17 00:00:00 2001 From: Bogdan Stirbat Date: Mon, 17 May 2021 19:13:07 +0300 Subject: [PATCH 141/161] refactor(pinmfs): log error if pre-existing pin failed (#8056) * pinmfs: log error if pin failed * refactor: log pre-existing remote mfs pins This cleans up debug logging and ensures we use %q for data read from remote services. We log pre-existing pins for MFS root and print ERROR if pin for current root has status "failed", otherwise, we log to debug. Co-authored-by: Marcin Rataj (cherry picked from commit 075cc8f35674bb30388faa7a3e73099a649cecf6) --- cmd/ipfs/pinmfs.go | 34 ++++++++++++++++++++-------------- cmd/ipfs/pinmfs_test.go | 4 ++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/cmd/ipfs/pinmfs.go b/cmd/ipfs/pinmfs.go index 5d17f3013f3..8ea9d2dcc8e 100644 --- a/cmd/ipfs/pinmfs.go +++ b/cmd/ipfs/pinmfs.go @@ -138,9 +138,9 @@ func pinAllMFS(ctx context.Context, node pinMFSNode, cfg *config.Config, rootCid for svcName_, svcConfig_ := range cfg.Pinning.RemoteServices { // skip services where MFS is not enabled svcName, svcConfig := svcName_, svcConfig_ - mfslog.Debugf("pinning considering service %s for mfs pinning", svcName) + mfslog.Debugf("pinning MFS root considering service %q", svcName) if !svcConfig.Policies.MFS.Enable { - mfslog.Debugf("pinning service %s is not enabled", svcName) + mfslog.Debugf("pinning service %q is not enabled", svcName) ch <- lastPin{} continue } @@ -153,7 +153,7 @@ func pinAllMFS(ctx context.Context, node pinMFSNode, cfg *config.Config, rootCid repinInterval, err = time.ParseDuration(svcConfig.Policies.MFS.RepinInterval) if err != nil { select { - case errCh <- fmt.Errorf("remote pinning service %s has invalid MFS.RepinInterval (%v)", svcName, err): + case errCh <- fmt.Errorf("remote pinning service %q has invalid MFS.RepinInterval (%v)", svcName, err): case <-ctx.Done(): } ch <- lastPin{} @@ -165,20 +165,20 @@ func pinAllMFS(ctx context.Context, node pinMFSNode, cfg *config.Config, rootCid if last, ok := lastPins[svcName]; ok { if last.ServiceConfig == svcConfig && (last.CID == rootCid || time.Since(last.Time) < repinInterval) { if last.CID == rootCid { - mfslog.Debugf("pinning MFS root to %s: pin for %s exists since %s, skipping", svcName, rootCid, last.Time.String()) + mfslog.Debugf("pinning MFS root to %q: pin for %q exists since %s, skipping", svcName, rootCid, last.Time.String()) } else { - mfslog.Debugf("pinning MFS root to %s: skipped due to MFS.RepinInterval=%s (remaining: %s)", svcName, repinInterval.String(), (repinInterval - time.Since(last.Time)).String()) + mfslog.Debugf("pinning MFS root to %q: skipped due to MFS.RepinInterval=%s (remaining: %s)", svcName, repinInterval.String(), (repinInterval - time.Since(last.Time)).String()) } ch <- lastPin{} continue } } - mfslog.Debugf("pinning MFS root %s to %s", rootCid, svcName) + mfslog.Debugf("pinning MFS root %q to %q", rootCid, svcName) go func() { if r, err := pinMFS(ctx, node, rootCid, svcName, svcConfig); err != nil { select { - case errCh <- fmt.Errorf("pinning MFS root %s to %s (%v)", rootCid, svcName, err): + case errCh <- fmt.Errorf("pinning MFS root %q to %q (%v)", rootCid, svcName, err): case <-ctx.Done(): } ch <- lastPin{} @@ -212,12 +212,18 @@ func pinMFS( pinStatuses := []pinclient.Status{pinclient.StatusQueued, pinclient.StatusPinning, pinclient.StatusPinned, pinclient.StatusFailed} lsPinCh, lsErrCh := c.Ls(ctx, pinclient.PinOpts.FilterName(pinName), pinclient.PinOpts.FilterStatus(pinStatuses...)) existingRequestID := "" // is there any pre-existing MFS pin with pinName (for any CID)? - alreadyPinned := false // is CID for current MFS already pinned? + pinning := false // is CID for current MFS already being pinned? pinTime := time.Now().UTC() + pinStatusMsg := "pinning to %q: received pre-existing %q status for %q (requestid=%q)" for ps := range lsPinCh { existingRequestID = ps.GetRequestId() + if ps.GetPin().GetCid() == cid && ps.GetStatus() == pinclient.StatusFailed { + mfslog.Errorf(pinStatusMsg, svcName, pinclient.StatusFailed, cid, existingRequestID) + } else { + mfslog.Debugf(pinStatusMsg, svcName, ps.GetStatus(), ps.GetPin().GetCid(), existingRequestID) + } if ps.GetPin().GetCid() == cid && ps.GetStatus() != pinclient.StatusFailed { - alreadyPinned = true + pinning = true pinTime = ps.GetCreated().UTC() break } @@ -228,9 +234,9 @@ func pinMFS( return lastPin{}, fmt.Errorf("error while listing remote pins: %v", err) } - // CID of the current MFS root is already pinned, nothing to do - if alreadyPinned { - mfslog.Debugf("pinning MFS to %s: pin for %s exists since %s, skipping", svcName, cid, pinTime.String()) + // CID of the current MFS root is already being pinned, nothing to do + if pinning { + mfslog.Debugf("pinning MFS to %q: pin for %q exists since %s, skipping", svcName, cid, pinTime.String()) return lastPin{Time: pinTime, ServiceName: svcName, ServiceConfig: svcConfig, CID: cid}, nil } @@ -250,13 +256,13 @@ func pinMFS( // Create or replace pin for MFS root if existingRequestID != "" { - mfslog.Debugf("pinning to %s: replacing existing MFS root pin with %s", svcName, cid) + mfslog.Debugf("pinning to %q: replacing existing MFS root pin with %q", svcName, cid) _, err := c.Replace(ctx, existingRequestID, cid, addOpts...) if err != nil { return lastPin{}, err } } else { - mfslog.Debugf("pinning to %s: creating a new MFS root pin for %s", svcName, cid) + mfslog.Debugf("pinning to %q: creating a new MFS root pin for %q", svcName, cid) _, err := c.Add(ctx, cid, addOpts...) if err != nil { return lastPin{}, err diff --git a/cmd/ipfs/pinmfs_test.go b/cmd/ipfs/pinmfs_test.go index 42ffe9d408e..e38e196beb3 100644 --- a/cmd/ipfs/pinmfs_test.go +++ b/cmd/ipfs/pinmfs_test.go @@ -9,7 +9,7 @@ import ( config "github.com/ipfs/go-ipfs-config" ipld "github.com/ipfs/go-ipld-format" - "github.com/ipfs/go-merkledag" + merkledag "github.com/ipfs/go-merkledag" "github.com/libp2p/go-libp2p-core/host" peer "github.com/libp2p/go-libp2p-core/peer" ) @@ -149,7 +149,7 @@ func TestPinMFSService(t *testing.T) { }, }, } - testPinMFSServiceWithError(t, cfg_invalid_interval, "remote pinning service invalid_interval has invalid MFS.RepinInterval") + testPinMFSServiceWithError(t, cfg_invalid_interval, "remote pinning service \"invalid_interval\" has invalid MFS.RepinInterval") testPinMFSServiceWithError(t, cfg_valid_unnamed, "error while listing remote pins: empty response from remote pinning service") testPinMFSServiceWithError(t, cfg_valid_named, "error while listing remote pins: empty response from remote pinning service") } From e14c03faf24d9a45b220129d891ba012114472e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 May 2021 11:14:10 +0000 Subject: [PATCH 142/161] build(deps): bump github.com/ipfs/go-bitswap from 0.3.3 to 0.3.4 Bumps [github.com/ipfs/go-bitswap](https://github.com/ipfs/go-bitswap) from 0.3.3 to 0.3.4. - [Release notes](https://github.com/ipfs/go-bitswap/releases) - [Commits](https://github.com/ipfs/go-bitswap/compare/v0.3.3...v0.3.4) Signed-off-by: dependabot[bot] (cherry picked from commit 6a029a48ab16a9828a35ff067b139455449e4b64) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 99c39198158..4d69e9ff55c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/gabriel-vasile/mimetype v1.2.0 github.com/go-bindata/go-bindata/v3 v3.1.3 github.com/hashicorp/go-multierror v1.1.1 - github.com/ipfs/go-bitswap v0.3.3 + github.com/ipfs/go-bitswap v0.3.4 github.com/ipfs/go-block-format v0.0.3 github.com/ipfs/go-blockservice v0.1.4 github.com/ipfs/go-cid v0.0.7 diff --git a/go.sum b/go.sum index 49d9cc81d40..208818f43e3 100644 --- a/go.sum +++ b/go.sum @@ -343,8 +343,8 @@ github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSA github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= github.com/ipfs/go-bitswap v0.1.3/go.mod h1:YEQlFy0kkxops5Vy+OxWdRSEZIoS7I7KDIwoa5Chkps= github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= -github.com/ipfs/go-bitswap v0.3.3 h1:CrTO3OiOYFBcdliw074/C7T2QYHEOsPClgvR6RIYcO4= -github.com/ipfs/go-bitswap v0.3.3/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= +github.com/ipfs/go-bitswap v0.3.4 h1:AhJhRrG8xkxh6x87b4wWs+4U4y3DVB3doI8yFNqgQME= +github.com/ipfs/go-bitswap v0.3.4/go.mod h1:4T7fvNv/LmOys+21tnLzGKncMeeXUYUd1nUiJ2teMvI= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= From d53e9fa6f0ac63562f174f4f14d697120b5fba84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 May 2021 11:17:09 +0000 Subject: [PATCH 143/161] build(deps): bump github.com/libp2p/go-doh-resolver from 0.3.0 to 0.3.1 Bumps [github.com/libp2p/go-doh-resolver](https://github.com/libp2p/go-doh-resolver) from 0.3.0 to 0.3.1. - [Release notes](https://github.com/libp2p/go-doh-resolver/releases) - [Commits](https://github.com/libp2p/go-doh-resolver/compare/v0.3.0...v0.3.1) Signed-off-by: dependabot[bot] (cherry picked from commit 482d7ed532bedf8f74fbc823e7fa2363277e96bb) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4d69e9ff55c..5acc27789ab 100644 --- a/go.mod +++ b/go.mod @@ -58,7 +58,7 @@ require ( github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/jbenet/goprocess v0.1.4 - github.com/libp2p/go-doh-resolver v0.3.0 + github.com/libp2p/go-doh-resolver v0.3.1 github.com/libp2p/go-libp2p v0.14.0 github.com/libp2p/go-libp2p-circuit v0.4.0 github.com/libp2p/go-libp2p-connmgr v0.2.4 diff --git a/go.sum b/go.sum index 208818f43e3..47263467151 100644 --- a/go.sum +++ b/go.sum @@ -589,8 +589,8 @@ github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDa github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= -github.com/libp2p/go-doh-resolver v0.3.0 h1:YePXUmvjyFT7NsqgnEkhEi5d/Nqab97QZf7BPNUWSqo= -github.com/libp2p/go-doh-resolver v0.3.0/go.mod h1:y5go1ZppAq9N2eppbX0xON01CyPBeUg2yS6BTssssog= +github.com/libp2p/go-doh-resolver v0.3.1 h1:1wbVGkB4Tdj4WEvjAuYknOPyt4vSSDn9thnj13pKPaY= +github.com/libp2p/go-doh-resolver v0.3.1/go.mod h1:y5go1ZppAq9N2eppbX0xON01CyPBeUg2yS6BTssssog= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= From 73e35592877820875d334f33a915651ee0530191 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 21 May 2021 19:01:34 +0200 Subject: [PATCH 144/161] fix: webui-2.12.3 This bumps webui to bugfix release based on feedback from 0.9.0-rc1: https://github.com/ipfs/ipfs-webui/releases/tag/v2.12.3 (cherry picked from commit 2c431eb825b3a8ab39eafdf29c41fcc4c25c529d) --- core/corehttp/webui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/corehttp/webui.go b/core/corehttp/webui.go index 6191119cab9..8bff09a6b4b 100644 --- a/core/corehttp/webui.go +++ b/core/corehttp/webui.go @@ -1,7 +1,7 @@ package corehttp // TODO: move to IPNS -const WebUIPath = "/ipfs/bafybeifuexpvt6g4bkbmsrlb7rnudskfakn6vdrtoja4ml4zbxne2hu6bq" // v2.12.2 +const WebUIPath = "/ipfs/bafybeid26vjplsejg7t3nrh7mxmiaaxriebbm4xxrxxdunlk7o337m5sqq" // v2.12.3 // this is a list of all past webUI paths. var WebUIPaths = []string{ From 9b70e5e8224f0d9d12e8bf5c63f205fa9269aca7 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 25 May 2021 19:00:14 -0400 Subject: [PATCH 145/161] chore: update deps (cherry picked from commit 3746c2d63052df6a608486153f49d6241b30ae45) --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5acc27789ab..6f749b73b19 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/ipfs/go-ipfs-keystore v0.0.2 github.com/ipfs/go-ipfs-pinner v0.1.1 github.com/ipfs/go-ipfs-posinfo v0.0.1 - github.com/ipfs/go-ipfs-provider v0.4.4-0.20210513014626-1c19caa05024 + github.com/ipfs/go-ipfs-provider v0.5.1 github.com/ipfs/go-ipfs-routing v0.1.0 github.com/ipfs/go-ipfs-util v0.0.2 github.com/ipfs/go-ipld-cbor v0.0.5 @@ -65,7 +65,7 @@ require ( github.com/libp2p/go-libp2p-core v0.8.5 github.com/libp2p/go-libp2p-discovery v0.5.0 github.com/libp2p/go-libp2p-http v0.2.0 - github.com/libp2p/go-libp2p-kad-dht v0.12.0 + github.com/libp2p/go-libp2p-kad-dht v0.12.1 github.com/libp2p/go-libp2p-kbucket v0.4.7 github.com/libp2p/go-libp2p-loggables v0.1.0 github.com/libp2p/go-libp2p-mplex v0.4.1 diff --git a/go.sum b/go.sum index 47263467151..c042727aec0 100644 --- a/go.sum +++ b/go.sum @@ -436,8 +436,8 @@ github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqt github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= -github.com/ipfs/go-ipfs-provider v0.4.4-0.20210513014626-1c19caa05024 h1:eYfdZ27ogtwfnwKdfphOwcQ7PEOjKqXlWzVOakK0a60= -github.com/ipfs/go-ipfs-provider v0.4.4-0.20210513014626-1c19caa05024/go.mod h1:kUMTf1R8c+KgWUWKTGSZiXCDZWMCkxCX3wyepk0cYEA= +github.com/ipfs/go-ipfs-provider v0.5.1 h1:kZj72jzWLtGcorlwnMvBL6y6KJk6klO2Kb8QSeqEB0o= +github.com/ipfs/go-ipfs-provider v0.5.1/go.mod h1:fem6HKSru7n35Ljap6kowWdJrUzvcWJW01uhAkqNnzo= github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= github.com/ipfs/go-ipfs-routing v0.1.0 h1:gAJTT1cEeeLj6/DlLX6t+NxD9fQe2ymTO6qWRDI/HQQ= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= @@ -679,8 +679,8 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= -github.com/libp2p/go-libp2p-kad-dht v0.12.0 h1:R5vvp8kuXjsyDE/HEMKgM8XIwlRsP5BdAZexM+tJxdU= -github.com/libp2p/go-libp2p-kad-dht v0.12.0/go.mod h1:zdQYru1c7dnluMpZls4i9Fj2TwYXS7YyDkJ1Yahv0w0= +github.com/libp2p/go-libp2p-kad-dht v0.12.1 h1:6HsBhzxcD34rE7Ds2lK9q6llPE7/tdqV7JmJiukEcQ8= +github.com/libp2p/go-libp2p-kad-dht v0.12.1/go.mod h1:zdQYru1c7dnluMpZls4i9Fj2TwYXS7YyDkJ1Yahv0w0= github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= From 0902ab1be5e6fd583345c9d4b54367adf517e11b Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 25 May 2021 17:47:58 -0400 Subject: [PATCH 146/161] feat: add a text output encoding for the stats provide command (cherry picked from commit 37de3d0586928a3d3373a07c864d4d894d4de276) --- core/commands/stat_provide.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/core/commands/stat_provide.go b/core/commands/stat_provide.go index ac02c344cd6..073bae159a3 100644 --- a/core/commands/stat_provide.go +++ b/core/commands/stat_provide.go @@ -2,6 +2,8 @@ package commands import ( "fmt" + "io" + "text/tabwriter" cmds "github.com/ipfs/go-ipfs-cmds" "github.com/ipfs/go-ipfs/core/commands/cmdenv" @@ -46,6 +48,17 @@ This interface is not stable and may change from release to release. return nil }, - Encoders: cmds.EncoderMap{}, - Type: batched.BatchedProviderStats{}, + Encoders: cmds.EncoderMap{ + cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, s *batched.BatchedProviderStats) error { + wtr := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0) + defer wtr.Flush() + + fmt.Fprintf(wtr, "TotalProvides: %d\n", s.TotalProvides) + fmt.Fprintf(wtr, "AvgProvideDuration: %v\n", s.AvgProvideDuration) + fmt.Fprintf(wtr, "LastReprovideDuration: %v\n", s.LastReprovideDuration) + fmt.Fprintf(wtr, "LastReprovideBatchSize: %d\n", s.LastReprovideBatchSize) + return nil + }), + }, + Type: batched.BatchedProviderStats{}, } From bd46b0bbe6759c4b9d1436e026175a0bcd5cef04 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 27 May 2021 16:22:55 +0200 Subject: [PATCH 147/161] feat: humanized numbers in stat provide https://github.com/ipfs/go-ipfs/pull/8154#discussion_r639231040 (cherry picked from commit c082c73135d4bf9ba44fcc901d84434ed78a652c) --- core/commands/stat_provide.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/core/commands/stat_provide.go b/core/commands/stat_provide.go index 073bae159a3..7d9c44cd0df 100644 --- a/core/commands/stat_provide.go +++ b/core/commands/stat_provide.go @@ -5,6 +5,7 @@ import ( "io" "text/tabwriter" + humanize "github.com/dustin/go-humanize" cmds "github.com/ipfs/go-ipfs-cmds" "github.com/ipfs/go-ipfs/core/commands/cmdenv" @@ -50,15 +51,26 @@ This interface is not stable and may change from release to release. }, Encoders: cmds.EncoderMap{ cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, s *batched.BatchedProviderStats) error { - wtr := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0) + wtr := tabwriter.NewWriter(w, 1, 2, 1, ' ', 0) defer wtr.Flush() - fmt.Fprintf(wtr, "TotalProvides: %d\n", s.TotalProvides) - fmt.Fprintf(wtr, "AvgProvideDuration: %v\n", s.AvgProvideDuration) - fmt.Fprintf(wtr, "LastReprovideDuration: %v\n", s.LastReprovideDuration) - fmt.Fprintf(wtr, "LastReprovideBatchSize: %d\n", s.LastReprovideBatchSize) + tp := float64(s.TotalProvides) + fmt.Fprintf(wtr, "TotalProvides:\t%s\t(%s)\n", humanSI(tp, 0), humanFull(tp, 0)) + fmt.Fprintf(wtr, "AvgProvideDuration:\t%v\n", s.AvgProvideDuration) + fmt.Fprintf(wtr, "LastReprovideDuration:\t%v\n", s.LastReprovideDuration) + lrbs := float64(s.LastReprovideBatchSize) + fmt.Fprintf(wtr, "LastReprovideBatchSize:\t%s\t(%s)\n", humanSI(lrbs, 0), humanFull(lrbs, 0)) return nil }), }, Type: batched.BatchedProviderStats{}, } + +func humanSI(val float64, decimals int) string { + v, unit := humanize.ComputeSI(val) + return humanize.SIWithDigits(v, decimals, unit) +} + +func humanFull(val float64, decimals int) string { + return humanize.CommafWithDigits(val, decimals) +} From 229dfa675557bd539d9c6aa8b3082cc359bf149c Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 27 May 2021 16:49:13 +0200 Subject: [PATCH 148/161] feat: humanized durations in stat provide (cherry picked from commit e5ac70456dadd6723833d67c5cb6dd53b0d880cf) --- core/commands/stat_provide.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/commands/stat_provide.go b/core/commands/stat_provide.go index 7d9c44cd0df..86fe96efb99 100644 --- a/core/commands/stat_provide.go +++ b/core/commands/stat_provide.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "text/tabwriter" + "time" humanize "github.com/dustin/go-humanize" cmds "github.com/ipfs/go-ipfs-cmds" @@ -56,8 +57,8 @@ This interface is not stable and may change from release to release. tp := float64(s.TotalProvides) fmt.Fprintf(wtr, "TotalProvides:\t%s\t(%s)\n", humanSI(tp, 0), humanFull(tp, 0)) - fmt.Fprintf(wtr, "AvgProvideDuration:\t%v\n", s.AvgProvideDuration) - fmt.Fprintf(wtr, "LastReprovideDuration:\t%v\n", s.LastReprovideDuration) + fmt.Fprintf(wtr, "AvgProvideDuration:\t%v\n", humanDuration(s.AvgProvideDuration)) + fmt.Fprintf(wtr, "LastReprovideDuration:\t%v\n", humanDuration(s.LastReprovideDuration)) lrbs := float64(s.LastReprovideBatchSize) fmt.Fprintf(wtr, "LastReprovideBatchSize:\t%s\t(%s)\n", humanSI(lrbs, 0), humanFull(lrbs, 0)) return nil @@ -66,6 +67,10 @@ This interface is not stable and may change from release to release. Type: batched.BatchedProviderStats{}, } +func humanDuration(val time.Duration) string { + return val.Truncate(time.Microsecond).String() +} + func humanSI(val float64, decimals int) string { v, unit := humanize.ComputeSI(val) return humanize.SIWithDigits(v, decimals, unit) From 4fe6f4ce4483f806d4169b890751724c081a11bc Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 27 May 2021 22:03:11 +0200 Subject: [PATCH 149/161] refactor: improved humanNumber and humanSI This hides "(n)" when value is same as SI, and makes SI "3k" (instead of "3 k") (cherry picked from commit f40dc731e9d7e3d452d03c632d99ef9577d1fb2d) --- core/commands/stat_provide.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/core/commands/stat_provide.go b/core/commands/stat_provide.go index 86fe96efb99..4224efcafc0 100644 --- a/core/commands/stat_provide.go +++ b/core/commands/stat_provide.go @@ -55,12 +55,10 @@ This interface is not stable and may change from release to release. wtr := tabwriter.NewWriter(w, 1, 2, 1, ' ', 0) defer wtr.Flush() - tp := float64(s.TotalProvides) - fmt.Fprintf(wtr, "TotalProvides:\t%s\t(%s)\n", humanSI(tp, 0), humanFull(tp, 0)) - fmt.Fprintf(wtr, "AvgProvideDuration:\t%v\n", humanDuration(s.AvgProvideDuration)) - fmt.Fprintf(wtr, "LastReprovideDuration:\t%v\n", humanDuration(s.LastReprovideDuration)) - lrbs := float64(s.LastReprovideBatchSize) - fmt.Fprintf(wtr, "LastReprovideBatchSize:\t%s\t(%s)\n", humanSI(lrbs, 0), humanFull(lrbs, 0)) + fmt.Fprintf(wtr, "TotalProvides:\t%s\n", humanNumber(s.TotalProvides)) + fmt.Fprintf(wtr, "AvgProvideDuration:\t%s\n", humanDuration(s.AvgProvideDuration)) + fmt.Fprintf(wtr, "LastReprovideDuration:\t%s\n", humanDuration(s.LastReprovideDuration)) + fmt.Fprintf(wtr, "LastReprovideBatchSize:\t%s\n", humanNumber(s.LastReprovideBatchSize)) return nil }), }, @@ -71,9 +69,19 @@ func humanDuration(val time.Duration) string { return val.Truncate(time.Microsecond).String() } +func humanNumber(n int) string { + nf := float64(n) + str := humanSI(nf, 0) + fullStr := humanFull(nf, 0) + if str != fullStr { + return fmt.Sprintf("%s\t(%s)", str, fullStr) + } + return str +} + func humanSI(val float64, decimals int) string { v, unit := humanize.ComputeSI(val) - return humanize.SIWithDigits(v, decimals, unit) + return fmt.Sprintf("%s%s", humanFull(v, decimals), unit) } func humanFull(val float64, decimals int) string { From ad1d576d53215a8c15b2513cd170c6d061cb140f Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 27 May 2021 15:42:16 -0400 Subject: [PATCH 150/161] chore: update go-libp2p-yamux (cherry picked from commit 9c8b1019e5f07632d1f55a1ac4d0b15af599fe2f) --- go.mod | 2 +- go.sum | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6f749b73b19..d10e06626aa 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,7 @@ require ( github.com/libp2p/go-libp2p-swarm v0.5.0 github.com/libp2p/go-libp2p-testing v0.4.0 github.com/libp2p/go-libp2p-tls v0.1.3 - github.com/libp2p/go-libp2p-yamux v0.5.3 + github.com/libp2p/go-libp2p-yamux v0.5.4 github.com/libp2p/go-socket-activation v0.0.2 github.com/libp2p/go-tcp-transport v0.2.2 github.com/libp2p/go-ws-transport v0.4.0 diff --git a/go.sum b/go.sum index c042727aec0..0bce975b82c 100644 --- a/go.sum +++ b/go.sum @@ -793,8 +793,9 @@ github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2Ez github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= github.com/libp2p/go-libp2p-yamux v0.5.1/go.mod h1:dowuvDu8CRWmr0iqySMiSxK+W0iL5cMVO9S94Y6gkv4= -github.com/libp2p/go-libp2p-yamux v0.5.3 h1:x2bK2BWktdMdTrciiDmgTMIxYNBdkxewQFEjHDl7VgU= github.com/libp2p/go-libp2p-yamux v0.5.3/go.mod h1:Vy3TMonBAfTMXHWopsMc8iX/XGRYrRlpUaMzaeuHV/s= +github.com/libp2p/go-libp2p-yamux v0.5.4 h1:/UOPtT/6DHPtr3TtKXBHa6g0Le0szYuI33Xc/Xpd7fQ= +github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= @@ -874,8 +875,9 @@ github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= -github.com/libp2p/go-yamux/v2 v2.1.1 h1:3RkXAnDmaXJPckF/QbDnNbA6lZXMgycNTVMMTQ2YlAI= github.com/libp2p/go-yamux/v2 v2.1.1/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= +github.com/libp2p/go-yamux/v2 v2.2.0 h1:RwtpYZ2/wVviZ5+3pjC8qdQ4TKnrak0/E01N1UWoAFU= +github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= From 4d31ec1b8f8fe82c17a52036b7483a8d7569db9e Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 27 May 2021 15:19:15 -0400 Subject: [PATCH 151/161] Release v0.9.0-rc2 --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index d3f4916d6dd..6f3267f9619 100644 --- a/version.go +++ b/version.go @@ -4,7 +4,7 @@ package ipfs var CurrentCommit string // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.9.0-rc1" +const CurrentVersionNumber = "0.9.0-rc2" const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/" From 7c71c154987235a1ad4cabc450dc5aec3e9a7c12 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 31 May 2021 23:42:30 +0200 Subject: [PATCH 152/161] fix: typo in migration error (cherry picked from commit 041de2aed1a3a55d2897b02fea3bdc823b394cb1) --- cmd/ipfs/daemon.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index d8461c9a8ab..0370a2f6b1f 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -458,7 +458,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment if cacheMigrations || pinMigrations { err = addMigrations(cctx.Context(), node, fetcher, pinMigrations) if err != nil { - fmt.Fprintln(os.Stderr, "Could not add migragion to IPFS:", err) + fmt.Fprintln(os.Stderr, "Could not add migration to IPFS:", err) } // Remove download directory so that it does not remain for lifetime of // daemon or get left behind if daemon has a hard exit From 4cae9ccf32b693e42cb9c653d8c9c057d195779d Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 31 May 2021 15:33:21 +0200 Subject: [PATCH 153/161] feat: print error on bootstrap failure This will print ERROR to log if daemon running in online mode has no peers after one minute since start. (cherry picked from commit 039e12a2da77af7f0dfbdbc4602c2b5ba75c9b32) --- cmd/ipfs/daemon.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 0370a2f6b1f..3917a6420a8 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -12,6 +12,7 @@ import ( "runtime" "sort" "sync" + "time" multierror "github.com/hashicorp/go-multierror" @@ -22,6 +23,7 @@ import ( oldcmds "github.com/ipfs/go-ipfs/commands" "github.com/ipfs/go-ipfs/core" commands "github.com/ipfs/go-ipfs/core/commands" + "github.com/ipfs/go-ipfs/core/coreapi" corehttp "github.com/ipfs/go-ipfs/core/corehttp" corerepo "github.com/ipfs/go-ipfs/core/corerepo" libp2p "github.com/ipfs/go-ipfs/core/node/libp2p" @@ -510,6 +512,23 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment fmt.Println("(Hit ctrl-c again to force-shutdown the daemon.)") }() + // Give the user heads up if daemon running in online mode has no peers after 1 minute + if !offline { + time.AfterFunc(1*time.Minute, func() { + ipfs, err := coreapi.NewCoreAPI(node) + if err != nil { + log.Errorf("failed to access CoreAPI: %v", err) + } + peers, err := ipfs.Swarm().Peers(cctx.Context()) + if err != nil { + log.Errorf("failed to read swarm peers: %v", err) + } + if len(peers) == 0 { + log.Error("failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config") + } + }) + } + // collect long-running errors and block for shutdown // TODO(cryptix): our fuse currently doesn't follow this pattern for graceful shutdown var errs error From 7bba2a6434f008847d150eb3a3097addba298f3c Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 7 Jun 2021 18:14:20 +0200 Subject: [PATCH 154/161] refactor: warning when bootstrap disabled by user https://github.com/ipfs/go-ipfs/pull/8166#discussion_r646711067 (cherry picked from commit 904cc737162eed91ff5a172ac65c758387da9100) --- cmd/ipfs/daemon.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 3917a6420a8..f93152b316f 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -515,6 +515,16 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment // Give the user heads up if daemon running in online mode has no peers after 1 minute if !offline { time.AfterFunc(1*time.Minute, func() { + cfg, err := cctx.GetConfig() + if err != nil { + log.Errorf("failed to access config: %s", err) + } + if len(cfg.Bootstrap) == 0 && len(cfg.Peering.Peers) == 0 { + // Skip peer check if Bootstrap and Peering lists are empty + // (means user disabled them on purpose) + log.Warn("skipping bootstrap: empty Bootstrap and Peering lists") + return + } ipfs, err := coreapi.NewCoreAPI(node) if err != nil { log.Errorf("failed to access CoreAPI: %v", err) From 54ee5e4434ea26022b98cb8305109d247b455bd0 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Tue, 15 Jun 2021 17:00:10 -0700 Subject: [PATCH 155/161] update QUIC (cherry picked from commit 58aa218b90f8e7458e74b6774835a15647fbb9b5) --- go.mod | 4 ++-- go.sum | 25 ++++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index d10e06626aa..a173b6d416c 100644 --- a/go.mod +++ b/go.mod @@ -73,7 +73,7 @@ require ( github.com/libp2p/go-libp2p-peerstore v0.2.7 github.com/libp2p/go-libp2p-pubsub v0.4.1 github.com/libp2p/go-libp2p-pubsub-router v0.4.0 - github.com/libp2p/go-libp2p-quic-transport v0.11.0-rc.1 + github.com/libp2p/go-libp2p-quic-transport v0.11.1 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-libp2p-routing-helpers v0.2.3 github.com/libp2p/go-libp2p-swarm v0.5.0 @@ -83,7 +83,7 @@ require ( github.com/libp2p/go-socket-activation v0.0.2 github.com/libp2p/go-tcp-transport v0.2.2 github.com/libp2p/go-ws-transport v0.4.0 - github.com/lucas-clemente/quic-go v0.21.0-rc.2 + github.com/lucas-clemente/quic-go v0.21.1 github.com/miekg/dns v1.1.41 github.com/mitchellh/go-homedir v1.1.0 github.com/multiformats/go-multiaddr v0.3.1 diff --git a/go.sum b/go.sum index 0bce975b82c..e4fd8a39ce0 100644 --- a/go.sum +++ b/go.sum @@ -228,8 +228,8 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -733,8 +733,8 @@ github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9 github.com/libp2p/go-libp2p-pubsub-router v0.4.0 h1:KjzTLIOBCt0+/4wH6epTxD/Qu4Up/IyeKHlj9MhWRJI= github.com/libp2p/go-libp2p-pubsub-router v0.4.0/go.mod h1:hs0j0ugcBjMOMgJ6diOlZM2rZEId/w5Gg86E+ac4SmQ= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= -github.com/libp2p/go-libp2p-quic-transport v0.11.0-rc.1 h1:fq3BHwjS0zbU16zd0Yfuq2fSsGt/FhmSINQBOo334YM= -github.com/libp2p/go-libp2p-quic-transport v0.11.0-rc.1/go.mod h1:+6KxAO7wHfPQqNzvJHO3ItqbYfhMuI7qc/+u/Tjgh3k= +github.com/libp2p/go-libp2p-quic-transport v0.11.1 h1:5hF6mCrUVxdK5V08Ek4OAQmqqyinD9wa8jpIXDfU8fg= +github.com/libp2p/go-libp2p-quic-transport v0.11.1/go.mod h1:yleTY9UcxoGNaw1nEBjxomPbv7hs1voOZazGjqC3+1w= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -881,8 +881,8 @@ github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZj github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= -github.com/lucas-clemente/quic-go v0.21.0-rc.2 h1:HWPytXS1LueuD6vIHwSMW0FQkmf4Rb4Keyk9Vvapm1A= -github.com/lucas-clemente/quic-go v0.21.0-rc.2/go.mod h1:T+SpiNEBFsIo/TO6N8XDIhpnx3LMlNL/b9vyQtuvj1M= +github.com/lucas-clemente/quic-go v0.21.1 h1:uuhCcu885TE9u/piPYMChI/yqA1lXfaLUEx8uCMxf8w= +github.com/lucas-clemente/quic-go v0.21.1/go.mod h1:U9kFi5LKbNIlU30dkuM9vxmTxWq4Bvzee/MjBI+07UA= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -895,6 +895,8 @@ github.com/marten-seemann/qtls-go1-15 v0.1.4 h1:RehYMOyRW8hPVEja1KBVsFVNSm35Jj9M github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-16 v0.1.3 h1:XEZ1xGorVy9u+lJq+WXNE+hiqRYLNvJGYmwfwKQN2gU= github.com/marten-seemann/qtls-go1-16 v0.1.3/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= +github.com/marten-seemann/qtls-go1-17 v0.1.0-beta.1.2 h1:SficYjyOthSrliKI+EaFuXS6HqSsX3dkY9AqxAAjBjw= +github.com/marten-seemann/qtls-go1-17 v0.1.0-beta.1.2/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -1250,6 +1252,7 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= @@ -1354,8 +1357,9 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1396,6 +1400,7 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1472,15 +1477,16 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mUOKexJBNsLf4Z+6En1Q= golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1536,8 +1542,9 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 h1:g3QwFWCjsUzBtcQIcI+CYmiL/0i0BxTJjQp54GGDLEM= golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 508c11230d5b38aed5b318555d2289113ded30b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jun 2021 11:14:39 +0000 Subject: [PATCH 156/161] build(deps): bump github.com/libp2p/go-libp2p-discovery Bumps [github.com/libp2p/go-libp2p-discovery](https://github.com/libp2p/go-libp2p-discovery) from 0.5.0 to 0.5.1. - [Release notes](https://github.com/libp2p/go-libp2p-discovery/releases) - [Commits](https://github.com/libp2p/go-libp2p-discovery/compare/v0.5.0...v0.5.1) --- updated-dependencies: - dependency-name: github.com/libp2p/go-libp2p-discovery dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (cherry picked from commit 1ab632a00ad807994a31250277b1a6d1f098ae13) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a173b6d416c..9a64d9478c1 100644 --- a/go.mod +++ b/go.mod @@ -63,7 +63,7 @@ require ( github.com/libp2p/go-libp2p-circuit v0.4.0 github.com/libp2p/go-libp2p-connmgr v0.2.4 github.com/libp2p/go-libp2p-core v0.8.5 - github.com/libp2p/go-libp2p-discovery v0.5.0 + github.com/libp2p/go-libp2p-discovery v0.5.1 github.com/libp2p/go-libp2p-http v0.2.0 github.com/libp2p/go-libp2p-kad-dht v0.12.1 github.com/libp2p/go-libp2p-kbucket v0.4.7 diff --git a/go.sum b/go.sum index e4fd8a39ce0..d5fe1f48829 100644 --- a/go.sum +++ b/go.sum @@ -666,8 +666,9 @@ github.com/libp2p/go-libp2p-discovery v0.0.5/go.mod h1:YtF20GUxjgoKZ4zmXj8j3Nb2T github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= -github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-discovery v0.5.1 h1:CJylx+h2+4+s68GvrM4pGNyfNhOYviWBPtVv5PA7sfo= +github.com/libp2p/go-libp2p-discovery v0.5.1/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= github.com/libp2p/go-libp2p-gostream v0.3.0 h1:rnas//vRdHYCr7bjraZJISPwZV8OGMjeX5k5fN5Ax44= github.com/libp2p/go-libp2p-gostream v0.3.0/go.mod h1:pLBQu8db7vBMNINGsAwLL/ZCE8wng5V1FThoaE5rNjc= github.com/libp2p/go-libp2p-host v0.0.1/go.mod h1:qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go= From 698fdbf1827dc682c529a671a2ea7bbe602d2e83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 11:25:14 +0000 Subject: [PATCH 157/161] build(deps): bump github.com/libp2p/go-libp2p from 0.14.0 to 0.14.2 Bumps [github.com/libp2p/go-libp2p](https://github.com/libp2p/go-libp2p) from 0.14.0 to 0.14.2. - [Release notes](https://github.com/libp2p/go-libp2p/releases) - [Commits](https://github.com/libp2p/go-libp2p/compare/v0.14.0...v0.14.2) --- updated-dependencies: - dependency-name: github.com/libp2p/go-libp2p dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (cherry picked from commit 8d3c9c3110485c54814d3fa68b7bcb8114c1bf3d) --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 9a64d9478c1..83ff7564651 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/jbenet/goprocess v0.1.4 github.com/libp2p/go-doh-resolver v0.3.1 - github.com/libp2p/go-libp2p v0.14.0 + github.com/libp2p/go-libp2p v0.14.2 github.com/libp2p/go-libp2p-circuit v0.4.0 github.com/libp2p/go-libp2p-connmgr v0.2.4 github.com/libp2p/go-libp2p-core v0.8.5 diff --git a/go.sum b/go.sum index d5fe1f48829..38693b2a369 100644 --- a/go.sum +++ b/go.sum @@ -607,8 +607,8 @@ github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniV github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= -github.com/libp2p/go-libp2p v0.14.0 h1:mYab0qShfAojYN/QTOtxPyQoK9knUHbUncwst4+wBcA= -github.com/libp2p/go-libp2p v0.14.0/go.mod h1:dsQrWLAoIn+GkHPN/U+yypizkHiB9tnv79Os+kSgQ4Q= +github.com/libp2p/go-libp2p v0.14.2 h1:qs0ABtjjNjS+RIXT1uM7sMJEvIc0pq2nKR0VQxFXhHI= +github.com/libp2p/go-libp2p v0.14.2/go.mod h1:0PQMADQEjCM2l8cSMYDpTgsb8gr6Zq7i4LUgq1mlW2E= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= @@ -794,7 +794,6 @@ github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2Ez github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= github.com/libp2p/go-libp2p-yamux v0.5.1/go.mod h1:dowuvDu8CRWmr0iqySMiSxK+W0iL5cMVO9S94Y6gkv4= -github.com/libp2p/go-libp2p-yamux v0.5.3/go.mod h1:Vy3TMonBAfTMXHWopsMc8iX/XGRYrRlpUaMzaeuHV/s= github.com/libp2p/go-libp2p-yamux v0.5.4 h1:/UOPtT/6DHPtr3TtKXBHa6g0Le0szYuI33Xc/Xpd7fQ= github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= @@ -876,7 +875,6 @@ github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= -github.com/libp2p/go-yamux/v2 v2.1.1/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= github.com/libp2p/go-yamux/v2 v2.2.0 h1:RwtpYZ2/wVviZ5+3pjC8qdQ4TKnrak0/E01N1UWoAFU= github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= From af5c189501d966123c7f5be1bf392689d1949e8f Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Mon, 21 Jun 2021 12:40:57 -0400 Subject: [PATCH 158/161] chore: update deps (cherry picked from commit 95eebe48177ff0328fe93a4b202f4648b53fda24) --- go.mod | 8 ++++---- go.sum | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 83ff7564651..3757088c469 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/ipfs/go-filestore v0.0.3 github.com/ipfs/go-fs-lock v0.0.6 github.com/ipfs/go-graphsync v0.8.0 - github.com/ipfs/go-ipfs-blockstore v0.1.4 + github.com/ipfs/go-ipfs-blockstore v0.1.6 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmds v0.6.0 github.com/ipfs/go-ipfs-config v0.14.0 @@ -54,7 +54,7 @@ require ( github.com/ipfs/go-unixfs v0.2.5 github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 - github.com/ipld/go-car v0.3.0 + github.com/ipld/go-car v0.3.1 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 github.com/jbenet/goprocess v0.1.4 @@ -65,7 +65,7 @@ require ( github.com/libp2p/go-libp2p-core v0.8.5 github.com/libp2p/go-libp2p-discovery v0.5.1 github.com/libp2p/go-libp2p-http v0.2.0 - github.com/libp2p/go-libp2p-kad-dht v0.12.1 + github.com/libp2p/go-libp2p-kad-dht v0.12.2 github.com/libp2p/go-libp2p-kbucket v0.4.7 github.com/libp2p/go-libp2p-loggables v0.1.0 github.com/libp2p/go-libp2p-mplex v0.4.1 @@ -86,7 +86,7 @@ require ( github.com/lucas-clemente/quic-go v0.21.1 github.com/miekg/dns v1.1.41 github.com/mitchellh/go-homedir v1.1.0 - github.com/multiformats/go-multiaddr v0.3.1 + github.com/multiformats/go-multiaddr v0.3.2 github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multibase v0.0.3 github.com/multiformats/go-multihash v0.0.15 diff --git a/go.sum b/go.sum index 38693b2a369..fbbac73e054 100644 --- a/go.sum +++ b/go.sum @@ -403,8 +403,9 @@ github.com/ipfs/go-graphsync v0.8.0 h1:Zhh6QdTqdipYHD71ncLO8eA6c8EGUTOoJ4Rqybw3K github.com/ipfs/go-graphsync v0.8.0/go.mod h1:CLxN859dUTcXCav1DvNvmAUWPZfmNLjlGLJYy+c3dlM= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= -github.com/ipfs/go-ipfs-blockstore v0.1.4 h1:2SGI6U1B44aODevza8Rde3+dY30Pb+lbcObe1LETxOQ= github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= +github.com/ipfs/go-ipfs-blockstore v0.1.6 h1:+RNM/gkTF6lzLPtt/xqjEUXJuG0lFwAiv+MV8MoAhvA= +github.com/ipfs/go-ipfs-blockstore v0.1.6/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= @@ -505,8 +506,8 @@ github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2 github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= -github.com/ipld/go-car v0.3.0 h1:TV0Cb9k0Ux5lZ2h9+8xwQuIExYhHsllMGla1rB45lF4= -github.com/ipld/go-car v0.3.0/go.mod h1:dPkEWeAK8KaVvH5TahaCs6Mncpd4lDMpkbs0/SPzuVs= +github.com/ipld/go-car v0.3.1 h1:WT+3cdmXlvmWOlGxk9webhj4auGO5QvgqC2vCCkFRXs= +github.com/ipld/go-car v0.3.1/go.mod h1:dPkEWeAK8KaVvH5TahaCs6Mncpd4lDMpkbs0/SPzuVs= github.com/ipld/go-codec-dagpb v1.2.0 h1:2umV7ud8HBMkRuJgd8gXw95cLhwmcYrihS3cQEy9zpI= github.com/ipld/go-codec-dagpb v1.2.0/go.mod h1:6nBN7X7h8EOsEejZGqC7tej5drsdBAXbMHyBT+Fne5s= github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= @@ -680,8 +681,8 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= -github.com/libp2p/go-libp2p-kad-dht v0.12.1 h1:6HsBhzxcD34rE7Ds2lK9q6llPE7/tdqV7JmJiukEcQ8= -github.com/libp2p/go-libp2p-kad-dht v0.12.1/go.mod h1:zdQYru1c7dnluMpZls4i9Fj2TwYXS7YyDkJ1Yahv0w0= +github.com/libp2p/go-libp2p-kad-dht v0.12.2 h1:INBYK7pEPzka5TrAWB2II+PYLeEaRlu6RWIoukfEBFQ= +github.com/libp2p/go-libp2p-kad-dht v0.12.2/go.mod h1:mznpWRg0Nbkr9PB2Dm9XWN24V2BChE3FT1dHmwaDVws= github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= @@ -970,8 +971,9 @@ github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y9 github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= -github.com/multiformats/go-multiaddr v0.3.1 h1:1bxa+W7j9wZKTZREySx1vPMs2TqrYWjVZ7zE6/XLG1I= github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= +github.com/multiformats/go-multiaddr v0.3.2 h1:vapLUGlFpvvkaemMvKGGxjruOzaIzQbn41J6R9vxeyU= +github.com/multiformats/go-multiaddr v0.3.2/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= From c47fca7dac6880e871a97a36d20b6f42467e542d Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Fri, 18 Jun 2021 13:26:54 -0400 Subject: [PATCH 159/161] chore: switch tar-utils dep to ipfs org (cherry picked from commit f6641d1766257eb5164162e8795bea93a1220664) --- core/commands/get.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/commands/get.go b/core/commands/get.go index 7087c71ca3d..7fb53467f5d 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -18,7 +18,7 @@ import ( cmds "github.com/ipfs/go-ipfs-cmds" files "github.com/ipfs/go-ipfs-files" "github.com/ipfs/interface-go-ipfs-core/path" - "github.com/whyrusleeping/tar-utils" + "github.com/ipfs/tar-utils" ) var ErrInvalidCompressionLevel = errors.New("compression level must be between 1 and 9") diff --git a/go.mod b/go.mod index 3757088c469..ffcd4f3b71a 100644 --- a/go.mod +++ b/go.mod @@ -54,6 +54,7 @@ require ( github.com/ipfs/go-unixfs v0.2.5 github.com/ipfs/go-verifcid v0.0.1 github.com/ipfs/interface-go-ipfs-core v0.4.0 + github.com/ipfs/tar-utils v0.0.1 github.com/ipld/go-car v0.3.1 github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c github.com/jbenet/go-temp-err-catcher v0.1.0 @@ -97,7 +98,6 @@ require ( github.com/syndtr/goleveldb v1.0.0 github.com/whyrusleeping/go-sysinfo v0.0.0-20190219211824-4a357d4b90b1 github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 - github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b go.opencensus.io v0.23.0 go.uber.org/fx v1.13.1 go.uber.org/zap v1.16.0 diff --git a/go.sum b/go.sum index fbbac73e054..13bfa8dfe8a 100644 --- a/go.sum +++ b/go.sum @@ -506,6 +506,8 @@ github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2 github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= github.com/ipfs/interface-go-ipfs-core v0.4.0 h1:+mUiamyHIwedqP8ZgbCIwpy40oX7QcXUbo4CZOeJVJg= github.com/ipfs/interface-go-ipfs-core v0.4.0/go.mod h1:UJBcU6iNennuI05amq3FQ7g0JHUkibHFAfhfUIy927o= +github.com/ipfs/tar-utils v0.0.1 h1:8Na0KBD6GddGyXwU4rXNtVTE24iuZws8mENJQPLG7W4= +github.com/ipfs/tar-utils v0.0.1/go.mod h1:ACflm9wXvV9w0eMJt6yYXxS2zuIV+yXGNwbuq1bhLeE= github.com/ipld/go-car v0.3.1 h1:WT+3cdmXlvmWOlGxk9webhj4auGO5QvgqC2vCCkFRXs= github.com/ipld/go-car v0.3.1/go.mod h1:dPkEWeAK8KaVvH5TahaCs6Mncpd4lDMpkbs0/SPzuVs= github.com/ipld/go-codec-dagpb v1.2.0 h1:2umV7ud8HBMkRuJgd8gXw95cLhwmcYrihS3cQEy9zpI= @@ -1244,8 +1246,6 @@ github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9 h1:Y1/FEOpaCpD2 github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= -github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= From de6a70747283575288cb88953c17504dad8d728f Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 22 Jun 2021 16:06:50 -0400 Subject: [PATCH 160/161] chore: update CHANGELOG (cherry picked from commit dc4505b48b97aeab20dc938acfbfe0cc2f63320a) --- CHANGELOG.md | 710 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 710 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2807e20f17..d7ce758a63e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,715 @@ # go-ipfs changelog +## v0.9.0 2021-06-22 + +We're happy to announce go-ipfs 0.9.0. This release makes go-ipfs even more configurable with some fun experiments to boot. We're also deprecating or removing some uncommonly used features to make it easier for users to discover the easy ways to use go-ipfs safely and efficiently. + +As usual, this release includes important fixes, some of which may be critical for security. Unless the fix addresses a bug being exploited in the wild, the fix will _not_ be called out in the release notes. Please make sure to update ASAP. See our [release process](https://github.com/ipfs/go-ipfs/tree/master/docs/releases.md#security-fix-policy) for details. + +### 🔦 Highlights + +#### 📦 Exporting of DAGs via Gateways + +Gateways now support downloading arbitrary IPLD graphs via the `/api/v0/dag/export` endpoint. This endpoint works in the same way as the `ipfs dag export` command. + +One major thing this enables is ability to verify data downloaded from public gateways. If you go to `https://somegateway.example.net/ipfs/bafyexample` you are using the old school HTTP transport, and trusting that the gateway is being well behaved. However, if you download the graph as a [DAG archive](https://github.com/ipld/specs/blob/master/block-layer/content-addressable-archives.md) then it is possible to verify that the data you downloaded does in fact match `bafyexample`. + +Additionally, it was previously quite painful to download things other than UnixFS (files + directories) using gateways. It is now possible to download arbitrary IPLD graphs from gateways, making them useful as a general-purpose alternative to p2p transports. + +This opens exciting opportunities in areas like thin clients, mobile browsers and IoT devices, which now can delegate IPFS resolution to any public gateway, and have ability to verify that the data received matches the requested hash. + +#### ☁ Custom DNS Resolvers + +Resolution of DNS records for DNSLink and DNSAddrs means that names are sent in cleartext between the operating system and the DNS server provided by an ISP. In the past, the only way to customize DNS resolution in IPFS stack was to set up own DNS proxy server. + +There is now the ability to [customize DNS resolution](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#dns) and override the default resolver from the OS with [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS) (DoH) one. We made it really flexible: override can be applied globally, or per specific [TLD](https://en.wikipedia.org/wiki/Top-level_domain)/[FQDN](https://en.wikipedia.org/wiki/Fully_qualified_domain_name). Examples can be found in the [documentation](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#dns). + +#### 👪 Support for non-ICANN DNSLink names + +Building off of the support for custom DNS resolvers it is now possible to create DNSLink names not handled by ICANN and choose how that domain name will be resolved. An example of this is how ENS is supported, despite `.eth` not being an ICANN TLD you can point `.eth` to any ENS resolver you want (including a local one). + +While go-ipfs may have some DoH defaults for a few popular non-ICANN DNSLink names (e.g. ENS), you are free to use any protocol for a naming system and as long as it exposes a DNSLink record via a DNS endpoint you can make it work. + +#### 🖥️ Updated to the latest WebUI + +Our web interface now includes experimental support for pinning services, and various updates to _Files_ and _Peers_ screens. + +Remote pinning services added via the `ipfs pin remote service add` command are already detected, one can also add one from _Settings_ screen, and it will appear in _Set pinning_ interface on the _Files_ screen. + +Data presented on the _Peers_ screen can now be copied by simply clicking on a specific cell, and a list of open streams gives better insight into how a local node interacts with a specific peer. + +See release notes for [ipfs-webui v2.12](https://github.com/ipfs/ipfs-webui/releases/tag/v2.12.0) for screenshots and more details. + +#### 🔑 IPNS keys can now be exported via the CLI without stopping the daemon + +`ipfs key export` no longer requires interrupting `ipfs daemon` ✨ + +#### 🕸 Experimental DHT Client and Provider System + +An area of go-ipfs that has been historically tricky is how go-ipfs finds who has the data they are looking for. While the IPFS Public DHT is only one of the ways go-ipfs can find data it tends to be an important one. While since go-ipfs v0.5.0 the time to find content in the network has dropped significantly the time to put/get IPNS records or for a node to advertise the content it has still has much room for improvement. + +We have been doing some experimenting and have an alternative DHT client that essentially trades off some resources and in return is much more performant. We have also included with the experimental DHT client a bulk provider system that takes advantage of the new client to more efficiently do many advertisements at a time + +This work is quite new and still under development, however, the results so far have been promising especially for users with lots of data who have otherwise been having difficulty advertising their data into the IPFS Public DHT + +As described in the experimental features [documentation](https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#accelerated-dht-client) the experimental client can be enabled using the command below (or modifying the config file). + +``` +ipfs config --json Experimental.AcceleratedDHTClient true +``` + +A few things to take note of when `AcceleratedDHTClient` is enabled: +- go-ipfs will likely use more resources then previously +- DHT queries will not be usable (i.e. finding which peers have some data, finding where a particular peer is, etc.) for the first 5-10 minutes of operation depending on your network conditions +- There is an `ipfs stats provide` command that will help you track your provide/reprovide usage, if you are providing lots of data you may want to consider how to reduce the amount you are providing (e.g. [Reprovider Strategies](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#reproviderstrategy) and/or [Strategic Providing](https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#strategic-providing)) + +See the [documentation](https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#accelerated-dht-client) for more details. + +#### 🚶‍♀️ Migrations + +##### Migrations are now individually packaged + +While previously the go-ipfs [repo migration](https://github.com/ipfs/fs-repo-migrations) binary was monolithic and contained all migrations from previous go-ipfs versions the binaries are now packaged individually. However, the fs-repo-migrations binary is still there to help those who manually upgrade their repos to download all the individual migrations. + +This means faster download times for upgrades, a much easier time building migrations for those who make use of custom plugins, and an easier time developing new migrations going forward. + +##### Configurable migration downloads enable downloading over IPFS + +Previously the migration downloader built into go-ipfs downloaded the migrations from [dist.ipfs.io](https://dist.ipfs.io). While users could use tools like [ipfs-update](https://github.com/ipfs/ipfs-update) to download the migrations over IPFS or manually download the migrations (over IPFS or otherwise) themselves, this is now automated and configurable. Users can choose to download the migrations over IPFS or from any specified IPFS Gateway. + +The configurable migration options are described in the config file [documentation](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#migration), although most users should not need to change the default settings. + +The main benefit here is that users behind restrictive firewalls, or in offline/private deployments, won't have to run migrations manually, which is especially important for desktop use cases where go-ipfs is running inside of [IPFS Desktop](https://github.com/ipfs-shipyard/ipfs-desktop#readme) and [Brave](https://brave.com/ipfs-support/). + +#### 🍎 Published builds for Apple M1 hardware + +Go now supports building for Darwin ARM64, and we are now publishing those builds + +#### 👋 Deprecations and Feature Removals + +##### The `ipfs object` commands are now deprecated + +In the last couple years most of the Object API's commands have become fulfillable using alternative APIs. + +The utility of Object API's is limited to data in UnixFS-v1 (`dag-pb`) format. If you are still using it, it is highly recommended that you switch to the DAG `ipfs dag` (supports modern data types like `dag-cbor`) or Files `ipfs files` (more intuitive for working with `dag-pb`) APIs. + +While the Object API and commands are still usable they are now marked as deprecated and hidden from users on the command line to discourage further use. We also updated their `--help` text to point at the modern replacements. + + +##### `X-Ipfs-Gateway-Prefix` is now deprecated + +IPFS community moved towards dedicated Origins (DNSLink and [subdomain gateways](https://docs.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway)) which are much easier to isolate and reason about. + +Setting up `Gateway.PathPrefixes` and `X-Ipfs-Gateway-Prefix` is no longer necessary and support [will be removed in near future](https://github.com/ipfs/go-ipfs/issues/7702). + +##### Proquints support removed + +A little known feature that was not well used or documented and was more well known for the error message `Error: not a valid proquint string` users received when trying to download invalid IPNS or DNSLink names (e.g. `https://dweb.link/ipns/badname`). We have removed support for proquints as they were out of place and largely unused, however proquints are [valid multibases](https://github.com/multiformats/multibase/pull/78) so if there is renewed interest in them there is a way forward. + +##### SECIO support removed + +SECIO was deprecated and turned off by default given the prevalence of TLS and Noise support, SECIO support is now removed entirely. + +### Changelog + +- github.com/ipfs/go-ipfs: + - chore: switch tar-utils dep to ipfs org + - chore: update CHANGELOG + - refactor: warning when bootstrap disabled by user + - feat: print error on bootstrap failure + - fix: typo in migration error + - Release v0.9.0-rc2 + - refactor: improved humanNumber and humanSI + - feat: humanized durations in stat provide + - feat: humanized numbers in stat provide + - feat: add a text output encoding for the stats provide command + - fix: webui-2.12.3 + - refactor(pinmfs): log error if pre-existing pin failed (#8056) ([ipfs/go-ipfs#8056](https://github.com/ipfs/go-ipfs/pull/8056)) + - Release v0.9.0-rc1 + - Added support for an experimental DHT client and provider system via the Experiments.AcceleratedDHTClient config option ([ipfs/go-ipfs#8061](https://github.com/ipfs/go-ipfs/pull/8061)) + - feat: support DNSLink on non-ICANN DNS names ([ipfs/go-ipfs#8071](https://github.com/ipfs/go-ipfs/pull/8071)) + - update go-tcp-transport to v0.2.2 ([ipfs/go-ipfs#8129](https://github.com/ipfs/go-ipfs/pull/8129)) + - update quic-go to v0.21.0-rc.1 ([ipfs/go-ipfs#8125](https://github.com/ipfs/go-ipfs/pull/8125)) + - chore: bump minimum go version to 1.15 ([ipfs/go-ipfs#7944](https://github.com/ipfs/go-ipfs/pull/7944)) + - chore: update deps ([ipfs/go-ipfs#8128](https://github.com/ipfs/go-ipfs/pull/8128)) + - feat: allow key export in online mode ([ipfs/go-ipfs#8113](https://github.com/ipfs/go-ipfs/pull/8113)) + - Feat/migration ipfs download (#8064) ([ipfs/go-ipfs#8064](https://github.com/ipfs/go-ipfs/pull/8064)) + - feat: support custom DoH resolvers ([ipfs/go-ipfs#8068](https://github.com/ipfs/go-ipfs/pull/8068)) + - update go-libp2p to v0.14.0 ([ipfs/go-ipfs#8122](https://github.com/ipfs/go-ipfs/pull/8122)) + - feat(gw): expose /api/v0/dag/export on gateway port ([ipfs/go-ipfs#8111](https://github.com/ipfs/go-ipfs/pull/8111)) + - chore: update webui to 2.12.2 ([ipfs/go-ipfs#8097](https://github.com/ipfs/go-ipfs/pull/8097)) + - docs: deprecate object commands ([ipfs/go-ipfs#8098](https://github.com/ipfs/go-ipfs/pull/8098)) + - fix: omit empty pins slice when reporting pin progress ([ipfs/go-ipfs#8023](https://github.com/ipfs/go-ipfs/pull/8023)) + - Fix typo in comment ([ipfs/go-ipfs#8087](https://github.com/ipfs/go-ipfs/pull/8087)) + - fix: set systemd startup timeout to infinity ([ipfs/go-ipfs#8040](https://github.com/ipfs/go-ipfs/pull/8040)) + - fix(mkreleaselog): partially handle v2 modules ([ipfs/go-ipfs#8073](https://github.com/ipfs/go-ipfs/pull/8073)) + - Update migration sharness tests for new migrations (#8053) ([ipfs/go-ipfs#8053](https://github.com/ipfs/go-ipfs/pull/8053)) + - fix: make migrations log output to stdout ([ipfs/go-ipfs#8054](https://github.com/ipfs/go-ipfs/pull/8054)) + - fix(gw): remove hardcoded hostnames ([ipfs/go-ipfs#8069](https://github.com/ipfs/go-ipfs/pull/8069)) + - Fix transposed words in docs/config.md ([ipfs/go-ipfs#8051](https://github.com/ipfs/go-ipfs/pull/8051)) + - fix: update root help ([ipfs/go-ipfs#8052](https://github.com/ipfs/go-ipfs/pull/8052)) + - chore: dont docker tag rc as latest ([ipfs/go-ipfs#8055](https://github.com/ipfs/go-ipfs/pull/8055)) + - Add info to "pin rm" help about how to tell if pin is indirect ([ipfs/go-ipfs#8044](https://github.com/ipfs/go-ipfs/pull/8044)) + - build(deps): bump contrib.go.opencensus.io/exporter/prometheus from 0.2.0 to 0.3.0 ([ipfs/go-ipfs#8020](https://github.com/ipfs/go-ipfs/pull/8020)) + - fix(gw): remove use of Clear-Site-Data in subdomain router ([ipfs/go-ipfs#7890](https://github.com/ipfs/go-ipfs/pull/7890)) + - ([ipfs/go-ipfs#7857](https://github.com/ipfs/go-ipfs/pull/7857)) + - docs: clarification of the Strategic Providing functionality ([ipfs/go-ipfs#8035](https://github.com/ipfs/go-ipfs/pull/8035)) + - docs: cosmetic fixes of help text ([ipfs/go-ipfs#8010](https://github.com/ipfs/go-ipfs/pull/8010)) + - chore: deprecate Gateway.PathPrefixes ([ipfs/go-ipfs#7994](https://github.com/ipfs/go-ipfs/pull/7994)) + - Fix text contrast for dark mode ([ipfs/go-ipfs#8027](https://github.com/ipfs/go-ipfs/pull/8027)) + - Do not fetch recursive pins from pinner unnecessarily ([ipfs/go-ipfs#7883](https://github.com/ipfs/go-ipfs/pull/7883)) + - test(sharness): verify the list of exported metrics ([ipfs/go-ipfs#7987](https://github.com/ipfs/go-ipfs/pull/7987)) + - fix: return an error if repo verify is canceled ([ipfs/go-ipfs#7973](https://github.com/ipfs/go-ipfs/pull/7973)) + - doc: document security fix policy ([ipfs/go-ipfs#7991](https://github.com/ipfs/go-ipfs/pull/7991)) + - feat(gw): /ipfs/ipfs/{cid} → /ipfs/{cid} ([ipfs/go-ipfs#7930](https://github.com/ipfs/go-ipfs/pull/7930)) + - Fix: innacuracies in MFS command documentation. ([ipfs/go-ipfs#8001](https://github.com/ipfs/go-ipfs/pull/8001)) + - Feat: Re-import InitializeKeyspace code from go-namesys ([ipfs/go-ipfs#7984](https://github.com/ipfs/go-ipfs/pull/7984)) + - revert registration of metrics against unexposed prom registry ([ipfs/go-ipfs#7986](https://github.com/ipfs/go-ipfs/pull/7986)) + - Extract the namesys and the keystore submodules ([ipfs/go-ipfs#7925](https://github.com/ipfs/go-ipfs/pull/7925)) + - split core/commands/dag into individual files for different subcommands ([ipfs/go-ipfs#7970](https://github.com/ipfs/go-ipfs/pull/7970)) + - test(sharness): pass correct timeout format to go-timeout ([ipfs/go-ipfs#7971](https://github.com/ipfs/go-ipfs/pull/7971)) + - fix race condition when logging requests ([ipfs/go-ipfs#7953](https://github.com/ipfs/go-ipfs/pull/7953)) + - fix some sharness-in-CI issues ([ipfs/go-ipfs#7946](https://github.com/ipfs/go-ipfs/pull/7946)) + - chore: update deps ([ipfs/go-ipfs#7941](https://github.com/ipfs/go-ipfs/pull/7941)) + - fix: correctly return pin ls errors ([ipfs/go-ipfs#7942](https://github.com/ipfs/go-ipfs/pull/7942)) + - feat: remove secio support ([ipfs/go-ipfs#7943](https://github.com/ipfs/go-ipfs/pull/7943)) + - Set supported platforms by go-version ([ipfs/go-ipfs#7927](https://github.com/ipfs/go-ipfs/pull/7927)) + - docs: tips on debugging Policies.MFS (#7929) ([ipfs/go-ipfs#7929](https://github.com/ipfs/go-ipfs/pull/7929)) + - docs: fix DNSLink gw recipe ([ipfs/go-ipfs#7932](https://github.com/ipfs/go-ipfs/pull/7932)) + - Merge branch 'release' + - docs: RepinInterval + - style: docs/config.md + - style: improved MFS PinName example + - docs: Pinning.RemoteServices.Policies + - peering: add logs before many-second waits ([ipfs/go-ipfs#7904](https://github.com/ipfs/go-ipfs/pull/7904)) + - all: gofmt -s ([ipfs/go-ipfs#7900](https://github.com/ipfs/go-ipfs/pull/7900)) +- github.com/ipfs/go-bitswap (v0.3.3 -> v0.3.4): + - remove Makefile ([ipfs/go-bitswap#483](https://github.com/ipfs/go-bitswap/pull/483)) + - test: deflake engine test ([ipfs/go-bitswap#480](https://github.com/ipfs/go-bitswap/pull/480)) + - test: deflake large-message test ([ipfs/go-bitswap#479](https://github.com/ipfs/go-bitswap/pull/479)) + - fix: fix alignment of stats struct in virtual network ([ipfs/go-bitswap#478](https://github.com/ipfs/go-bitswap/pull/478)) + - fix(network): impl: add timeout in newStreamToPeer call ([ipfs/go-bitswap#477](https://github.com/ipfs/go-bitswap/pull/477)) + - fix staticcheck ([ipfs/go-bitswap#474](https://github.com/ipfs/go-bitswap/pull/474)) + - ignore transient connections ([ipfs/go-bitswap#470](https://github.com/ipfs/go-bitswap/pull/470)) + - fix a startup race by creating the blockstoremanager process on init ([ipfs/go-bitswap#465](https://github.com/ipfs/go-bitswap/pull/465)) +- github.com/ipfs/go-block-format (v0.0.2 -> v0.0.3): + - doc: add a lead maintainer ([ipfs/go-block-format#16](https://github.com/ipfs/go-block-format/pull/16)) +- github.com/ipfs/go-graphsync (v0.6.0 -> v0.8.0): + - docs(CHANGELOG): update for v0.8.0 + - Update for LinkSystem (#161) ([ipfs/go-graphsync#161](https://github.com/ipfs/go-graphsync/pull/161)) + - Round out diagnostic parameters (#157) ([ipfs/go-graphsync#157](https://github.com/ipfs/go-graphsync/pull/157)) + - map response codes to names (#148) ([ipfs/go-graphsync#148](https://github.com/ipfs/go-graphsync/pull/148)) + - Discard http output (#156) ([ipfs/go-graphsync#156](https://github.com/ipfs/go-graphsync/pull/156)) + - Add debug logging (#121) ([ipfs/go-graphsync#121](https://github.com/ipfs/go-graphsync/pull/121)) + - Add optional HTTP comparison (#153) ([ipfs/go-graphsync#153](https://github.com/ipfs/go-graphsync/pull/153)) + - docs(architecture): update architecture docs (#154) ([ipfs/go-graphsync#154](https://github.com/ipfs/go-graphsync/pull/154)) + - release v0.7.0 ([ipfs/go-graphsync#152](https://github.com/ipfs/go-graphsync/pull/152)) + - chore: update deps (#151) ([ipfs/go-graphsync#151](https://github.com/ipfs/go-graphsync/pull/151)) + - Automatically record heap profiles in testplans (#147) ([ipfs/go-graphsync#147](https://github.com/ipfs/go-graphsync/pull/147)) + - feat(deps): update go-ipld-prime v0.7.0 (#145) ([ipfs/go-graphsync#145](https://github.com/ipfs/go-graphsync/pull/145)) + - Release/v0.6.0 ([ipfs/go-graphsync#144](https://github.com/ipfs/go-graphsync/pull/144)) +- github.com/ipfs/go-ipfs-blockstore (v0.1.4 -> v0.1.6): + - use bloom filter in GetSize +- github.com/ipfs/go-ipfs-config (v0.12.0 -> v0.14.0): + - Added Experiments.AcceleratedDHTClient option ([ipfs/go-ipfs-config#125](https://github.com/ipfs/go-ipfs-config/pull/125)) + - Add config for downloading repo migrations ([ipfs/go-ipfs-config#128](https://github.com/ipfs/go-ipfs-config/pull/128)) + - remove duplicate entries in defaultServerFilters ([ipfs/go-ipfs-config#121](https://github.com/ipfs/go-ipfs-config/pull/121)) + - add custom DNS Resolver configuration ([ipfs/go-ipfs-config#126](https://github.com/ipfs/go-ipfs-config/pull/126)) +- github.com/ipfs/go-ipfs-provider (v0.4.3 -> v0.5.1): + - Fix batched providing of empty keys ([ipfs/go-ipfs-provider#37](https://github.com/ipfs/go-ipfs-provider/pull/37)) + - Bulk Provide/Reproviding System (#34) ([ipfs/go-ipfs-provider#34](https://github.com/ipfs/go-ipfs-provider/pull/34)) + - chore: update the Usage part of readme ([ipfs/go-ipfs-provider#33](https://github.com/ipfs/go-ipfs-provider/pull/33)) + - Retract and revert 1.0.0 ([ipfs/go-ipfs-provider#31](https://github.com/ipfs/go-ipfs-provider/pull/31)) + - replace go-merkledag with go-fetcher ([ipfs/go-ipfs-provider#30](https://github.com/ipfs/go-ipfs-provider/pull/30)) +- github.com/ipfs/go-ipld-git (v0.0.3 -> v0.0.4): + - add license file so it can be found by go-licenses ([ipfs/go-ipld-git#42](https://github.com/ipfs/go-ipld-git/pull/42)) +- github.com/ipfs/go-ipns (v0.0.2 -> v0.1.0): + - Add support for extensible records (and v2 signature) +- github.com/ipfs/go-log (v1.0.4 -> v1.0.5): + - chore: update v1 deps ([ipfs/go-log#108](https://github.com/ipfs/go-log/pull/108)) +- github.com/ipfs/go-log/v2 (v2.1.1 -> v2.1.3): + - doc(README): use circle-ci badge ([ipfs/go-log#106](https://github.com/ipfs/go-log/pull/106)) + - feat: add ability to specify labels for all loggers ([ipfs/go-log#105](https://github.com/ipfs/go-log/pull/105)) + - Add an option to pass URL to zap ([ipfs/go-log#101](https://github.com/ipfs/go-log/pull/101)) + - enable configuring several log outputs ([ipfs/go-log#98](https://github.com/ipfs/go-log/pull/98)) + - Fix caller not being added ([ipfs/go-log#96](https://github.com/ipfs/go-log/pull/96)) +- github.com/ipfs/go-unixfs (v0.2.4 -> v0.2.5): + - correct file size for raw node ([ipfs/go-unixfs#88](https://github.com/ipfs/go-unixfs/pull/88)) +- github.com/ipld/go-car (v0.1.1-0.20201015032735-ff6ccdc46acc -> v0.3.1): + - chore: make sure we get an error where we expect one + - chore: refactor header tests to iterate over a struct + - chore: add header error tests + - fix: lint errors + - fix: go mod tidy + - chore: update go.mod to 1.15 + - fix: ReadHeader return value mismatch + - Updates for ipld linksystem branch ([ipld/go-car#56](https://github.com/ipld/go-car/pull/56)) + - replace go-ipld-prime-proto with go-codec-dagpb + - fix staticcheck errors ([ipld/go-car#67](https://github.com/ipld/go-car/pull/67)) + - chore: switch to a single license file ([ipld/go-car#59](https://github.com/ipld/go-car/pull/59)) + - chore: remove LICENSE ([ipld/go-car#58](https://github.com/ipld/go-car/pull/58)) + - chore: relicense ([ipld/go-car#57](https://github.com/ipld/go-car/pull/57)) + - ci: remove travis support ([ipld/go-car#55](https://github.com/ipld/go-car/pull/55)) + - run gofmt -s + - Allow user defined block hooks when using two step write for selective cars ([ipld/go-car#37](https://github.com/ipld/go-car/pull/37)) + - feat: handle mid-varint EOF case as UnexpectedEOF + - fix: main NewReader call +- github.com/ipld/go-ipld-prime (v0.5.1-0.20201021195245-109253e8a018 -> v0.9.1-0.20210324083106-dc342a9917db): + - Add option to tell link system storage is trusted and we can skip hash on read ([ipld/go-ipld-prime#149](https://github.com/ipld/go-ipld-prime/pull/149)) + - implement non-dag cbor codec ([ipld/go-ipld-prime#153](https://github.com/ipld/go-ipld-prime/pull/153)) + - add non-dag json codec ([ipld/go-ipld-prime#152](https://github.com/ipld/go-ipld-prime/pull/152)) + - typo fixes + - mark v0.9.0 + - Changelog: more backfill :) + - hackme: about merge strategies. + - Dropping .gopath and other unmaintained scripts. + - introduce LinkSystem ([ipld/go-ipld-prime#143](https://github.com/ipld/go-ipld-prime/pull/143)) + - Readme updates. + - codec/raw: implement the raw codec + - add an ADL interface type + - schema/gen/go: cache genned code in os.TempDir + - fluent/qp: finish writing all data model helpers + - fluent: add qp, a different spin on quip + - schema/gen/go: prevent some unkeyed literal vet errors + - schema/gen/go: remove two common subtest levels + - use %q in error strings + - schema/gen/go: please vet a bit more + - Introduce 'quip' data building helpers. ([ipld/go-ipld-prime#134](https://github.com/ipld/go-ipld-prime/pull/134)) + - gengo: support for unions with stringprefix representation. ([ipld/go-ipld-prime#133](https://github.com/ipld/go-ipld-prime/pull/133)) + - target of opporunity DRY improvement: use more shared templates for structs with stringjoin representations. + - fix small consistency typo in gen function names. + - drop old generation mechanisms that were already deprecated. + - error type cleanup, and helpers. + - v0.7.0 and changelog update + - Revert "rename AssignNode to ConvertFrom" + - Implement traversal.FocusedTransform. ([ipld/go-ipld-prime#130](https://github.com/ipld/go-ipld-prime/pull/130)) + - Update a few more lingering ReprKind references. + - all: rename schema.Kind to TypeKind, ipld.ReprKind to Kind ([ipld/go-ipld-prime#127](https://github.com/ipld/go-ipld-prime/pull/127)) + - all: rename AssignNode to ConvertFrom + - all: rewrite interfaces and APIs to support int64 + - mark v0.6.0 + - clean up node/gendemo regeneration ([ipld/go-ipld-prime#123](https://github.com/ipld/go-ipld-prime/pull/123)) + - cleanup: drop orphaned gitignore file. + - Schema types rebased to use codegen types for the data ([ipld/go-ipld-prime#107](https://github.com/ipld/go-ipld-prime/pull/107)) + - codegen: assembler for struct with map representation validates all non-optional fields are present ([ipld/go-ipld-prime#121](https://github.com/ipld/go-ipld-prime/pull/121)) + - changelog: backfill. + - fluent: finish out matrix of helper methods, and fix error handling of the non-Must methods. + - all: fix a lot of "unkeyed literal" vet warnings + - node/mixins: use simpler filenames + - node/gendemo: use the new code generator + - Merge pull request #96 , originally known as ipld/cidlink-only-usable-as-ptr + - Codec revamp ([ipld/go-ipld-prime#112](https://github.com/ipld/go-ipld-prime/pull/112)) + - Allow overriden types (#116) ([ipld/go-ipld-prime#116](https://github.com/ipld/go-ipld-prime/pull/116)) + - add import to ipld in ipldsch_types.go ([ipld/go-ipld-prime#115](https://github.com/ipld/go-ipld-prime/pull/115)) + - Codegen output rearrange ([ipld/go-ipld-prime#105](https://github.com/ipld/go-ipld-prime/pull/105)) + - Validate struct builder sufficiency ([ipld/go-ipld-prime#111](https://github.com/ipld/go-ipld-prime/pull/111)) + - Fresh take on codec APIs, and some tokenization utilities. ([ipld/go-ipld-prime#101](https://github.com/ipld/go-ipld-prime/pull/101)) + - Add a demo ADL (rot13adl) ([ipld/go-ipld-prime#98](https://github.com/ipld/go-ipld-prime/pull/98)) + - Introduce traversal function that selects links out of a tree. ([ipld/go-ipld-prime#110](https://github.com/ipld/go-ipld-prime/pull/110)) + - Codegen various improvements ([ipld/go-ipld-prime#106](https://github.com/ipld/go-ipld-prime/pull/106)) +- github.com/libp2p/go-conn-security-multistream (v0.2.0 -> v0.2.1): + - Implement support for simultaneous open (#14) ([libp2p/go-conn-security-multistream#14](https://github.com/libp2p/go-conn-security-multistream/pull/14)) +- github.com/libp2p/go-libp2p (v0.13.0 -> v0.14.2): + - Fix race in adding connections to connsByPeer ([libp2p/go-libp2p#1116](https://github.com/libp2p/go-libp2p/pull/1116)) + - speed up the mock tests ([libp2p/go-libp2p#1103](https://github.com/libp2p/go-libp2p/pull/1103)) + - remove slow ObservedAddrManager test that doesn't test anything ([libp2p/go-libp2p#1104](https://github.com/libp2p/go-libp2p/pull/1104)) + - remove Codecov config ([libp2p/go-libp2p#1100](https://github.com/libp2p/go-libp2p/pull/1100)) + - doc: document standard connection manager ([libp2p/go-libp2p#1099](https://github.com/libp2p/go-libp2p/pull/1099)) + - run go mod tidy in the examples ([libp2p/go-libp2p#1098](https://github.com/libp2p/go-libp2p/pull/1098)) + - Cleanup some remaining examples nits ([libp2p/go-libp2p#1097](https://github.com/libp2p/go-libp2p/pull/1097)) + - chore: bring examples back into repository and add tests ([libp2p/go-libp2p#1092](https://github.com/libp2p/go-libp2p/pull/1092)) + - fix(mkreleasenotes): handle first commit ([libp2p/go-libp2p#1095](https://github.com/libp2p/go-libp2p/pull/1095)) + - doc: add a basic release process ([libp2p/go-libp2p#1080](https://github.com/libp2p/go-libp2p/pull/1080)) + - chore: update yamux ([libp2p/go-libp2p#1089](https://github.com/libp2p/go-libp2p/pull/1089)) + - fix: re-expose AutoNAT service on BasicHost ([libp2p/go-libp2p#1088](https://github.com/libp2p/go-libp2p/pull/1088)) + - remove NEWS.md ([libp2p/go-libp2p#1086](https://github.com/libp2p/go-libp2p/pull/1086)) + - test: deflake TestProtoDowngrade ([libp2p/go-libp2p#1084](https://github.com/libp2p/go-libp2p/pull/1084)) + - sync: update CI config files (and fix tests) ([libp2p/go-libp2p#1083](https://github.com/libp2p/go-libp2p/pull/1083)) + - static check fixes ([libp2p/go-libp2p#1076](https://github.com/libp2p/go-libp2p/pull/1076)) + - fix go vet ([libp2p/go-libp2p#1075](https://github.com/libp2p/go-libp2p/pull/1075)) + - option for custom dns resolver ([libp2p/go-libp2p#1073](https://github.com/libp2p/go-libp2p/pull/1073)) + - chore: update deps ([libp2p/go-libp2p#1066](https://github.com/libp2p/go-libp2p/pull/1066)) + - fix autonat race ([libp2p/go-libp2p#1062](https://github.com/libp2p/go-libp2p/pull/1062)) + - use transient connections in identify streams ([libp2p/go-libp2p#1061](https://github.com/libp2p/go-libp2p/pull/1061)) + - Emit event for User's NAT Type i.e. Hard NAT or Easy NAT (#1042) ([libp2p/go-libp2p#1042](https://github.com/libp2p/go-libp2p/pull/1042)) + - Finish and Test the simultaneous connect problem in libp2p peers (#1041) ([libp2p/go-libp2p#1041](https://github.com/libp2p/go-libp2p/pull/1041)) + - Close peerstore and document Host Close (#1037) ([libp2p/go-libp2p#1037](https://github.com/libp2p/go-libp2p/pull/1037)) + - Timeout all Identify stream reads (#1032) ([libp2p/go-libp2p#1032](https://github.com/libp2p/go-libp2p/pull/1032)) +- github.com/libp2p/go-libp2p-autonat (v0.4.0 -> v0.4.2): + - Fix: Stream read timeout ([libp2p/go-libp2p-autonat#99](https://github.com/libp2p/go-libp2p-autonat/pull/99)) + - fix: simplify address replacement ([libp2p/go-libp2p-autonat#102](https://github.com/libp2p/go-libp2p-autonat/pull/102)) + - replace the port number for double NAT mapping ([libp2p/go-libp2p-autonat#101](https://github.com/libp2p/go-libp2p-autonat/pull/101)) +- github.com/libp2p/go-libp2p-core (v0.8.0 -> v0.8.5): + - mind the dot. + - context option for simultaneous connect + - Event for user's NAT Device Type: Tell user if the node is behind an Easy or Hard NAT (#173) ([libp2p/go-libp2p-core#173](https://github.com/libp2p/go-libp2p-core/pull/173)) + - address aarshian nitpicks + - make UseTransient context option take a reason argument, for consistency with other options + - abstract Conn Stat interface for threading + - Update network/context.go + - add ErrTransientConn error + - add support for transient connections + - more docs for stream fncs (#183) ([libp2p/go-libp2p-core#183](https://github.com/libp2p/go-libp2p-core/pull/183)) + - refactor: use a helper type to decode AddrInfo from JSON (#178) ([libp2p/go-libp2p-core#178](https://github.com/libp2p/go-libp2p-core/pull/178)) + - fix stream docs (#182) ([libp2p/go-libp2p-core#182](https://github.com/libp2p/go-libp2p-core/pull/182)) + - context to force direct dial (#181) ([libp2p/go-libp2p-core#181](https://github.com/libp2p/go-libp2p-core/pull/181)) + - Secure Muxer Interface (#180) ([libp2p/go-libp2p-core#180](https://github.com/libp2p/go-libp2p-core/pull/180)) +- github.com/libp2p/go-libp2p-discovery (v0.5.0 -> v0.5.1): + - Fix hang in BackoffDiscovery.FindPeers when requesting limit lower than number of peers available ([libp2p/go-libp2p-discovery#69](https://github.com/libp2p/go-libp2p-discovery/pull/69)) + - fix staticcheck ([libp2p/go-libp2p-discovery#70](https://github.com/libp2p/go-libp2p-discovery/pull/70)) +- github.com/libp2p/go-libp2p-kad-dht (v0.11.1 -> v0.12.2): + - fullrt rework batching (#720) ([libp2p/go-libp2p-kad-dht#720](https://github.com/libp2p/go-libp2p-kad-dht/pull/720)) + - sync: update CI config files ([libp2p/go-libp2p-kad-dht#712](https://github.com/libp2p/go-libp2p-kad-dht/pull/712)) + - fix staticcheck ([libp2p/go-libp2p-kad-dht#721](https://github.com/libp2p/go-libp2p-kad-dht/pull/721)) + - fix: fullrt dht bug fixes ([libp2p/go-libp2p-kad-dht#719](https://github.com/libp2p/go-libp2p-kad-dht/pull/719)) + - Crawler based DHT client (#709) ([libp2p/go-libp2p-kad-dht#709](https://github.com/libp2p/go-libp2p-kad-dht/pull/709)) + - test: fix unique addr check ([libp2p/go-libp2p-kad-dht#714](https://github.com/libp2p/go-libp2p-kad-dht/pull/714)) + - chore: update deps ([libp2p/go-libp2p-kad-dht#713](https://github.com/libp2p/go-libp2p-kad-dht/pull/713)) + - Add basic crawler (#663) ([libp2p/go-libp2p-kad-dht#663](https://github.com/libp2p/go-libp2p-kad-dht/pull/663)) + - various staticcheck fixes ([libp2p/go-libp2p-kad-dht#710](https://github.com/libp2p/go-libp2p-kad-dht/pull/710)) + - findpeer should work even on peers that are not part of DHT queries ([libp2p/go-libp2p-kad-dht#711](https://github.com/libp2p/go-libp2p-kad-dht/pull/711)) + - Extract DHT message sender from the DHT ([libp2p/go-libp2p-kad-dht#659](https://github.com/libp2p/go-libp2p-kad-dht/pull/659)) +- github.com/libp2p/go-libp2p-noise (v0.1.2 -> v0.2.0): + - Update github.com/flynn/noise to address nonce handling security issues ([libp2p/go-libp2p-noise#95](https://github.com/libp2p/go-libp2p-noise/pull/95)) + - fix staticcheck ([libp2p/go-libp2p-noise#96](https://github.com/libp2p/go-libp2p-noise/pull/96)) + - chore: update deps ([libp2p/go-libp2p-noise#94](https://github.com/libp2p/go-libp2p-noise/pull/94)) + - chore: relicense MIT/Apache-2.0 ([libp2p/go-libp2p-noise#93](https://github.com/libp2p/go-libp2p-noise/pull/93)) +- github.com/libp2p/go-libp2p-peerstore (v0.2.6 -> v0.2.7): + - fix: delete addrs when "updating" them to zero ([libp2p/go-libp2p-peerstore#157](https://github.com/libp2p/go-libp2p-peerstore/pull/157)) +- github.com/libp2p/go-libp2p-quic-transport (v0.10.0 -> v0.11.1): + - update quic-go, enable QUIC v1 (RFC 9000) ([libp2p/go-libp2p-quic-transport#207](https://github.com/libp2p/go-libp2p-quic-transport/pull/207)) + - update quic-go to v0.21.0-rc2 ([libp2p/go-libp2p-quic-transport#206](https://github.com/libp2p/go-libp2p-quic-transport/pull/206)) + - increase test timeout to reduce flakiness of test on Windows ([libp2p/go-libp2p-quic-transport#204](https://github.com/libp2p/go-libp2p-quic-transport/pull/204)) + - correctly export version negotiation failures to Prometheus ([libp2p/go-libp2p-quic-transport#205](https://github.com/libp2p/go-libp2p-quic-transport/pull/205)) + - update quic-go to v0.20.1 ([libp2p/go-libp2p-quic-transport#201](https://github.com/libp2p/go-libp2p-quic-transport/pull/201)) + - expose some Prometheus metrics ([libp2p/go-libp2p-quic-transport#200](https://github.com/libp2p/go-libp2p-quic-transport/pull/200)) + - update quic-go to v0.20.0 ([libp2p/go-libp2p-quic-transport#198](https://github.com/libp2p/go-libp2p-quic-transport/pull/198)) + - reduce the zstd window size from 8 MB to 32 KB ([libp2p/go-libp2p-quic-transport#195](https://github.com/libp2p/go-libp2p-quic-transport/pull/195)) + - compress qlogs when the QUIC connection is closed ([libp2p/go-libp2p-quic-transport#193](https://github.com/libp2p/go-libp2p-quic-transport/pull/193)) + - switch from gzip to zstd for qlog compression ([libp2p/go-libp2p-quic-transport#190](https://github.com/libp2p/go-libp2p-quic-transport/pull/190)) +- github.com/libp2p/go-libp2p-swarm (v0.4.0 -> v0.5.0): + - run connection gating tests on both TCP and QUIC ([libp2p/go-libp2p-swarm#258](https://github.com/libp2p/go-libp2p-swarm/pull/258)) + - fix: avoid returning typed nils ([libp2p/go-libp2p-swarm#257](https://github.com/libp2p/go-libp2p-swarm/pull/257)) + - fix staticcheck ([libp2p/go-libp2p-swarm#255](https://github.com/libp2p/go-libp2p-swarm/pull/255)) + - fix go vet ([libp2p/go-libp2p-swarm#253](https://github.com/libp2p/go-libp2p-swarm/pull/253)) + - New Dialer ([libp2p/go-libp2p-swarm#243](https://github.com/libp2p/go-libp2p-swarm/pull/243)) + - fix: use 64bit stream/conn IDs ([libp2p/go-libp2p-swarm#247](https://github.com/libp2p/go-libp2p-swarm/pull/247)) + - feat: close transports that implement io.Closer ([libp2p/go-libp2p-swarm#227](https://github.com/libp2p/go-libp2p-swarm/pull/227)) + - fix swarm transient conn (#241) ([libp2p/go-libp2p-swarm#241](https://github.com/libp2p/go-libp2p-swarm/pull/241)) + - Support for Hole punching (#233) ([libp2p/go-libp2p-swarm#233](https://github.com/libp2p/go-libp2p-swarm/pull/233)) + - Treat transient connections as opt-in when opening new streams ([libp2p/go-libp2p-swarm#236](https://github.com/libp2p/go-libp2p-swarm/pull/236)) + - avoid assigning a function to a variable ([libp2p/go-libp2p-swarm#239](https://github.com/libp2p/go-libp2p-swarm/pull/239)) + - only listen on localhost in tests ([libp2p/go-libp2p-swarm#238](https://github.com/libp2p/go-libp2p-swarm/pull/238)) + - prevent dialing addresses that we're listening on ([libp2p/go-libp2p-swarm#237](https://github.com/libp2p/go-libp2p-swarm/pull/237)) + - Enable QUIC in Test Swarm (#235) ([libp2p/go-libp2p-swarm#235](https://github.com/libp2p/go-libp2p-swarm/pull/235)) +- github.com/libp2p/go-libp2p-transport-upgrader (v0.4.0 -> v0.4.2): + - Expose underlying transport connection stat where available ([libp2p/go-libp2p-transport-upgrader#71](https://github.com/libp2p/go-libp2p-transport-upgrader/pull/71)) + - Implement support for simultaneous open (#25) ([libp2p/go-libp2p-transport-upgrader#25](https://github.com/libp2p/go-libp2p-transport-upgrader/pull/25)) +- github.com/libp2p/go-libp2p-yamux (v0.5.1 -> v0.5.4): + - remove Makefile ([libp2p/go-libp2p-yamux#35](https://github.com/libp2p/go-libp2p-yamux/pull/35)) +- github.com/libp2p/go-netroute (v0.1.3 -> v0.1.6): + - add js stub impl +- github.com/libp2p/go-sockaddr (v0.0.2 -> v0.1.1): + - fix: allocate "any" socket type then cast ([libp2p/go-sockaddr#20](https://github.com/libp2p/go-sockaddr/pull/20)) + - fix: remove CGO functions ([libp2p/go-sockaddr#18](https://github.com/libp2p/go-sockaddr/pull/18)) +- github.com/libp2p/go-tcp-transport (v0.2.1 -> v0.2.2): + - use log.Warn instead of log.Warning ([libp2p/go-tcp-transport#77](https://github.com/libp2p/go-tcp-transport/pull/77)) + - add bandwidth-related metrics (for Linux and OSX) ([libp2p/go-tcp-transport#76](https://github.com/libp2p/go-tcp-transport/pull/76)) + - expose some Prometheus metrics ([libp2p/go-tcp-transport#75](https://github.com/libp2p/go-tcp-transport/pull/75)) + - enable TCP keepalives ([libp2p/go-tcp-transport#73](https://github.com/libp2p/go-tcp-transport/pull/73)) + - stop using the deprecated go-multiaddr-net package ([libp2p/go-tcp-transport#72](https://github.com/libp2p/go-tcp-transport/pull/72)) +- github.com/libp2p/go-yamux/v2 (v2.0.0 -> v2.2.0): + - make the initial stream receive window configurable ([libp2p/go-yamux#59](https://github.com/libp2p/go-yamux/pull/59)) + - set initial window size to spec value (256 kB), remove config option ([libp2p/go-yamux#57](https://github.com/libp2p/go-yamux/pull/57)) + - fix: don't change the receive window if we're forcing an update ([libp2p/go-yamux#56](https://github.com/libp2p/go-yamux/pull/56)) + - sync: update CI config files ([libp2p/go-yamux#55](https://github.com/libp2p/go-yamux/pull/55)) + - increase the receive window size if we're sending updates to frequently ([libp2p/go-yamux#54](https://github.com/libp2p/go-yamux/pull/54)) + - remove unused Stream.Shrink() method ([libp2p/go-yamux#52](https://github.com/libp2p/go-yamux/pull/52)) + - remove misleading comment about the MaxMessageSize ([libp2p/go-yamux#50](https://github.com/libp2p/go-yamux/pull/50)) + - clean up the receive window check ([libp2p/go-yamux#49](https://github.com/libp2p/go-yamux/pull/49)) + - don't reslice byte slices taking from the buffer ([libp2p/go-yamux#48](https://github.com/libp2p/go-yamux/pull/48)) + - don't reimplement io.ReadFull ([libp2p/go-yamux#38](https://github.com/libp2p/go-yamux/pull/38)) + - remove the recvLock in the stream ([libp2p/go-yamux#42](https://github.com/libp2p/go-yamux/pull/42)) + - remove the sendLock in the stream ([libp2p/go-yamux#41](https://github.com/libp2p/go-yamux/pull/41)) + - remove misleading statement about NAT traversal ([libp2p/go-yamux#45](https://github.com/libp2p/go-yamux/pull/45)) + - remove .gx directory, add last gx version to README ([libp2p/go-yamux#43](https://github.com/libp2p/go-yamux/pull/43)) + - reduce usage of goto ([libp2p/go-yamux#40](https://github.com/libp2p/go-yamux/pull/40)) + - remove unused error return value in Stream.processFlags ([libp2p/go-yamux#39](https://github.com/libp2p/go-yamux/pull/39)) +- github.com/lucas-clemente/quic-go (v0.19.3 -> v0.21.1): + - add support for Go 1.17 Beta 1 ([lucas-clemente/quic-go#3203](https://github.com/lucas-clemente/quic-go/pull/3203)) + - add a CI test that go mod vendor works ([lucas-clemente/quic-go#3202](https://github.com/lucas-clemente/quic-go/pull/3202)) + - prevent go mod vendor from stumbling over the Go 1.18 file ([lucas-clemente/quic-go#3195](https://github.com/lucas-clemente/quic-go/pull/3195)) + - remove CipherSuiteName and HkdfExtract for Go 1.17 ([lucas-clemente/quic-go#3192](https://github.com/lucas-clemente/quic-go/pull/3192)) + - fix relocation target for cipherSuiteTLS13ByID in Go 1.17 + - use HkdfExtract from x/crypto ([lucas-clemente/quic-go#3173](https://github.com/lucas-clemente/quic-go/pull/3173)) + - add support for QUIC v1, RFC 9000 ([lucas-clemente/quic-go#3190](https://github.com/lucas-clemente/quic-go/pull/3190)) + - use tls.CipherSuiteName, instead of wrapping it in the qtls package ([lucas-clemente/quic-go#3174](https://github.com/lucas-clemente/quic-go/pull/3174)) + - use a pre-generated test vectors to test hkdfExpandLabel ([lucas-clemente/quic-go#3175](https://github.com/lucas-clemente/quic-go/pull/3175)) + - reduce flakiness of packet number generation test ([lucas-clemente/quic-go#3181](https://github.com/lucas-clemente/quic-go/pull/3181)) + - simplify the qtls tests ([lucas-clemente/quic-go#3185](https://github.com/lucas-clemente/quic-go/pull/3185)) + - add support for Go 1.17 (tip) ([lucas-clemente/quic-go#3182](https://github.com/lucas-clemente/quic-go/pull/3182)) + - prevent quic-go from building on Go 1.17 ([lucas-clemente/quic-go#3180](https://github.com/lucas-clemente/quic-go/pull/3180)) + - fix DONT_FRAGMENT error when using a IPv6 connection on Windows ([lucas-clemente/quic-go#3178](https://github.com/lucas-clemente/quic-go/pull/3178)) + - use net.ErrClosed (for Go 1.16) ([lucas-clemente/quic-go#3163](https://github.com/lucas-clemente/quic-go/pull/3163)) + - use the new error types to log the reason why a connection is closed ([lucas-clemente/quic-go#3166](https://github.com/lucas-clemente/quic-go/pull/3166)) + - fix race condition in deadline integration test ([lucas-clemente/quic-go#3165](https://github.com/lucas-clemente/quic-go/pull/3165)) + - add support for QUIC v1 ([lucas-clemente/quic-go#3160](https://github.com/lucas-clemente/quic-go/pull/3160)) + - rework error return values ([lucas-clemente/quic-go#3159](https://github.com/lucas-clemente/quic-go/pull/3159)) + - declare Path MTU probe packets lost with the early retransmit timer ([lucas-clemente/quic-go#3152](https://github.com/lucas-clemente/quic-go/pull/3152)) + - declare the handshake confirmed when receiving an ACK for a 1-RTT packet ([lucas-clemente/quic-go#3148](https://github.com/lucas-clemente/quic-go/pull/3148)) + - trace and qlog version selection / negotiation ([lucas-clemente/quic-go#3153](https://github.com/lucas-clemente/quic-go/pull/3153)) + - set the don't fragment (DF) bit on Windows (#3155) ([lucas-clemente/quic-go#3155](https://github.com/lucas-clemente/quic-go/pull/3155)) + - fix doc comment for Tracer.TracerForConnection ([lucas-clemente/quic-go#3154](https://github.com/lucas-clemente/quic-go/pull/3154)) + - make it possible to associate a ConnectionTracer with a Session ([lucas-clemente/quic-go#3146](https://github.com/lucas-clemente/quic-go/pull/3146)) + - remove the .editorconfig ([lucas-clemente/quic-go#3147](https://github.com/lucas-clemente/quic-go/pull/3147)) + - don't use a lower RTT than 5ms after receiving a Retry packet ([lucas-clemente/quic-go#3129](https://github.com/lucas-clemente/quic-go/pull/3129)) + - don't pass the QUIC version to the StartedConnection event ([lucas-clemente/quic-go#3109](https://github.com/lucas-clemente/quic-go/pull/3109)) + - update the packet numbers in decoding test to the ones from the draft ([lucas-clemente/quic-go#3137](https://github.com/lucas-clemente/quic-go/pull/3137)) + - various amplification limit fixes ([lucas-clemente/quic-go#3132](https://github.com/lucas-clemente/quic-go/pull/3132)) + - fix calculation of the handshake idle timeout ([lucas-clemente/quic-go#3120](https://github.com/lucas-clemente/quic-go/pull/3120)) + - only start PMTUD after handshake confirmation ([lucas-clemente/quic-go#3138](https://github.com/lucas-clemente/quic-go/pull/3138)) + - don't regard PMTU probe packets as outstanding ([lucas-clemente/quic-go#3126](https://github.com/lucas-clemente/quic-go/pull/3126)) + - expose the draft-34 version ([lucas-clemente/quic-go#3100](https://github.com/lucas-clemente/quic-go/pull/3100)) + - clean up the testutils ([lucas-clemente/quic-go#3104](https://github.com/lucas-clemente/quic-go/pull/3104)) + - initialize the congestion controller with the actual max datagram size ([lucas-clemente/quic-go#3107](https://github.com/lucas-clemente/quic-go/pull/3107)) + - make it possible to trace acknowledged packets ([lucas-clemente/quic-go#3134](https://github.com/lucas-clemente/quic-go/pull/3134)) + - avoid type confusion between protocol.PacketType and logging.PacketType ([lucas-clemente/quic-go#3108](https://github.com/lucas-clemente/quic-go/pull/3108)) + - fix duplicate logging of errors when the first error was a timeout error ([lucas-clemente/quic-go#3112](https://github.com/lucas-clemente/quic-go/pull/3112)) + - use a tracer to make the packetization test more useful ([lucas-clemente/quic-go#3136](https://github.com/lucas-clemente/quic-go/pull/3136)) + - improve string representation of timeout errors ([lucas-clemente/quic-go#3118](https://github.com/lucas-clemente/quic-go/pull/3118)) + - fix flaky timeout test ([lucas-clemente/quic-go#3105](https://github.com/lucas-clemente/quic-go/pull/3105)) + - fix calculation of the time for the next keep alive + - add a 0-RTT test with different connecton ID lengths ([lucas-clemente/quic-go#3098](https://github.com/lucas-clemente/quic-go/pull/3098)) + - only run Ginkgo focus detection in staged files in pre-commit hook ([lucas-clemente/quic-go#3099](https://github.com/lucas-clemente/quic-go/pull/3099)) + - allow 0-RTT when flow control windows are increased ([lucas-clemente/quic-go#3096](https://github.com/lucas-clemente/quic-go/pull/3096)) + - improve the 0-RTT rejection integration test ([lucas-clemente/quic-go#3097](https://github.com/lucas-clemente/quic-go/pull/3097)) + - rename config values for flow control limits ([lucas-clemente/quic-go#3089](https://github.com/lucas-clemente/quic-go/pull/3089)) + - allow 0-RTT resumption if the server's stream limit was increased ([lucas-clemente/quic-go#3086](https://github.com/lucas-clemente/quic-go/pull/3086)) + - cache the serialized OOB in the conn, not in the packet info ([lucas-clemente/quic-go#3093](https://github.com/lucas-clemente/quic-go/pull/3093)) + - use code points from x/sys/unix for PKTINFO syscalls ([lucas-clemente/quic-go#3094](https://github.com/lucas-clemente/quic-go/pull/3094)) + - make it possible to detect version negotiation failures in logging, fix qlogging of those ([lucas-clemente/quic-go#3092](https://github.com/lucas-clemente/quic-go/pull/3092)) + - make the initial stream / connection flow control windows configurable ([lucas-clemente/quic-go#3083](https://github.com/lucas-clemente/quic-go/pull/3083)) + - only apply server's transport parameters after handshake completion ([lucas-clemente/quic-go#3085](https://github.com/lucas-clemente/quic-go/pull/3085)) + - fix documentation for baseFlowController.UpdateSendWindow ([lucas-clemente/quic-go#3087](https://github.com/lucas-clemente/quic-go/pull/3087)) + - set the Content-Length for HTTP/3 responses ([lucas-clemente/quic-go#3091](https://github.com/lucas-clemente/quic-go/pull/3091)) + - update the flow control windows of streams opened in 0-RTT ([lucas-clemente/quic-go#3088](https://github.com/lucas-clemente/quic-go/pull/3088)) + - Use the correct source IP when binding multiple IPs ([lucas-clemente/quic-go#3067](https://github.com/lucas-clemente/quic-go/pull/3067)) + - fix race condition when receiving 0-RTT packets ([lucas-clemente/quic-go#3074](https://github.com/lucas-clemente/quic-go/pull/3074)) + - require the application to handle 0-RTT rejection ([lucas-clemente/quic-go#3066](https://github.com/lucas-clemente/quic-go/pull/3066)) + - add an internal queue to signal that a datagram frame has been dequeued ([lucas-clemente/quic-go#3081](https://github.com/lucas-clemente/quic-go/pull/3081)) + - increase the maximum size of DATAGRAM frames ([lucas-clemente/quic-go#2966](https://github.com/lucas-clemente/quic-go/pull/2966)) + - remove non-functioning 0-RTT test with different conn ID lengths ([lucas-clemente/quic-go#3079](https://github.com/lucas-clemente/quic-go/pull/3079)) + - remove stray struct equality check ([lucas-clemente/quic-go#3078](https://github.com/lucas-clemente/quic-go/pull/3078)) + - fix issuing of connection IDs when dialing a 0-RTT connections ([lucas-clemente/quic-go#3058](https://github.com/lucas-clemente/quic-go/pull/3058)) + - only accept 0-RTT it the active_connection_id_limit didn't change ([lucas-clemente/quic-go#3060](https://github.com/lucas-clemente/quic-go/pull/3060)) + - remove unused error return value from HandleMaxStreamsFrame ([lucas-clemente/quic-go#3072](https://github.com/lucas-clemente/quic-go/pull/3072)) + - fix flaky accept queue integration test ([lucas-clemente/quic-go#3068](https://github.com/lucas-clemente/quic-go/pull/3068)) + - don't reset the QPACK encoder / decoder streams ([lucas-clemente/quic-go#3063](https://github.com/lucas-clemente/quic-go/pull/3063)) + - remove incorrect logging for client side retry packet ([lucas-clemente/quic-go#3071](https://github.com/lucas-clemente/quic-go/pull/3071)) + - allow sending 1xx responses (#3047) ([lucas-clemente/quic-go#3047](https://github.com/lucas-clemente/quic-go/pull/3047)) + - fix retry key and nonce for draft-34 ([lucas-clemente/quic-go#3062](https://github.com/lucas-clemente/quic-go/pull/3062)) + - implement DPLPMTUD ([lucas-clemente/quic-go#3028](https://github.com/lucas-clemente/quic-go/pull/3028)) + - only read multiple packets at a time after handshake completion ([lucas-clemente/quic-go#3041](https://github.com/lucas-clemente/quic-go/pull/3041)) + - make the certificate verificiation integration tests more explicit ([lucas-clemente/quic-go#3040](https://github.com/lucas-clemente/quic-go/pull/3040)) + - update gomock to v1.5.0, use mockgen source mode ([lucas-clemente/quic-go#3049](https://github.com/lucas-clemente/quic-go/pull/3049)) + - trace dropping of 0-RTT keys ([lucas-clemente/quic-go#3054](https://github.com/lucas-clemente/quic-go/pull/3054)) + - improve timeout measurement in the timeout test ([lucas-clemente/quic-go#3042](https://github.com/lucas-clemente/quic-go/pull/3042)) + - add a randomized test for the received_packet_history ([lucas-clemente/quic-go#3052](https://github.com/lucas-clemente/quic-go/pull/3052)) + - fix documentation of default values for MaxReceive{Stream, Connection}FlowControlWindow ([lucas-clemente/quic-go#3055](https://github.com/lucas-clemente/quic-go/pull/3055)) + - refactor merge packet number ranges ([lucas-clemente/quic-go#3051](https://github.com/lucas-clemente/quic-go/pull/3051)) + - add draft-34 to support versions in README + - update README to reflect dropped Go 1.14 support + - remove redundant nil-check in the packet packer ([lucas-clemente/quic-go#3048](https://github.com/lucas-clemente/quic-go/pull/3048)) + - avoid using rand.Source ([lucas-clemente/quic-go#3046](https://github.com/lucas-clemente/quic-go/pull/3046)) + - update Go to 1.16, drop support for 1.14 ([lucas-clemente/quic-go#3045](https://github.com/lucas-clemente/quic-go/pull/3045)) + - fix error message when the UDP receive buffer size can't be increased ([lucas-clemente/quic-go#3039](https://github.com/lucas-clemente/quic-go/pull/3039)) + - add the time_format field to qlog common_fields ([lucas-clemente/quic-go#3038](https://github.com/lucas-clemente/quic-go/pull/3038)) + - log connection IDs without the 0x prefix ([lucas-clemente/quic-go#3036](https://github.com/lucas-clemente/quic-go/pull/3036)) + - add support for QUIC draft-34 ([lucas-clemente/quic-go#3031](https://github.com/lucas-clemente/quic-go/pull/3031)) + - fix qtls imports in mockgen generated mocks ([lucas-clemente/quic-go#3037](https://github.com/lucas-clemente/quic-go/pull/3037)) + - improve error message when the read buffer size can't be set ([lucas-clemente/quic-go#3030](https://github.com/lucas-clemente/quic-go/pull/3030)) + - qlog the quic-go version ([lucas-clemente/quic-go#3033](https://github.com/lucas-clemente/quic-go/pull/3033)) + - remove the metrics package ([lucas-clemente/quic-go#3032](https://github.com/lucas-clemente/quic-go/pull/3032)) + - expose the constructor for the qlog connection tracer ([lucas-clemente/quic-go#3034](https://github.com/lucas-clemente/quic-go/pull/3034)) + - expose the constructor for the multipexed connection tracer ([lucas-clemente/quic-go#3035](https://github.com/lucas-clemente/quic-go/pull/3035)) + - make sure the server is stopped before closing all server sessions ([lucas-clemente/quic-go#3020](https://github.com/lucas-clemente/quic-go/pull/3020)) + - increase the size of the send queue ([lucas-clemente/quic-go#3016](https://github.com/lucas-clemente/quic-go/pull/3016)) + - prioritize receiving packets over sending out more packets ([lucas-clemente/quic-go#3015](https://github.com/lucas-clemente/quic-go/pull/3015)) + - reenable key updates for HTTP/3 ([lucas-clemente/quic-go#3017](https://github.com/lucas-clemente/quic-go/pull/3017)) + - check for errors after handling each previously undecryptable packet ([lucas-clemente/quic-go#3011](https://github.com/lucas-clemente/quic-go/pull/3011)) + - fix flaky streams map test on Windows ([lucas-clemente/quic-go#3013](https://github.com/lucas-clemente/quic-go/pull/3013)) + - fix flaky stream cancelation integration test ([lucas-clemente/quic-go#3014](https://github.com/lucas-clemente/quic-go/pull/3014)) + - preallocate a slice of one frame when packing a packet ([lucas-clemente/quic-go#3018](https://github.com/lucas-clemente/quic-go/pull/3018)) + - allow sending of ACKs when pacing limited ([lucas-clemente/quic-go#3010](https://github.com/lucas-clemente/quic-go/pull/3010)) + - fix qlogging of the packet payload length ([lucas-clemente/quic-go#3004](https://github.com/lucas-clemente/quic-go/pull/3004)) + - corrupt more ACKs in the MITM test ([lucas-clemente/quic-go#3007](https://github.com/lucas-clemente/quic-go/pull/3007)) + - fix flaky key update integration test ([lucas-clemente/quic-go#3005](https://github.com/lucas-clemente/quic-go/pull/3005)) + - immediately complete streams that were canceled, drop retransmissions ([lucas-clemente/quic-go#3003](https://github.com/lucas-clemente/quic-go/pull/3003)) + - stop generating new packets when the send queue is full ([lucas-clemente/quic-go#2971](https://github.com/lucas-clemente/quic-go/pull/2971)) + - allow access to the underlying quic.Stream from a http.ResponseWriter ([lucas-clemente/quic-go#2993](https://github.com/lucas-clemente/quic-go/pull/2993)) + - remove stay print statement from session test + - allow receiving of multiple packets before sending a packet ([lucas-clemente/quic-go#2984](https://github.com/lucas-clemente/quic-go/pull/2984)) + - use cryptographic random for determining skipped packet numbers ([lucas-clemente/quic-go#2940](https://github.com/lucas-clemente/quic-go/pull/2940)) + - fix interpretation of time.Time{} as a pacing deadline ([lucas-clemente/quic-go#2980](https://github.com/lucas-clemente/quic-go/pull/2980)) + - qlog restored transport parameters ([lucas-clemente/quic-go#2991](https://github.com/lucas-clemente/quic-go/pull/2991)) + - use a pkg.go.dev instead of a GoDoc badge ([lucas-clemente/quic-go#2982](https://github.com/lucas-clemente/quic-go/pull/2982)) + - introduce a separate queue for undecryptable packets ([lucas-clemente/quic-go#2988](https://github.com/lucas-clemente/quic-go/pull/2988)) + - improve 0-RTT queue ([lucas-clemente/quic-go#2990](https://github.com/lucas-clemente/quic-go/pull/2990)) + - simplify switch statement in the transport parameter parser ([lucas-clemente/quic-go#2995](https://github.com/lucas-clemente/quic-go/pull/2995)) + - remove unneeded overflow check when parsing the max_ack_delay ([lucas-clemente/quic-go#2996](https://github.com/lucas-clemente/quic-go/pull/2996)) + - remove unneeded check in receivedPacketHandler.IsPotentiallyDuplicate ([lucas-clemente/quic-go#2998](https://github.com/lucas-clemente/quic-go/pull/2998)) + - qlog the max_datagram_frame_size transport parameter ([lucas-clemente/quic-go#2997](https://github.com/lucas-clemente/quic-go/pull/2997)) + - qlog draft-02 fixes ([lucas-clemente/quic-go#2987](https://github.com/lucas-clemente/quic-go/pull/2987)) + - fix flaky qlog test ([lucas-clemente/quic-go#2981](https://github.com/lucas-clemente/quic-go/pull/2981)) + - only run gofumpt on .go files in pre-commit hook ([lucas-clemente/quic-go#2983](https://github.com/lucas-clemente/quic-go/pull/2983)) + - fix outdated comment for the http3.Server + - make the OpenStreamSync cancelation test less flaky ([lucas-clemente/quic-go#2978](https://github.com/lucas-clemente/quic-go/pull/2978)) + - add some useful pre-commit hooks ([lucas-clemente/quic-go#2979](https://github.com/lucas-clemente/quic-go/pull/2979)) + - publicize QUIC varint reading and writing ([lucas-clemente/quic-go#2973](https://github.com/lucas-clemente/quic-go/pull/2973)) + - add a http3.RoundTripOpt to skip the request scheme check ([lucas-clemente/quic-go#2962](https://github.com/lucas-clemente/quic-go/pull/2962)) + - use the standard quic.Config in the deadline tests ([lucas-clemente/quic-go#2970](https://github.com/lucas-clemente/quic-go/pull/2970)) + - update golangci-lint to v1.34.1 ([lucas-clemente/quic-go#2964](https://github.com/lucas-clemente/quic-go/pull/2964)) + - update text about QUIC versions in the README ([lucas-clemente/quic-go#2975](https://github.com/lucas-clemente/quic-go/pull/2975)) + - remove stray TODO in the http3.Server + - add support for Go 1.16 ([lucas-clemente/quic-go#2953](https://github.com/lucas-clemente/quic-go/pull/2953)) + - cancel reading on unidirectional streams when the stream type is unknown ([lucas-clemente/quic-go#2952](https://github.com/lucas-clemente/quic-go/pull/2952)) + - remove duplicate check of the URL scheme in the HTTP/3 client ([lucas-clemente/quic-go#2956](https://github.com/lucas-clemente/quic-go/pull/2956)) + - increase queueing duration in 0-RTT queue test to reduce flakiness ([lucas-clemente/quic-go#2954](https://github.com/lucas-clemente/quic-go/pull/2954)) + - implement the HTTP/3 Datagram negotiation ([lucas-clemente/quic-go#2951](https://github.com/lucas-clemente/quic-go/pull/2951)) + - implement HTTP/3 control stream handling ([lucas-clemente/quic-go#2949](https://github.com/lucas-clemente/quic-go/pull/2949)) + - fix flaky sentPacketHandler test ([lucas-clemente/quic-go#2950](https://github.com/lucas-clemente/quic-go/pull/2950)) + - don't retransmit PING frames added to ACK-only packets ([lucas-clemente/quic-go#2942](https://github.com/lucas-clemente/quic-go/pull/2942)) + - move the transport parameter stream limit check to the parser ([lucas-clemente/quic-go#2944](https://github.com/lucas-clemente/quic-go/pull/2944)) + - remove unused initialVersion variable in session ([lucas-clemente/quic-go#2946](https://github.com/lucas-clemente/quic-go/pull/2946)) + - remove unneeded check for the peer's transport parameters ([lucas-clemente/quic-go#2945](https://github.com/lucas-clemente/quic-go/pull/2945)) + - add the H3_MESSAGE_ERROR ([lucas-clemente/quic-go#2947](https://github.com/lucas-clemente/quic-go/pull/2947)) + - simplify Read and Write mock calls in http3 tests ([lucas-clemente/quic-go#2948](https://github.com/lucas-clemente/quic-go/pull/2948)) + - implement the datagram draft ([lucas-clemente/quic-go#2162](https://github.com/lucas-clemente/quic-go/pull/2162)) + - fix logging of bytes_in_flight when receiving an ACK ([lucas-clemente/quic-go#2937](https://github.com/lucas-clemente/quic-go/pull/2937)) + - trace when a packet is dropped because the receivedPackets chan is full ([lucas-clemente/quic-go#2939](https://github.com/lucas-clemente/quic-go/pull/2939)) + - various improvements to the packet number generator ([lucas-clemente/quic-go#2905](https://github.com/lucas-clemente/quic-go/pull/2905)) + - introduce a quic.Config.HandshakeIdleTimeout, remove HandshakeTimeout ([lucas-clemente/quic-go#2930](https://github.com/lucas-clemente/quic-go/pull/2930)) + - allow up to 20 byte for the initial connection IDs ([lucas-clemente/quic-go#2936](https://github.com/lucas-clemente/quic-go/pull/2936)) + - reduce memory footprint of undecryptable packet handling ([lucas-clemente/quic-go#2932](https://github.com/lucas-clemente/quic-go/pull/2932)) + - use a buffer from the pool for composing Retry packets ([lucas-clemente/quic-go#2934](https://github.com/lucas-clemente/quic-go/pull/2934)) + - release the packet buffer after sending a CONNECTION_CLOSE in the server ([lucas-clemente/quic-go#2935](https://github.com/lucas-clemente/quic-go/pull/2935)) + - move integration tests to GitHub Actions, disable Travis ([lucas-clemente/quic-go#2891](https://github.com/lucas-clemente/quic-go/pull/2891)) + - use golang.org/x/sys/unix instead of syscall ([lucas-clemente/quic-go#2927](https://github.com/lucas-clemente/quic-go/pull/2927)) + - add support for the connection_closed qlog event ([lucas-clemente/quic-go#2921](https://github.com/lucas-clemente/quic-go/pull/2921)) + - qlog tokens in NEW_TOKEN frames, Retry packets and Initial packets ([lucas-clemente/quic-go#2863](https://github.com/lucas-clemente/quic-go/pull/2863)) + - qlog the packet_type as part of the packet header, not the event itself ([lucas-clemente/quic-go#2758](https://github.com/lucas-clemente/quic-go/pull/2758)) + - use the new, streaming-friendly NDJSON-based qlog encoding ([lucas-clemente/quic-go#2736](https://github.com/lucas-clemente/quic-go/pull/2736)) + - add a generic Debug() function to the connection tracer ([lucas-clemente/quic-go#2909](https://github.com/lucas-clemente/quic-go/pull/2909)) + - remove unnecessary call to time.Now() when sending a packet ([lucas-clemente/quic-go#2911](https://github.com/lucas-clemente/quic-go/pull/2911)) + - remove support for quic-trace ([lucas-clemente/quic-go#2913](https://github.com/lucas-clemente/quic-go/pull/2913)) + - reduce the maximum number of ACK ranges ([lucas-clemente/quic-go#2887](https://github.com/lucas-clemente/quic-go/pull/2887)) + - don't allocate for acked packets ([lucas-clemente/quic-go#2899](https://github.com/lucas-clemente/quic-go/pull/2899)) + - avoid allocating when detecting lost packets ([lucas-clemente/quic-go#2898](https://github.com/lucas-clemente/quic-go/pull/2898)) + - use the string optimization for map keys in the packet handler map ([lucas-clemente/quic-go#2892](https://github.com/lucas-clemente/quic-go/pull/2892)) + - use a single map in the incoming streams map ([lucas-clemente/quic-go#2890](https://github.com/lucas-clemente/quic-go/pull/2890)) +- github.com/marten-seemann/qtls-go1-15 (v0.1.1 -> v0.1.4): + - use a prefix for client session cache keys + - add callbacks to store and restore app data along a session state + - don't use TLS 1.3 compatibility mode when using alternative record layer + - delete the session ticket after attempting 0-RTT + - reject 0-RTT when a different ALPN is chosen + - encode the ALPN into the session ticket + - add a field to the ConnectionState to tell if 0-RTT was used + - add a callback to tell the client about rejection of 0-RTT + - don't offer 0-RTT after a HelloRetryRequest + - add Accept0RTT to Config callback to decide if 0-RTT should be accepted +- github.com/marten-seemann/qtls-go1-16 (null -> v0.1.3): + - use a prefix for client session cache keys + - add callbacks to store and restore app data along a session state + - don't use TLS 1.3 compatibility mode when using alternative record layer + - delete the session ticket after attempting 0-RTT + - reject 0-RTT when a different ALPN is chosen +- github.com/multiformats/go-multiaddr (v0.3.1 -> v0.3.2): + - fix(net): export new net.Addr conversion registration functions ([multiformats/go-multiaddr#152](https://github.com/multiformats/go-multiaddr/pull/152)) + - sync: run go mod tidy (and set Go 1.15) and gofmt -s in copy workflow (#146) ([multiformats/go-multiaddr#146](https://github.com/multiformats/go-multiaddr/pull/146)) + - more linter fixes ([multiformats/go-multiaddr#145](https://github.com/multiformats/go-multiaddr/pull/145)) + - fix go vet and staticcheck failures ([multiformats/go-multiaddr#143](https://github.com/multiformats/go-multiaddr/pull/143)) + - don't listen on all interfaces in tests, unless on CI ([multiformats/go-multiaddr#136](https://github.com/multiformats/go-multiaddr/pull/136)) + - Fix Local Address on TCP connections ([multiformats/go-multiaddr#135](https://github.com/multiformats/go-multiaddr/pull/135)) +- github.com/multiformats/go-multiaddr-dns (v0.2.0 -> v0.3.1): + - Normalize domains to fqdn for resolver selection ([multiformats/go-multiaddr-dns#27](https://github.com/multiformats/go-multiaddr-dns/pull/27)) + - refactor Resolver to support custom per-TLD resolvers ([multiformats/go-multiaddr-dns#26](https://github.com/multiformats/go-multiaddr-dns/pull/26)) + - feat: exposes backend ([multiformats/go-multiaddr-dns#25](https://github.com/multiformats/go-multiaddr-dns/pull/25)) +- github.com/multiformats/go-multihash (v0.0.14 -> v0.0.15): + - Refactor registry system: no direct dependencies; expose standard hash.Hash; be a data carrier. ([multiformats/go-multihash#136](https://github.com/multiformats/go-multihash/pull/136)) +- github.com/multiformats/go-multistream (v0.2.0 -> v0.2.2): + - change the simultaneous open protocol to /libp2p/simultaneous-connect ([multiformats/go-multistream#66](https://github.com/multiformats/go-multistream/pull/66)) + - fix the lazy stress read test on Windows ([multiformats/go-multistream#61](https://github.com/multiformats/go-multistream/pull/61)) + - fix go vet and staticcheck errors ([multiformats/go-multistream#60](https://github.com/multiformats/go-multistream/pull/60)) + - Implement simultaneous open extension ([multiformats/go-multistream#42](https://github.com/multiformats/go-multistream/pull/42)) + - reduce the number of streams in the stress tests, fix error handling ([multiformats/go-multistream#54](https://github.com/multiformats/go-multistream/pull/54)) +- github.com/whyrusleeping/cbor-gen (v0.0.0-20200710004633-5379fc63235d -> v0.0.0-20210219115102-f37d292932f2): + - feat: allow unmarshaling of struct with more fields than marshaled struct ([whyrusleeping/cbor-gen#50](https://github.com/whyrusleeping/cbor-gen/pull/50)) + - chore: add a license file ([whyrusleeping/cbor-gen#49](https://github.com/whyrusleeping/cbor-gen/pull/49)) + - fix: enforce maxlen in ReadByteArray() ([whyrusleeping/cbor-gen#43](https://github.com/whyrusleeping/cbor-gen/pull/43)) + - use unix nanoseconds for encoding Cbortime ([whyrusleeping/cbor-gen#41](https://github.com/whyrusleeping/cbor-gen/pull/41)) + - add json marshalers to CborTime + - add a helper for roundtripping time.time objects ([whyrusleeping/cbor-gen#40](https://github.com/whyrusleeping/cbor-gen/pull/40)) + - Add a validate function. ([whyrusleeping/cbor-gen#39](https://github.com/whyrusleeping/cbor-gen/pull/39)) + - Fix import handling ([whyrusleeping/cbor-gen#38](https://github.com/whyrusleeping/cbor-gen/pull/38)) + - Optimize discarding in ScanForLinks ([whyrusleeping/cbor-gen#36](https://github.com/whyrusleeping/cbor-gen/pull/36)) + - Always allocate scratch space when marshalling into a map. ([whyrusleeping/cbor-gen#37](https://github.com/whyrusleeping/cbor-gen/pull/37)) + - optimize byte reading ([whyrusleeping/cbor-gen#35](https://github.com/whyrusleeping/cbor-gen/pull/35)) + - Optimize decoding ([whyrusleeping/cbor-gen#34](https://github.com/whyrusleeping/cbor-gen/pull/34)) + - Fix named string issue ([whyrusleeping/cbor-gen#30](https://github.com/whyrusleeping/cbor-gen/pull/30)) + - Fix encoding/decoding fixed byte arrays ([whyrusleeping/cbor-gen#29](https://github.com/whyrusleeping/cbor-gen/pull/29)) + - fix overread on scanforlinks ([whyrusleeping/cbor-gen#28](https://github.com/whyrusleeping/cbor-gen/pull/28)) + +### ❤️ Contributors + +| Contributor | Commits | Lines ± | Files Changed | +|-------------|---------|---------|---------------| +| Marten Seemann | 358 | +17444/-12000 | 1268 | +| Eric Myhre | 82 | +9672/-2459 | 328 | +| Ian Davis | 7 | +8421/-737 | 116 | +| Daniel Martí | 18 | +2733/-4377 | 313 | +| Adin Schmahmann | 46 | +5387/-1289 | 125 | +| Steven Allen | 95 | +3278/-1861 | 200 | +| hannahhoward | 14 | +1380/-3667 | 84 | +| gammazero | 29 | +2520/-1161 | 88 | +| Hector Sanjuan | 12 | +511/-3129 | 52 | +| vyzo | 77 | +2198/-940 | 117 | +| Will Scott | 12 | +912/-593 | 37 | +| Dirk McCormick | 3 | +1384/-63 | 14 | +| Andrew Gillis | 3 | +1231/-39 | 19 | +| Marcin Rataj | 37 | +549/-308 | 72 | +| Aarsh Shah | 13 | +668/-86 | 30 | +| Olivier Poitrey | 1 | +469/-182 | 15 | +| Rod Vagg | 9 | +364/-184 | 14 | +| whyrusleeping | 5 | +253/-32 | 11 | +| Cory Schwartz | 10 | +162/-115 | 37 | +| Adrian Lanzafame | 8 | +212/-60 | 11 | +| aarshkshah1992 | 7 | +102/-110 | 9 | +| Jakub Sztandera | 7 | +126/-75 | 16 | +| huoju | 4 | +127/-41 | 6 | +| acruikshank | 6 | +32/-24 | 7 | +| Toby | 1 | +41/-1 | 2 | +| Naveen | 1 | +40/-0 | 1 | +| Bogdan Stirbat | 1 | +22/-16 | 2 | +| Kévin Dunglas | 1 | +32/-2 | 2 | +| Nicholas Bollweg | 1 | +22/-0 | 1 | +| q191201771 | 2 | +4/-11 | 2 | +| Mathis Engelbart | 1 | +12/-2 | 1 | +| requilence | 1 | +13/-0 | 1 | +| divingpetrel | 1 | +7/-4 | 2 | +| Oli Evans | 2 | +9/-2 | 3 | +| Lucas Molas | 3 | +7/-3 | 3 | +| RubenKelevra | 3 | +2/-6 | 3 | +| Will | 1 | +1/-5 | 1 | +| Jorropo | 1 | +4/-2 | 1 | +| Ju Huo | 1 | +2/-2 | 1 | +| zhoujiajie | 1 | +1/-1 | 1 | +| Luflosi | 1 | +1/-1 | 1 | +| Jonathan Rudenberg | 1 | +1/-1 | 1 | +| David Pflug | 1 | +1/-1 | 1 | +| Ari Mattila | 1 | +1/-1 | 1 | +| Yingrong Zhao | 1 | +0/-1 | 1 | + ## v0.8.0 2021-02-18 We're happy to announce go-ipfs 0.8.0! This is planned to be a fairly small release focused on integrating in the new pinning service/remote pinning [API](https://github.com/ipfs/pinning-services-api-spec) that makes the experience of managing pins across pinning services easier and more uniform. From e5b02b3de99ceaf3a5d913e93eb11e0139af4f8a Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 22 Jun 2021 18:29:18 -0400 Subject: [PATCH 161/161] Release v0.9.0 --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index 6f3267f9619..8dc6a3fad02 100644 --- a/version.go +++ b/version.go @@ -4,7 +4,7 @@ package ipfs var CurrentCommit string // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.9.0-rc2" +const CurrentVersionNumber = "0.9.0" const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/"