Giter VIP home page Giter VIP logo

ipfs-update's Introduction

ipfs-update

An updater tool for ipfs. Can fetch and install given versions of Kubo.

Travis CI standard-readme compliant

Install

You can either install a pre-built binary or build ipfs-update from source.

Pre-built Binaries

You can download pre-built binaries at: https://dist.ipfs.tech/#ipfs-update

From Source

ipfs-update uses go modules and requires Go version 1.12 or higher:

# You need to CD to a directory _outside_ of your GOPATH.
$ cd /
# Install with go modules enabled
$ GO111MODULE=on go get github.com/ipfs/ipfs-update

Note: Your $GOPATH/bin should be within $PATH for the result ipfs-update binary to be found.

Usage

If you do not see the expected version listed by ipfs-update versions. Try updating ipfs-update (either by the above go get command or through gobuilder).

version

$ ipfs-update version

Prints out the version of ipfs that is currently installed.

versions

$ ipfs-update versions

Prints out all versions of ipfs available for installation.

install

$ ipfs-update install <version>

Downloads, tests, and installs the specified version (or "latest" for latest version) of ipfs. The existing version is stashed in case a revert is needed.

revert

$ ipfs-update revert

Reverts to the previously installed version of ipfs. This is useful if the newly installed version has issues and you would like to switch back to your older stable installation.

fetch

$ ipfs-update fetch [version]

Downloads the specified version of ipfs into your current directory. This is a plumbing command that can be utilized in scripts or by more advanced users.

Install Location

ipfs-update tries to intelligently pick the correct install location for Kubo.

  1. If you have Kubo (ipfs) installed, ipfs-update will install over your existing install.
  2. If you have a Go development environment setup, it will install Kubo along with all of your other go programs.
  3. Otherwise, it will try to pick a sane, writable install location.

Specifically, ipfs-update will install Kubo according to the following algorithm:

  1. If Kubo (ipfs) is already installed and in your PATH, ipfs-update will replace it. ipfs-update will fail if it can't and won't try to install elsewhere.
  2. If Go is installed:
  3. GOBIN if GOBIN is in your PATH.
  4. For each $path in GOPATH, $path/bin if it's in your PATH.
  5. On Windows:
  6. The current directory if it's writable and in your PATH.
  7. The directory where the ipfs-update executable lives if it's executable and in your path.
  8. The directory where the ipfs-update executable lives if it's executable and in your current working directory.
  9. On all platforms except Windows:
  10. If root: 1. /usr/local/bin if it exists, is writable, and is in your PATH. 2. /usr/bin if it exists, is writable, and is in your PATH.
  11. $HOME/.local/bin if it exists, is writable, and is in your PATH.
  12. $HOME/bin if it exists, is writable, and is in your PATH.
  13. $HOME/.local/bin if we can create it and it's in your PATH.
  14. $HOME/bin if we can create it and it's in your PATH.

Custom IPFS gateway URL

By default, ipfs-update uses https://ipfs.io as the gateway URL. If you wish to use your own IPFS gateway URL, please export it via the environment variable IPFS_GATEWAY.

For example:

$ IPFS_GATEWAY="https://dweb.link" ipfs-update install latest

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT

ipfs-update's People

Contributors

0zand1z avatar aschmahmann avatar chriscool avatar dignifiedquire avatar djdv avatar ebpa avatar galargh avatar gammazero avatar godcong avatar guseggert avatar haniawni avatar hsanjuan avatar iand avatar ipfs-mgmt-read-write[bot] avatar jbenet avatar kubuxu avatar lidel avatar magik6k avatar marten-seemann avatar mjrider avatar parkan avatar richardlitt avatar stebalien avatar victorb avatar web-flow avatar web3-bot avatar whilei avatar whyrusleeping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipfs-update's Issues

incorrect maximum storage notice?

