2022-08-21 04:26:16 +00:00
|
|
|
# Getting Started
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### System Dependencies
|
|
|
|
|
|
|
|
##### Ubuntu
|
|
|
|
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
2022-08-21 04:45:41 +00:00
|
|
|
sudo apt-get install -y build-essential cmake clang-11 git curl python3-pip
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### Install rustup
|
2022-08-21 04:26:16 +00:00
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
##### Linux
|
2022-08-21 04:26:16 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
```
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
##### macOS
|
2022-08-21 04:26:16 +00:00
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
```
|
|
|
|
brew install rustup
|
|
|
|
```
|
2022-08-21 04:26:16 +00:00
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### Install Rust
|
2022-08-21 04:26:16 +00:00
|
|
|
|
|
|
|
```
|
2022-08-21 04:45:41 +00:00
|
|
|
rustup update
|
|
|
|
rustup toolchain install nightly
|
|
|
|
rustup target add wasm32-unknown-unknown --toolchain nightly
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### Install Solidity
|
|
|
|
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
|
|
|
sudo pip3 install solc-select
|
|
|
|
solc-select install 0.8.16
|
|
|
|
solc-select use 0.8.16
|
|
|
|
```
|
2022-08-21 04:45:41 +00:00
|
|
|
|
|
|
|
### Install foundry and anvil (for tests)
|
|
|
|
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
2022-08-21 04:45:41 +00:00
|
|
|
cargo install --git https://github.com/foundry-rs/foundry --profile local --locked foundry-cli anvil
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### Clone and Build Serai
|
|
|
|
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
2022-08-21 04:45:41 +00:00
|
|
|
git clone https://github.com/serai-dex/serai
|
2022-08-21 04:26:16 +00:00
|
|
|
cd serai
|
|
|
|
cargo build --release
|
|
|
|
```
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### Run Tests
|
|
|
|
|
|
|
|
Running tests requires a Monero regtest node running in the background.
|
|
|
|
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
2022-08-21 04:45:41 +00:00
|
|
|
cargo test --all-features
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|
|
|
|
|
2022-08-21 04:45:41 +00:00
|
|
|
### Run Serai in Development Mode
|
|
|
|
|
|
|
|
```
|
|
|
|
./target/release/serai-node --dev
|
2022-08-21 04:26:16 +00:00
|
|
|
```
|