This page assumes you want to run the NodeJS Saito server locally 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 Rust node is a rust application using the saito-core library to run a standalone saito node.
Following are the steps to run a saito rust node.
First, clone the Saito Rust workspace repository from GitHub using the following command:
git clone https://github.com/saitotech/saito-rust-workspace
Navigate to the cloned directory and run the bootstrap script to prepare your environment:
For Linux
Run the bootstrap_linux.sh script to prepare your Linux environment:
cd saito-rust-workspace
bash scripts/bootstrap_linux.sh
For macOS
If you are on a macOS device, use the bootstrap_mac.sh script instead:
cd saito-rust-workspace
bash scripts/bootstrap_mac.sh
Finally, start the Saito application with Rust's cargo tool, enabling debug logging:
RUST_LOG=debug cargo run
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
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.