> ipfs-update fetch v0.4.0-dev
installing ipfs version v0.4.0-dev
ERROR: Failed to fetch binary:  Maximum storage limit exceeded. Maybe unpin some files?
> df
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/disk1     hfs   112G  104G  8.4G  93% /

nope

unable to update to ipfs v0.4.5-pre1

Hallo, I tried to update ipfs over ipfs-update (v1.4.0) but it sais, "version didnt match".
Did I miss something or is there a problem?

Thanks for help!

`ipfs-update --version` is wrong

I'm supposed to have 1.5.2 and it gives me

./ipfs-update --version
ipfs-update version 1.5.1

:(

TODOs:

  • fix the version :)
  • add a test so this never happens again :)

Unable to use

I am unable to get this working. I tried by installing it from dist.ipfs.io, then I tried using go get. I wasn't able to get the file working. What am I missing?

๐Ÿ•  cd ../ipfs-update
10:52 ~/Downloads/ipfs-update ๐Ÿ•  ls
build-log   ipfs-update
10:52 ~/Downloads/ipfs-update ๐Ÿ•  ipfs-update
-bash: ipfs-update: command not found
10:52 ~/Downloads/ipfs-update ๐Ÿ•  ipfs-
10:52 ~/Downloads/ipfs-update ๐Ÿ•  sh ipfs-update 
ipfs-update: ipfs-update: cannot execute binary file
10:52 ~/Downloads/ipfs-update ๐Ÿ•  go get -u github.com/ipfs/ipfs-update
10:52 ~/Downloads/ipfs-update ๐Ÿ•  go ipfs-update 
go: unknown subcommand "ipfs-update"
Run 'go help' for usage.
10:52 ~/Downloads/ipfs-update ๐Ÿ•  ipfs-update
-bash: ipfs-update: command not found

Installing a version when one is already installed failed

This is also described in issue #7:

root@3416e74c98e9:/mnt# sharness/bin/ipfs-update install v0.3.8
installing ipfs version v0.3.8
binary downloaded, verifying...
success!
installing new binary to /usr/local/bin/ipfs

installation complete.

root@3416e74c98e9:/mnt# echo $?
0

root@3416e74c98e9:/mnt# sharness/bin/ipfs-update install v0.3.8
installing ipfs version v0.3.8
binary downloaded, verifying...
success!
stashing old binary
installing new binary to /usr/local/bin/ipfs/ipfs
ERROR: Install failed:  error moving new binary into place: open /usr/local/bin/ipfs/ipfs: no such file or directory
install failed, reverting changes...
Error reverting
failed to replace binary after install fail:  open /usr/local/bin/ipfs/ipfs: no such file or directory
sorry :(
your old ipfs binary should still be located at:  /root/.ipfs/old-bin/ipfs-v0.3.8
try: `mv "/root/.ipfs/old-bin/ipfs-v0.3.8" "/usr/local/bin/ipfs/ipfs"`
ERROR: error moving new binary into place: open /usr/local/bin/ipfs/ipfs: no such file or directory 

root@3416e74c98e9:/mnt# echo $?
1

It also fails in the same way when installing v0.3.8 after v0.3.9.

ipfs-update install floodsub2 broken?

$ ipfs-update versions
v0.3.2
v0.3.4
v0.3.5
v0.3.6
v0.3.7
v0.3.8
v0.3.9
v0.3.10
v0.3.11
v0.4.0
v0.4.1
v0.4.2
floodsub-2
v0.4.3
v0.4.4
sharding-pre

$ ipfs-update install floodsub-2
fetching go-ipfs version vfloodsub-2
ERROR: fetching resource: 404 Not Found
install failed, reverting changes...
ERROR: 404 Not Found: Path Resolve error: no link named "vfloodsub-2" under QmcsSqGRJfnzDu6LpDgT4FiDLwmqgU6DKn8Vf1jWJBPqeB

$ ipfs-update version
v0.4.4-dev

$ go version
go version go1.7.1 darwin/amd64

Censored in China

The site https://ipfs.io and https://dist.ipfs.io are fully censored by the GFW. Is there a way to update ipfs via IPFS?

Fails to update on CentOS 7: error initializing with new binary: exit status 1: initializing IPFS node at /ipfs/update-staging/test764857057

It's just not updating the version. The daemon is not running. I'm trying to update from 0.4.6 to 0.4.11 (latest).

[vagrant@localhost ~]$ ipfs version
ipfs version 0.4.6
[vagrant@localhost ~]$ ipfs-update install latest
fetching go-ipfs version v0.4.11
binary downloaded, verifying...
install failed, reverting changes...
error initializing with new binary: exit status 1: initializing IPFS node at /ipfs/update-staging/test764857057
generating 2048-bit RSA keypair...done
peer identity: QmZszAzwmsuzKKTV6L7FEgzmUzjhxK2iyXPU5WT3YkaPaL
Error: sync /ipfs/update-staging/test764857057/datastore: invalid argument

[vagrant@localhost ~]$ sudo ipfs-update
sudo: ipfs-update: command not found
[vagrant@localhost ~]$ which ipfs-update
/usr/local/bin/ipfs-update
[vagrant@localhost ~]$ sudo /usr/local/bin/ipfs-update install latest
Already have version v0.4.11 installed, skipping.

Installation complete!
[vagrant@localhost ~]$ ipfs version
ipfs version 0.4.6
[vagrant@localhost ~]$ which ipfs
/usr/local/bin/ipfs
[vagrant@localhost ~]$ ipfs-update version
v0.4.6
[vagrant@localhost ~]$ ipfs-update --version
ipfs-update version 1.5.1
[vagrant@localhost ~]$ grep NoSync /ipfs/config
    "NoSync": true,
[vagrant@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@localhost ~]$ cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)

