2022-09-12 20:01:14 +00:00
|
|
|
# Getting Started
|
2023-03-25 05:44:07 +00:00
|
|
|
|
|
|
|
### Dependencies
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
##### Ubuntu
|
|
|
|
|
|
|
|
```
|
2023-11-13 04:55:15 +00:00
|
|
|
sudo apt-get install -y build-essential clang-11 pkg-config cmake git curl protobuf-compiler
|
2022-09-12 20:01:14 +00: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 05:44:07 +00:00
|
|
|
rustup toolchain install stable
|
2023-03-31 06:34:52 +00:00
|
|
|
rustup target add wasm32-unknown-unknown
|
2022-09-12 20:01:14 +00:00
|
|
|
rustup toolchain install nightly
|
|
|
|
rustup target add wasm32-unknown-unknown --toolchain nightly
|
|
|
|
```
|
|
|
|
|
|
|
|
### Install Solidity
|
|
|
|
|
|
|
|
```
|
2023-10-13 09:13:33 +00:00
|
|
|
cargo install svm-rs
|
|
|
|
svm install 0.8.16
|
|
|
|
svm use 0.8.16
|
2022-09-12 20:01:14 +00:00
|
|
|
```
|
|
|
|
|
2022-10-31 20:50:28 +00:00
|
|
|
### Install Solidity Compiler Version Manager
|
|
|
|
|
|
|
|
```
|
|
|
|
cargo install svm-rs
|
|
|
|
svm install 0.8.16
|
|
|
|
svm use 0.8.16
|
|
|
|
```
|
|
|
|
|
2023-11-12 09:34:45 +00:00
|
|
|
### Install foundry (for tests)
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
```
|
2023-11-08 11:25:35 +00:00
|
|
|
cargo install --git https://github.com/foundry-rs/foundry --profile local --locked forge cast chisel anvil
|
2022-09-12 20:01:14 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Clone and Build Serai
|
|
|
|
|
|
|
|
```
|
|
|
|
git clone https://github.com/serai-dex/serai
|
|
|
|
cd serai
|
2023-07-12 02:45:14 +00:00
|
|
|
cargo build --release --all-features
|
2022-09-12 20:01:14 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Run Tests
|
|
|
|
|
2023-03-25 05:44:07 +00:00
|
|
|
Running tests requires:
|
|
|
|
|
2023-09-19 16:59:04 +00:00
|
|
|
- [A rootless Docker setup](https://docs.docker.com/engine/security/rootless/)
|
2023-07-21 19:11:22 +00:00
|
|
|
- A properly configured Bitcoin regtest node (available via Docker)
|
|
|
|
- A properly configured Monero regtest node (available via Docker)
|
2024-01-29 01:58:23 +00:00
|
|
|
- A properly configured monero-wallet-rpc instance (available via Docker)
|
2024-02-09 07:48:44 +00:00
|
|
|
|
|
|
|
To start the required daemons, one may run:
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
```
|
2024-02-09 07:48:44 +00:00
|
|
|
cargo run -p serai-orchestrator -- key_gen dev
|
|
|
|
cargo run -p serai-orchestrator -- setup dev
|
2022-09-12 20:01:14 +00:00
|
|
|
```
|
|
|
|
|
2024-02-09 07:48:44 +00:00
|
|
|
and then:
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
```
|
2024-02-09 07:48:44 +00:00
|
|
|
cargo run -p serai-orchestrator -- start dev bitcoin-daemon monero-daemon monero-wallet-rpc
|
2022-09-12 20:01:14 +00:00
|
|
|
```
|
2022-10-31 16:32:27 +00:00
|
|
|
|
2024-02-09 07:48:44 +00:00
|
|
|
Finally, to run the tests:
|
2022-10-31 16:32:27 +00:00
|
|
|
|
2024-02-09 07:48:44 +00:00
|
|
|
```
|
|
|
|
cargo test --all-features
|
|
|
|
```
|