This distribution contains an implementation of Saito Consensus in the Rust programming language. It includes the core code needed to run Saito in any language. It contains three main components organized by three main sub-directories: saito-core, saito-rust, and saito-wasm.
This is the place to start if you are interested in understanding Saito Consensus. The code in this directory is used by all versions of Saito. It constitutes the basic classes (blocks, transactions, mempool) that process the blockchain as well as the universal local for processing the events that run the blockchain and keep the network in sync.
The Saito Rust directory contains the code needed to provide storage and network services in the Rust language. These handlers are passed into Saito-Core, where the core software will occasionally call them in order to process network or storage requests such as saving blocks to disk or sending messages to other peers on the network.
You should only need to modify these files if you are developing features that affect storage or network functionality in the Rust-only client.
Saito provides a way to compile our shared library into WASM, a type of binary code that can be executed in many other languages and other platforms. An example of this is compiling Saito into WASM for deployment in a browser -- allowing the network and browser code to run lite-clients that use the same underlying code so as to prevent accidental forks.
https://saitotech.github.io/saito-rust-workspace/
This guide provides step-by-step instructions for setting up the Saito Rust workspace on a Linux and mac environment. Follow these steps to clone the repository, prepare the environment, and run the application.
- OS: Ubuntu 20.04 (MacOS instructions)
- Build tools: git, g++, make
- Stack: cargo rust (v.1.5.7+)
- https://github.com/saitotech/saito-rust-workspace
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
Change to the saito-rust directory:
cd saito-rust
Copy the configuration template to create your own configuration file:
cp configs/config.template.json configs/config.json
for explaination of the configuration file, click here
Copy the issuance template to the appropriate directory:
cp data/issuance/issuance.template data/issuance/issuance
Create a directory for blockchain blocks:
mkdir data/blocks
Finally, start the Saito application with Rust's cargo tool, enabling debug logging:
RUST_LOG=debug cargo run
After completing these steps, the Saito Rust workspace should be up and running on your system. You can modify the configs/config.json file as needed to customize your setup. For further assistance, consult the official Saito documentation or reach out to the Saito community.