fetch says install

> ipfs-update fetch v0.4.0-dev
installing ipfs version v0.4.0-dev

if fetch != install it shouldn't claim it is installing it.

Code Review up to now

Tested it out-- seems to work! ๐Ÿ‘

  • nice command help
  • minor testing, seems to work well ๐Ÿ‘ ๐ŸŽ† ๐Ÿ‘
  • clear output tells the user what's going on
  • nice reverting (with interactive select!) ๐Ÿ˜Ž
  • nice ipfs-update versions output


Things to Fix

  • command help could be more user friendly: no idea what to feed it here:

    ./ipfs-update revert --help
    NAME:
       ./ipfs-update revert - revert to previously installed version of ipfs
    
    USAGE:
       ./ipfs-update revert [arguments...]
    
    DESCRIPTION:
       revert will check if a previous update left a stashed
    binary and overwrite the current ipfs binary with it.
    
  • use v<num> or <num>, be consistent:

    > ./ipfs-update versions
    v0.3.2
    v0.3.4
    v0.3.5
    v0.3.6
    v0.3.7
    v0.3.8
    v0.3.9
    > ./ipfs-update version
    0.3.9
    
  • improve description of stash cmd, not clear what it would be used for.

  • separate testnew.go into own subpkg -- https://github.com/ipfs/ipfs-update/blob/b4d672f8551bb17e8f84d19b35cfbf2b82a9f400/testnew.go

  • separate the "update bundle" formatting parts into a subpkg (versions.go)

  • use localApiUrl const for url

    sh := api.NewShell("http://localhost:5001")

  • port is configurable...

    sh := api.NewShell("http://localhost:5001")

    • read $repo/api file (respect $IPFS_PATH)
    • respect --api flag
  • should bound the httpFetch resp.Body reader with a limited reader (like at most {4MB, 8MB} or something) --

    mes, err := ioutil.ReadAll(resp.Body)
    to avoid hosing the local client's memory if there's a malicious remote host.

  • Decompose into logical units!

    func InstallVersion(root, v string, nocheck bool) error {
    -- long sequences of tangential instructions ARE NOT easy to follow. I had to break it up into this: https://gist.github.com/jbenet/aa51fce4fb271f92070e just to check everything made sense. Use that or something even better.

  • should say "error reverting" --

    stump.Log("error replacing binary after install fail: ", rnerr)

  • Give user directions on what to do now:

    stump.Log("your old ipfs binary should still be located at: ", stashpath)
    -- maybe like

    maybe try: mv $stashpath $binpath
    

    Otherwise, this tool leaves users totally in the dust. "my old binary is in X, ok? what does that mean? what should i do?"

  • mixing your stump thing with fmt.Fprintf !? --

    fmt.Fprintf(tw, "%d)\t%s\t%s\n", i+1, bin.Name(), bin.ModTime().Format(time.ANSIC))
    -- great now changing the logger will fail to catch these.

  • if going to allow overriding stdio elsewhere, make this a variable reader too, not os.Stdio --

    scan := bufio.NewScanner(os.Stdin)

  • repeat "(0 to exit)" here --

    stump.Log("please enter a number in the range 1-%d", len(entries))

  • can the "VERSION" and "AUTHORS" parts be removed from standard --help output? i think it's distracting to the average user. or if not, then maybe as one subtle line at the end?

    ipfs-update version <version>, by <authors>
    
  • The habit of writing out to the user from the bowels of the code is very bad. It makes me never want to touch this code, as any meaningful refactor could have unintended serious impact in the flow of the UX.

  • bad error -- handle errors better

    ./ipfs-update install 0.3.8
    installing ipfs version 0.3.8
    fetching 0.3.8 binary...
    ERROR: no link named "0.3.8" under QmctgsD3G5MrvUcuVAZ6tVXP2c2pkgsEsqT85gQaTcfGjw
    
  • silently correct inputs not specifying the v (or clearly handle this error specially, by prompting the user to add it)

  • none of this is tested

Overall, a good start! ๐Ÿ‘

but needs lots of testing before i would be comfortable shipping this to users in a "this is the recommended upgrade path" state.

Path Resolve error: no link named "go-ipfs_v0.4.2_linux-amd64.zip"

I got the following error when trying to upgrade to v0.4.2.

ERROR: fetching resource: 404 Not Found
install failed, reverting changes...
ERROR: 404 Not Found: Path Resolve error: no link named "go-ipfs_v0.4.2_linux-amd64.zip" under QmSqVhoY6pvX9wEPC6UE6r858NaZvQHfyFW7GUgepnRxR2 

I checked the dist page. It seems that the dist server not longer provides zip file.
screenshot from 2016-06-29 11 24 07

ipfs-update fails to update ipfs to 0.4.0-dev

Here's the transcript

darkstar@flonne:~$ go version
go version go1.6 linux/386
darkstar@flonne:~$ ipfs-update  version
v0.3.11-dev
darkstar@flonne:~$ ipfs-update  install v0.4.0-dev
fetching ipfs version v0.4.0-dev
binary downloaded, verifying...
success!
stashing old binary
installing new binary to /var/lib/go/bin/ipfs
checking if repo migration is needed...
  - Migration required
ERROR: Migration Failed:  # cd /var/lib/go/src/github.com/ipfs/fs-repo-migrations; git submodule update --init --recursive
No submodule mapping found in .gitmodules for path 'ipfs-1-to-2/golang-lru'
package github.com/ipfs/fs-repo-migrations: exit status 1
 exit status 1
install failed, reverting changes...
ERROR: # cd /var/lib/go/src/github.com/ipfs/fs-repo-migrations; git submodule update --init --recursive
No submodule mapping found in .gitmodules for path 'ipfs-1-to-2/golang-lru'
package github.com/ipfs/fs-repo-migrations: exit status 1
 exit status 1

I would be happy with just wiping and re-initializing/re-installing ipfs, but I have no idea where all those go-files and the other stuff is stored. I'm considering rm -rf /var/lib/go (since I have no other programs that use go) but I'm not sure if that'll break my whole installation

Any advice?

ipfs-update fails installing with ERROR: version didnt match

tried to install ipfs with the latest ipfs-update binary from dist.ipfs.io on a clean debian stable vm

Versions i tried:

  • v0.4.1
  • v0.4.2
  • v0.4.3
  • v0.4.5-pre1
  • v0.4.4

all result in the same error:

daemon check failed: open /home/vagrant/.ipfs/api: no such file or directory
no pre-existing ipfs installation found
fetching go-ipfs version v0.4.4
  - using GOOS=linux and GOARCH=amd64
  - fetching "/ipns/dist.ipfs.io/go-ipfs/v0.4.4/go-ipfs_v0.4.4_linux-amd64.tar.gz"
fetching url: https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v0.4.4/go-ipfs_v0.4.4_linux-amd64.tar.gz
  - writing to /tmp/ipfs-update592994973/go-ipfs_v0.4.4_linux-amd64.tar.gz
  - extracting binary to tempdir:  /tmp/ipfs-update645384374/ipfs-new
binary downloaded, verifying...
  - running init in '/home/vagrant/.ipfs/update-staging/test306772824' with new binary
  - running: [/tmp/ipfs-update645384374/ipfs-new init]
  - checking new binary outputs correct version
  - running: [/tmp/ipfs-update645384374/ipfs-new version]
install failed, reverting changes...
ERROR: version didnt match 

if i run the last command by hand:

vagrant@jessie:~$ /tmp/ipfs-update645384374/ipfs-new version
ipfs version 0.4.4

Install of v0.4.3-dev fails: "invalid ipfs ref path"

I am currently running v0.4.2 installed via the ipfs-update tool and installed in $HOME/gocode/bin/ipfs.

I run ipfs daemon in one window and then in another window run this:

$ ipfs update  install v0.4.2
fetching go-ipfs version v0.4.2
binary downloaded, verifying...
success!
stashing old binary
installing new binary to /home/wscott/gocode/bin/ipfs
checking if repo migration is needed...

installation complete.
remember to restart your daemon before continuing

Works fine, but shouldn't have actually changed anything. Just including that to demonstrate that it works. Hit ^C in daemon window and wait for it to shutdown and then started it again. Next I run this:

$ ipfs update  install v0.4.3-dev
fetching go-ipfs version v0.4.3-dev
binary downloaded, verifying...
success!
install failed, reverting changes...
ERROR: exit status 1: Error: invalid ipfs ref path

This time it fails. Same thing happens when I run without a daemon running in the background.

Timeouts with v0.3.8 and v0.3.7

I get:

#  sharness/bin/ipfs-update install v0.3.8
installing ipfs version v0.3.8
ERROR: fetching resource: 408 Request Timeout
install failed, reverting changes...
ERROR: 408 Request Timeout: Path Resolve error: context deadline exceeded

#  sharness/bin/ipfs-update install v0.3.7
installing ipfs version v0.3.7
ERROR: fetching resource: 408 Request Timeout
install failed, reverting changes...
ERROR: 408 Request Timeout: Path Resolve error: context deadline exceeded

#  sharness/bin/ipfs-update install v0.3.10
installing ipfs version v0.3.10
ERROR: fetching resource: 404 Not Found
install failed, reverting changes...
ERROR: 404 Not Found: Path Resolve error: no link named "v0.3.10" under QmctgsD3G5MrvUcuVAZ6tVXP2c2pkgsEsqT85gQaTcfGjw 

So basically I can only write tests using v0.3.9.

`sync` feature

Inspired by concourse's fly cli, a sync feature (https://concourse.ci/fly-sync.html) that once run against the API (in this case, a ipfs daemon API) would sync the version of the cli to match the version on the API.

$ ipfs id
Incompatible API version!
$ ipfs-update sync /ip4/127.0.0.1/tcp/5001
Checking version of API...
Got version 0.4.3, downloading the right IPFS version
Downloaded! 
$ ipfs id
{
	"ID": "QmZ8pJ4vNP4BSH",
	"PublicKey": "CAASpgIwggEiMA0QOevfKUQWkPDCqyh3hlcCSyUTAgMBAAE=",
	"Addresses": null,
	"AgentVersion": "go-libp2p/3.3.4",
	"ProtocolVersion": "ipfs/0.1.0"
}

Windows new window popup and exit

ipfs-update.exe asks for permissions, then runs in popup window and exits. Output redirection doesn't work, so I can't even read the help.

ipfs-update doesn't work on Windows

I just tried to use ipfs-update to install v0.4.0, and this is what I got:

C:\Users\drk>ipfs update --verbose install v0.4.0
daemon check failed: open .ipfs\api: The system cannot find the file specified. fetching go-ipfs version v0.4.0
  - using GOOS=windows and GOARCH=amd64
  - fetching "/ipns/dist.ipfs.io/go-ipfs/v0.4.0/go-ipfs_v0.4.0_windows-amd64.zip"
fetching url: https://ipfs.io/ipns/dist.ipfs.io/go-ipfs/v0.4.0/go-ipfs_v0.4.0_windows-amd64.zip
  - writing to C:\Users\drk\AppData\Local\Temp\ipfs-update075339658\go-ipfs_v0.4.0_windows-amd64.zip
  - unpacking zip to "C:\\Users\\drk\\AppData\\Local\\Temp\\ipfs-update518033175\\ipfs-new"
  - extracting binary to tempdir:  C:\Users\drk\AppData\Local\Temp\ipfs-update518033175\ipfs-new
binary downloaded, verifying...
  - running init in '.ipfs\update-staging\test137528673' with new binary
install failed, reverting changes...
ERROR: error initializing with new binary: exec: "C:\\Users\\drk\\AppData\\Local\\Temp\\ipfs-update518033175\\ipfs-new": file does not exist:

I checked, and the indicated ipfs-new file exists. It looks like the problem is that it's trying to execute it, but it's doing it in a way that doesn't work unless the file has an .exe extension.

(This is doubly frustrating because I already have 0.4.0; it's just that I want to migrate my current settings, but there are no instructions for how to do this other than "run ipfs-update".)

Cannot build with Go 1.7 due to dependency

Not familiar with Go, but it seems that sort.Slice is being used in
github.com/libp2p/go-libp2p-connmgr
depended by github.com/libp2p/go-libp2p-host
depended by github.com/libp2p/go-floodsub
depended by github.com/ipfs/go-ipfs-api,
which requires Go 1.8+. Either pin down to a previous version (if possible) or update README?

ipfs-update windows error

$ ipfs-update install v0.4.4
fetching go-ipfs version v0.4.4
binary downloaded, verifying...
install failed, reverting changes...
ERROR: error initializing with new binary: exec: "C:\\Users\\edsilv\\AppData\\Local\\Temp\\ipfs-update648285215\\ipfs-new": file does not exist:

ipfs version is 0.4.2

on windows 10 x64

Unable to update to v0.4.4

I am having some issues updating this.

I wanted to update go-ipfs. So, I found out what version I had - v0.4.2. Then, I went to ipfs/go-ipfs, and looked at the update section. It told me to go to ipfs-update. I already have that installed, so I ran it. When I ran $ ipfs-update versions, it showed me up to v0.4.2. This, I think, means that I have those versions installed - but that wouldn't help me update it, as I don't know the current version. So, I went to dist.ipfs.io, and saw that there is a version v0.4.4.

$  ipfs update install v0.4.4
fetching ipfs version v0.4.4
install failed, reverting changes...
ERROR: no link named "v0.4.4" under QmXaJQK4s9MK79nayF6XCUvCzpweXXTxY5ZtSsCoZ2jTAq

What am I doing wrong here?

Fails with "multihash length inconsistent"

Running ipfs version 0.3.9-dev. ipfs-update installed via go get -u github.com/ipfs/ipfs-update

$ ipfs-update install 0.4.0-rc2
fetching ipfs version v0.4.0-rc2
install failed, reverting changes...
ERROR: cat: multihash length inconsistent: &{124  132 [104]} 
$  ipfs-update versions
ERROR: Failed to query versions:  cat: multihash length inconsistent: &{124  132 [104]}

arm64 build

It would be awesome to have an arm64 build.

Friendlier output

We could probably make this output more friendly:

> ipfs-update install v0.4.3-rc3
fetching go-ipfs version v0.4.3-rc3
binary downloaded, verifying...
        success!
stashing old binary
installing new binary to /usr/local/bin/ipfs
checking if repo migration is needed...
  - Migration required
fetching fs-repo-migrations version v1.1.0
running migration: '/var/folders/nn/33h5t_cn5ql90zjywzwbrxnc0000gn/T/ipfs-update-migrate306730086/fs-repo-migrations -to 4 -y'
Found fs-repo version 3 at /Users/earth/.ipfs
===> Running migration 3 to 4...
applying 3-to-4 repo migration
locking repo at "/Users/earth/.ipfs"
  - verifying version is '3'
  - opening datastore at "/Users/earth/.ipfs"
transfering blocks to new key format
[15 / 15] Approx time remaining: 698s
transferring stored public key records
gathering keys...
got 1 keys, beginning transfer. This will take some time.
[1 / 1]
transferring stored ipns records
gathering keys...
got 1 keys, beginning transfer. This will take some time.
[1 / 1]
updated version file
===> Migration 3 to 4 succeeded!
migration succeeded!

installation complete.

Perhaps something like

> ipfs-update install v0.4.3-rc3
fetching go-ipfs version v0.4.3-rc3: downloading... verifying... success!
stashing old go-ipfs binary at <location>
installing new go-ipfs binary to /usr/local/bin/ipfs
repo migration is needed: must migrate from <v1> to <v2>

fetching fs-repo-migrations version v1.1.0: downloading... verifying... success!
run /var/folders/nn/33h5t_cn5ql90zjywzwbrxnc0000gn/T/ipfs-update-migrate306730086/fs-repo-migrations -to 4 -y
Found fs-repo version 3 at /Users/earth/.ipfs
===> Running migration 3 to 4...
applying 3-to-4 repo migration
locking repo at "/Users/earth/.ipfs"
verified version is '3'
transferring blocks to new key format [15 / 15]
transferring stored public key records [1 / 1]
transferring stored ipns records [1 / 1]
updated version file
===> Migration 3 to 4 succeeded!
migration succeeded!

installation complete.

own domain or under refs.ipfs.io?

Saw there's a domain setup for update.ipfs.io -- cool!

Though I think this probably should be housed at refs.ipfs.io with other things -- thoughts? Intuition here is that it will be easier to keep track of everything if it is in one single repo, rather than a bunch of domains that we will have to account separately.

Windows Issues

Update flow on Windows is pretty broken.

Running ipfs update install v0.4.3-rc1 yields;

binary downloaded, verifying...
install failed, reverting changes...
ERROR: error initializing with new binary: exec: "C:\\Users\\zqueal\\AppData\\Local\\Temp\\ipfs-update837744511\\ipfs-new": file does not exist:

Upon inspecting the folder, there is a zip with the new version in it. So I manually dropped it in my path. Come to find, however, that it's actually 0.4.3-dev and not v0.4.3-rc1 which is weird.

Running ipfs daemon after the "update" failed as well;

Initializing daemon...
Found old repo version, migrations need to be run.
Run migrations automatically? [y/N] y
  => checking for migrations binary...
  => usable migrations not found on system, fetching...
fetching url: https://ipfs.io/ipfs/QmUnvqDuRyfe7HJuiMMHv77AMUFnjGyAU28LFPeTYwGmFF/fs-repo-migrations/versions
fetching url: https://ipfs.io/ipfs/QmUnvqDuRyfe7HJuiMMHv77AMUFnjGyAU28LFPeTYwGmFF/fs-repo-migrations/v1.1.0/fs-repo-migrations_v1.1.0_windows-amd64.zip
Error: no migration binary found that supports version 4 - failed to check migrations version: exec: "C:\\Users\\zqueal\\AppData\\Local\\Temp\\go-ipfs-migrate672150123\\fs-repo-migrations": file does not exist

From here I couldn't get the migrations to happen*. So I ended up removing my .ipfs repo and ipfs init again.

ipfs-update fetch seems to grab the linux version, and not the windows version.


* It seems I was unable to get migrations to happen because I didn't have the fs-repo-migrations.exe in my path.

Don't use ~/go/bin

So apparently this tool installs ipfs into $GOPATH/bin. this tool is meant for people without go. this should use some other standard bin location.

ERROR: Migration Failed: no known migration supports version 5

% ipfs version
ipfs version 0.4.3-rc4
% ipfs-update install latest
fetching go-ipfs version v0.4.5
binary downloaded, verifying...
success!
stashing old binary
installing new binary to /usr/local/bin/ipfs
checking if repo migration is needed...
  check complete, migration required.
fetching fs-repo-migrations version v1.2.1
ERROR: Migration Failed:  no known migration supports version 5
install failed, reverting changes...
no known migration supports version 5

Install Failed. ERROR: Post

> ipfs-update install latest
fetching ipfs version v0.4.3-rc1
install failed, reverting changes...
ERROR: Post http://127.0.0.1:5001/api/v0/cat?arg=%2Fipns%2Fdist.ipfs.io%2Fgo-ipfs%2Fv0.4.3-rc1%2Fgo-ipfs_v0.4.3-rc1_linux-amd64.tar.gz&encoding=json&stream-channels=true: EOF

I have:

  • a daemon running (0.4.2)
  • want to upgrade to 0.4.3-rc1

problem:

  • the error above is not indicative of the problem, or helpful
  • the error above leaves me at a loss of what to do.
  • not clear why it failed.

Cannot install ipfs in Linux after installing with go

I ran the following command to get ipfs-update:

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

This worked and correctly installed ipfs-update on my ~/go/bin folder.

I then put that path in my PATH to be able to run ipfs-update from anywhere.

I then tried to install ipfs by running this command:

ipfs-update install v0.4.13

Which outputs this error:

fetching go-ipfs version v0.4.13
binary downloaded, verifying...
success! tests all passed.
install failed, reverting changes...
ERROR: could not find good install location 

I don't think there's any environment issues on my machine, maybe you just didn't test this on Ubuntu before?

My system is a Ubuntu 16.04 LTS 64-bit and I have plenty of RAM (16GB) and disk space (at least 400GB free).

should install to system bin, not go

this should install to a system bin path, like /usr/bin or /usr/local/bin, depending on what the user's $PATH looks like (it may not have a /usr/local/bin).

> ipfs-update install v0.3.11
fetching ipfs version v0.3.11
binary downloaded, verifying...
success!
installing new binary to /home/jbenet/go/bin/ipfs
ERROR: Install failed:  error moving new binary into place: open /home/jbenet/go/bin/ipfs: no such file or directory
install failed, reverting changes...
ERROR: error moving new binary into place: open /home/jbenet/go/bin/ipfs: no such file or directory

I should not have to have go installed or configured to make this work.

Can't install "sh.IsUp undefined"

Log:

โžœ  ~  go get github.com/ipfs/ipfs-update
# github.com/ipfs/ipfs-update
go/src/github.com/ipfs/ipfs-update/main.go:42: sh.IsUp undefined (type *shell.Shell has no field or method IsUp)

ERROR while updating to 0.4.6-rc1

ipfs update install v0.4.6-rc1
fetching go-ipfs version v0.4.6-rc1
binary downloaded, verifying...
install failed, reverting changes...
ERROR: version didnt match

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.