Install Holochain

Notice: These are the instructions for installing Holochain for the first time. To read how to update Holochain to the latest version, visit change or update holochain go version.

Installing with Go

1. Download Go. Download the "Archive" or "Installer" for version 1.8 or later for your CPU and OS. The "Source" download does not contain an executable and step 3 will fail.

2. Install Go on your system.

3. Add a new environment variable called GOPATH which points to the directory on your computer where Go libraries get installed. How to do this depends on your computer and operating system. Instructions for the most common platforms are below.

expand_less For Mac and Linux

If you DO NOT have a shell profile file, follow ALL these instructions in your terminal. If you know about shell profiles, and have one, just do steps 4 and 5

  1. $ cd ~
  2. $ touch .bash_profile
  3. $ open .bash_profile
  4. in your editor, add the following to .bash_profile, and save it
export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"
   5. $ source .bash_profile

expand_less For Windows

First you'll need to install some necessary programs if you don't already have them.

  • Install Windows git. Be sure to select the appropriate options so that git is accessible from the Windows command line.  N.B.: you must make sure to auto line-feed conversion set correctly, or when you check out dna files from repos, it may change the dna by changing the line endings which will change the hash of the application.

  • Install GnuWin32 make.

Next, in your Control Panel, select System>Advanced system settings>Environment Variables... and under System Variablesdo the following:

  1. Add a new entry with the name GOPATH and the value %USERPROFILE%\go (Or your Go workspace folder).

  2. Double-click Path, and in the window that pops up add the following entries:

    • %GOPATH%\bin

    • C:\Go\bin (Or wherever you installed Go to+\bin).

    • C:\Program Files (x86)\GnuWin32\bin (Or wherever you installed GnuWin32 make to+\bin).

 

4. Run the following command in a terminal to download the library and command lines tools

$ go get -d -v github.com/holochain/holochain-proto

5. Lastly, change directories into the new holochain-proto directory, and run maketo build the library and command lines tools for your computer.

MAC and LINUX: $ cd $GOPATH/src/github.com/holochain/holochain-proto
WINDOWS: $ cd %GOPATH%/src/github.com/holochain/holochain-proto

and then (on both)
$ make

And thats it!

To see an initial confirmation that it works, you can try running one of the commands to check your version. You should see a result something like the following. 

$ hcadmin -v
hcadmin version 0.0.x (holochain y)

With Holochain installed, the next step is understanding the command line tools...