This page assumes you want to run a Saito server locally to run or develop applications like the Saito Arcade, Videocall, or RedSquare. If you want to run Saito on a remote machine, we have a remote deployment guide that includes a script which automates entire setup process. The rest of this page assumes you are installing on a local machine.
If you are missing any of these tools we have dedicated pages to help you install them for Linux, Mac and Windows. The remainder of these instructions assumes you have these packages installed and are comfortable using the command-line.
Clone the official Saito repository and move into the node sub-directory. Run npm install to download all of the packages you will need to run Saito, including a pre-compiled version of the Rust codebase.
git clone https://github.com/saitotech/saito
cd saito/node
npm install
Note: if npm install fails to install a module, you may need to install python-is-python3 to work around the problem. On Ubuntu this can be done with sudo apt-get install python-is-python3.
These instructions run a script that compiles Saito into a compressed javascript file that can be served to browsers and contains all of the modules your browsers will use. The second starts the server:
npm run nuke
npm start
After a few moments, you should see a large Saito ASCII logo appear on your screen. This indicates that Saito is running normally and you can start using it!
Congratulations! You can now open a browser and visit:
Ready to change the default set of modules on your machine? For detailed instructions on compiling the node.js stack refer to the Compilation Guide. If you run into problems installing Saito on a remote machine, check the configuration changes needed for remote deployment in our remote deployment guide.
Saito includes a number of software packages coded in the Rust programming language and/or designed to compile into a WASM for use with the javascript server. If you are doing full-stack development that requires modifications to consensus you will require the following:
Navigate to the cloned directory and run the bootstrap script to prepare your environment. The script will work for Mac or Linux, auto-detecting the appropriate bootstrap script based on your environment. Select YES when asked if you want to "Build Project":
cd rust/scripts
bash bootstrap.sh
If you want to run the Saito Rust client, you can now do so using the following, which enables debug logging:
RUST_LOG=debug cargo run
If you are using a Mac, please see our instructions on installing WASM compiler for Mac. Otherwise:
cd saito-wasm
cargo install wasm-pack
npm install
npm run build
git clone https://github.com/saitotech/saito
cd <repo>/rust/scripts
./dev_setup.sh
Provide any expected inputs and wait till the script completes. Script will install all the required software, compile the code and locally link the npm packages.
cd <repo>/node/
npm install
npm link saito-js
npm run compile
Now the node js server can be started with the locally linked saito-js package.
cd <repo>/rust/saito-wasm
npm install
npm run build
npm link # this will setup saito-wasm to be locally linked by other projects
cd <repo>/rust/saito-js
npm install
npm link saito-wasm # this is linking previously built saito-wasm into saito-js project
npm run build
cd dist
npm link # this will setup saito-js to be locally linked by other projects
Now link the local saito-js as in aboe step 3.
Local links will stay there until npm install is called. So you don't need to run npm link saito-js everytime you compile but only when you run npm install.
Once you do any rust changes, below is the procedure to compile wasm code. (Assuming saito-wasm and saito-js are locally linked)
cd <repo>/rust/saito-wasm
npm run build
cd <repo>/rust/saito-js
npm run build
cd <repo>/node/
npm link saito-js
npm run compile #or equivalent
npm start
Once you test everything in the local environment. If you need to publish new npms with the changes, all you have to do is below steps.