This write-up assumes that you are installing Saito on a fresh computer and have a reasonable degree of comfort with the command-line. You will need to install command-line tools, git and a relatively recent version of NodeJS and NPM.
1. Server Configuration:
If you are installing Saito on a totally fresh server, we recommend installing Ubuntu. These instructions will install recent versions of Node and NPM as well as the basic command-line tools needed to compile our modules (Mac users view this):
apt-get install g++ make git
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
If you have another distribution, make sure you have a relatively recent version of NodeJS installed — version 8 or later. Older versions of have issues with some modules like sqlite3 and can take a bit more time to get working for reasons outside our control.
2. Download Google’s Dense Hashmap implementation:
Saito uses Google Dense Hash Maps to store UTXO information. Google Dense Hash Maps are a special kind of in-memory data structure that optimizes for speed and lets us to eliminate the need for a database in many cases. This radically speeds up checking whether transaction slips are valid and gives us great scalability. Unfortunately, we need to install this separately. But it is not that hard:
git clone https://github.com/sparsehash/sparsehash
On the off-chance you cannot download the repository, we’ve included a recent version of the library inside the “extras” folder in our distribution. The installation process is the same as above.
3. Download the latest version of Saito
This will create a directory on your computer with all of the Saito code and install the default modules Saito will need to run properly.
git clone https://github.com/saitotech/saito
If you run into any problems at this point write us and let us know. Please note that if you are using an older version of NodeJS or NPM earlier than 8.x there is probably nothing we can do, so make sure you are running up-to-date software before reporting bugs.
4. Compile and Run Saito
And run our “compile” script to refresh the software to a clean state for the first time it will run.
Note: this script resets your entire Saito setup to a clean state and create a new “options” file that sets some default and hopefully useful values for connecting to the network and using DNS. If you are just testing our Saito and/or doing development work, you will probably want to be running a non-public client. In that case, you can open the file “options” and edit it so that the file looks like this — that tells Saito you are running the machine on localhost on port 12101:
Then just start the software:
Now you can open your browser and point it to http://localhost:12101 and you’ll get the default splash page for the Saito network — running on your own machine. Look at the file lib/modules/mods.js to see which modules are running by default and where you can find them on your machine. And let us know if you come up with something interesting we can include in our project library.
Running Saito on a Server?
If you want to run Saito on a server and close your connection to the server while continuing to run Saito in background mode, enter this command on your server:
nohup node --max_old_space_size=4144 start.js > saito.log 2> saito.err &
Wait a few seconds after starting the program and type “Cntl-C”. You will see the ^C carat printed at the terminal line but get no other indications of change. You should then type “exit” to close your terminal. Saito will continue to run in the background on your server now.