2022-09-12 15:01:14 -05:00
|
|
|
# Getting Started
|
2023-03-25 01:44:07 -04:00
|
|
|
|
|
|
|
|
### Dependencies
|
2022-09-12 15:01:14 -05:00
|
|
|
|
|
|
|
|
##### Ubuntu
|
|
|
|
|
|
|
|
|
|
```
|
2023-11-12 23:55:15 -05:00
|
|
|
sudo apt-get install -y build-essential clang-11 pkg-config cmake git curl protobuf-compiler
|
2022-09-12 15:01:14 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Install rustup
|
|
|
|
|
|
|
|
|
|
##### Linux
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
##### macOS
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
brew install rustup
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Install Rust
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
rustup update
|
2023-03-25 01:44:07 -04:00
|
|
|
rustup toolchain install stable
|
2025-08-15 10:55:05 -04:00
|
|
|
rustup target add wasm32v1-none
|
2022-09-12 15:01:14 -05:00
|
|
|
rustup toolchain install nightly
|
2025-08-15 10:55:05 -04:00
|
|
|
rustup target add wasm32v1-none --toolchain nightly
|
2022-09-12 15:01:14 -05:00
|
|
|
```
|
|
|
|
|
|
2025-09-01 15:46:04 -04:00
|
|
|
### Install Solidity with `svm`
|
2022-10-31 15:50:28 -05:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
cargo install svm-rs
|
2025-09-01 21:57:19 +02:00
|
|
|
svm install 0.8.26
|
|
|
|
|
svm use 0.8.26
|
2022-10-31 15:50:28 -05:00
|
|
|
```
|
|
|
|
|
|
2023-11-12 04:34:45 -05:00
|
|
|
### Install foundry (for tests)
|
2022-09-12 15:01:14 -05:00
|
|
|
|
|
|
|
|
```
|
2025-09-01 21:57:19 +02:00
|
|
|
curl -L https://foundry.paradigm.xyz | bash
|
|
|
|
|
foundryup
|
2022-09-12 15:01:14 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Clone and Build Serai
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
git clone https://github.com/serai-dex/serai
|
|
|
|
|
cd serai
|
2023-07-12 12:45:14 +10:00
|
|
|
cargo build --release --all-features
|
2022-09-12 15:01:14 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Run Tests
|
|
|
|
|
|
2023-03-25 01:44:07 -04:00
|
|
|
Running tests requires:
|
|
|
|
|
|
2023-09-19 12:59:04 -04:00
|
|
|
- [A rootless Docker setup](https://docs.docker.com/engine/security/rootless/)
|
2023-07-21 15:11:22 -04:00
|
|
|
- A properly configured Bitcoin regtest node (available via Docker)
|
|
|
|
|
- A properly configured Monero regtest node (available via Docker)
|
2024-01-29 02:58:23 +01:00
|
|
|
- A properly configured monero-wallet-rpc instance (available via Docker)
|
2024-02-09 02:48:44 -05:00
|
|
|
|
|
|
|
|
To start the required daemons, one may run:
|
2022-09-12 15:01:14 -05:00
|
|
|
|
|
|
|
|
```
|
2024-02-09 02:48:44 -05:00
|
|
|
cargo run -p serai-orchestrator -- key_gen dev
|
|
|
|
|
cargo run -p serai-orchestrator -- setup dev
|
2022-09-12 15:01:14 -05:00
|
|
|
```
|
|
|
|
|
|
2024-02-09 02:48:44 -05:00
|
|
|
and then:
|
2022-09-12 15:01:14 -05:00
|
|
|
|
|
|
|
|
```
|
2024-02-09 02:48:44 -05:00
|
|
|
cargo run -p serai-orchestrator -- start dev bitcoin-daemon monero-daemon monero-wallet-rpc
|
2022-09-12 15:01:14 -05:00
|
|
|
```
|
2022-10-31 11:32:27 -05:00
|
|
|
|
2024-02-09 02:48:44 -05:00
|
|
|
Finally, to run the tests:
|
2022-10-31 11:32:27 -05:00
|
|
|
|
2024-02-09 02:48:44 -05:00
|
|
|
```
|
|
|
|
|
cargo test --all-features
|
|
|
|
|
```
|