@cryptotaxi247 / kubo / commits / e22413ab9

go-ipfs fetches migrations using specific IPFS path

gammazero committed Feb 17, 2021 at 19:12 UTC e22413ab927bfb6252b5bf1a9b84c23c54ad8aaa
2 files changed +6 -1
cmd/ipfs/daemon.go
+2
@@ -288,6 +288,8 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
288 return fmt.Errorf("fs-repo requires migration")
289 }
290
291 + // Fetch migrations using the current distribution
292 + migrations.SetIpfsDistPath(migrations.CurrentIpfsDist)
293 err = migrations.RunMigration(cctx.Context(), fsrepo.RepoVersion, "")
294 if err != nil {
295 fmt.Println("The migrations of fs-repo failed:")
repo/fsrepo/migrations/fetch.go
+4 -1
@@ -16,6 +16,9 @@ import (
16 )
17
18 const (
19 + // Current dirstibution to fetch migrations from
20 + CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y"
21 +
22 envIpfsDistPath = "IPFS_DIST_PATH"
23
24 // Distribution
@@ -39,7 +42,7 @@ func init() {
42
43 // SetIpfsDistPath sets the ipfs path to the distribution site. If an empty
44 // string is given, then the path is set using the IPFS_DIST_PATH environ
42 -// veriable, or the default value if that is not defined.
45 +// veriable, or the default dns link value if that is not defined.
46 func SetIpfsDistPath(distPath string) {
47 if distPath != "" {
48 ipfsDistPath = distPath