These are some installation and update tips for Ethereum tools on Mac OS.
First and foremost is Geth, the Go ETHereum node. The download site is
https://geth.ethereum.org/downloads/#dl_stable_darwin
Download Geth & Tools of the release you desire. Check the MD5 checksum with
md5 <filename>
from the command line. Compare this with the Checksum (MD5)
column of the download page for file you downloaded. It should
match.
These instructions will show you how to install into user space.
A good place for this is ~/Applications
. Change
to the directory into which you download Geth & Tools. The
download should be a .tar.gz
file. You can expand this into
your ~/Applications
directory with the tar
command.
pglezen:~/Downloads$ ls get*
geth-alltools-darwin-amd64-1.7.2-1db4ecdc.tar.gz
pglezen:~/Downloads$ tar -xv -C ~/Applications -f geth-alltools-darwin-amd64-1.7.2-1db4ecdc.tar.gz
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/COPYING
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/abigen
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/bootnode
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/evm
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/geth
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/puppeth
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/rlpdump
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/swarm
x geth-alltools-darwin-amd64-1.7.2-1db4ecdc/wnode
pglezen:~/Downloads$ popd
~/Applications
pglezen:~/Applications$ ls -ld get*
lrwxr-xr-x 1 pglezen staff 10 Oct 26 22:48 geth@ -> geth-1.7.1
drwxr-xr-x 13 pglezen staff 442 Oct 8 22:02 geth-1.7.0/
drwxr-xr-x 11 pglezen staff 374 Dec 31 1969 geth-1.7.1/
drwxr-xr-x 11 pglezen staff 374 Dec 31 1969 geth-alltools-darwin-amd64-1.7.2-1db4ecdc/
pglezen:~/Applications$
From the contents of my ~/Applications
directory, you can see
my modus operandi. I have a softlink named geth
that points
to whatever Geth distribution I want to be active. The next step
is to rename my new Geth 1.7.2 download and redirect the softlink.
mv geth-alltools-darwin-amd64-1.7.2-1db4ecdc geth-1.7.2
ln -s geth-1.7.2 geth
If your geth
softlink already exists from a previous distribution,
then you may need to remove it (rm geth
) first before setting it
again with the ln
command. You should then have the following
entries.
pglezen:~/Applications$ ls -ld get*
lrwxr-xr-x 1 pglezen staff 10 Oct 26 22:48 geth@ -> geth-1.7.2
drwxr-xr-x 13 pglezen staff 442 Oct 8 22:02 geth-1.7.0/
drwxr-xr-x 11 pglezen staff 374 Dec 31 1969 geth-1.7.1/
drwxr-xr-x 11 pglezen staff 374 Dec 31 1969 geth-1.7.2/
Finally, if this your first install, you'll need to add
~/Applications/geth
to your PATH
environment variable.
Updating Geth is similar to the installation.
- Download the new version and verify the checksum.
- Untar the contents into your
~/Applications
directory. - Rename the new subdirectory to
geth-x.y.z
wherex.y.z
is the version number. - Redirect the
geth
softlink.
It's good to keep a few old versions around in case you need to revert back.
The Mist application is downloaded from
https://github.com/ethereum/mist/releases
which contains a *.dmg
file - so installing and updating
Mist is pretty easy. But there is a subtlety involved.
Mist runs Geth in the background by default. The first
installation of Mist will install this Geth in
~/Library/Application Support/Mist/binaries/Geth/unpacked
.
But this doesn't get updated just because you run the Geth
update.
From your Mist client you can check the version of Geth to which it has connected. From the menu bar select Develop -- Ethereum Node. It should have the active Ethereum node checked.
To update the Ethereum node that Mist uses by default (as opposed to one you override from the command line), Select Mist -- Check for Ethereum node updates from the menu. This will fetch and update the Ethereum executable for you.
If we start Mist like most GUI Mac programs, it look into
~/Library/Ethereum
for the geth.ipc
file. But if you're
running your own private network on your machine, you probably
want to specify the named pipe file created by your Geth node.
To convey this to Mist, you have to specify the named pipe
file (the geth.ipc
file) through the command line. There are
two ways to do this.
If you provide the full path to the Mist executable, the Mist browser will run in your shell foreground.
/Applications/Mist.app/Contents/MacOS/Mist --rpc <path to geth.ipc>
Pro - You see the Mist logging to your console.
Con - You have to remember a long path.
The
Mac OS open
command
can also launch the Mist browser from the command line.
open -a Mist --args --rpc <path to geth.ipc>
Pro - Easier syntax to remember; works for other programs to.
Con - Runs in the background; don't see logs.