User avatar
cybersailor
Posts: 9
Joined: Sat Aug 20, 2016 12:36 pm
Location: Brisbane
Contact: Website Twitter

Install a Lisk Node on OSX Server

Thu Sep 01, 2016 11:51 am

How to install a Lisk node on your Mac running OSX 10.5.11 Server:

UPDATED FOR 0.4.1
You can use the upgrade script now as they fixed the MD5 check.
So if you're already running 0.4.0, simply do this:
copy your ssl directory away so you can copy the certificates back afterwards. Also copy config.json so you can refer to it when you have to add the ssl and forging part back in after the upgrade.

cd ~
rm -f installLisk.sh
wget https://downloads.lisk.io/lisk/main/installLisk.sh installLisk.sh
bash installLisk.sh upgrade -r main

Copy any SSL certificates back where they belong and manually add any missing entries in config.json such as SSL, Forging or API whitelists.


For a new install follow these steps:

Firstly, it may well work with other versions of OSX including non server. I simply don't know but from the small number of changes I had to make, I very much believe that it will work just fine. If you don't have the server version then things should be even easier as you don't have to work around the already installed Postgres version that is used by OSX Server.

If you know your way around the terminal and shell commands, you will no doubt succeed. If you do not have that knowledge then I strongly suggest you do not even start. Download the Nano client and find happiness in it. :)


So here it goes:

If you want to use a dedicated account to run Lisk, then you have to create one in system preferences but you can just run it under any account, really. (Well, not root but anything else).

Preparation:
The installation requires you to have wget. Which you will not find on a Mac. (Strictly speaking, wget isn't required but the installer checks for it anyway.)
You can of course modify the script to remove the check for wget but I didn't know that wget wasn't required when I did the installation so I added it as described below:

If you have BREW installed, you can simply add it:

brew install wget

If you don't have brew, you can just cheat your way around it by creating a script:

cd /usr/local/bin
vi wget


copy&paste the 2 lines below:
#!/bin/bash
curl -L $1 -o $2


save & exit.

change permissions on the file:
chmod 755 wget

All done.


Download the install script.

If you couldn't' be bothered with wget, just use curl:
curl -L https://downloads.lisk.io/scripts/installLisk.sh -o installLisk.sh

Note that you have to add an extra target file name if you are using the wget workaround:
wget https://downloads.lisk.io/scripts/installLisk.sh installLisk.sh

If you have installed wget using brew, you can just use:
wget https://downloads.lisk.io/scripts/installLisk.sh


On OSX Server, you may find that the postgres commands are taken from the wrong directory as there is already a Postgres DB running. To fix this, edit .bash_profile and add the following line (again: do not add it if you're not running OSX Server):

export PATH="<YOUR_HOME_DIRECTORY>/lisk-main/pgsql/bin:$PATH"

Replace <YOUR_HOME_DIRECTORY> with the correct path to wherever you are intending to install Lisk. The default is to install it into the users home folder.

For any OSX Version, also add the environment variables for Postgres:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8


Save the file, close your terminal session and start a new one. Check whether you do have the variable settings as expected.

Now, hold your horses just yet as we have to make one more change for Postgres to work:
This is where your setup could be different if you're on a different version or if you're not running the Server version.
However, you should be able to adjust it if you can find out where the .s.PGSQL.5432 file actually is.
The installation script installs postgres and it will think that your .s.PGSQL.542 socket file should default to /private/var/pgsql_socket but alas, it does not.

you can fix this by issuing this command:
sudo ln -s /tmp/.s.PGSQL.5432 /var/pgsql_socket/.s.PGSQL.5432


This creates a symbolic link pointing to /tmp and postgres will now happily find what it's looking for.

Now then, back to run the install script:
bash installLisk.sh install -r main

Follow the installation guide and things should progress. You may or may not get the "Failed to create Postgresql user" error. If so, try this:


bash lisk.sh rebuild


Good luck. :)

Please let me know if you come across any issues not mentioned here.
Last edited by cybersailor on Wed Nov 02, 2016 10:43 pm, edited 1 time in total.
Try not to become a man of success, but rather try to become a man of value.

User avatar
cybersailor
Posts: 9
Joined: Sat Aug 20, 2016 12:36 pm
Location: Brisbane
Contact: Website Twitter

Re: Install a Lisk Node on OSX Server

Wed Oct 19, 2016 5:59 am

Not sure how to edit my initial post so I'm replying to it.

The link command is wrong and to get the latest node version 0.4.0 working should be changed to:

sudo ln -s /tmp/.s.PGSQL.5432 /var/pgsql_socket/.s.PGSQL.5432

User avatar
redsn0w
Global Moderator
Posts: 202
Joined: Sat Apr 02, 2016 8:41 am
Contact: Website

Re: Install a Lisk Node on OSX Server

Wed Oct 19, 2016 8:59 am

cybersailor wrote:Not sure how to edit my initial post so I'm replying to it.

The link command is wrong and to get the latest node version 0.4.0 working should be changed to:

sudo ln -s /tmp/.s.PGSQL.5432 /var/pgsql_socket/.s.PGSQL.5432


I edited it, btw the button to edit the post is this one:

Image


Thanks for the guide!

Return to “Guides”

Who is online

Users browsing this forum: No registered users and 2 guests