Skip to content

Commit 2c1c255

Browse files
committed
chore: Add release-lite profile for low-RAM environments
1 parent 2686009 commit 2c1c255

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ members = [
1313
"testnet/stacks-node"]
1414

1515
# Dependencies we want to keep the same between workspace members
16-
[workspace.dependencies]
17-
ed25519-dalek = { version = "2.1.1", features = ["serde", "rand_core"] }
16+
[workspace.dependencies]
17+
ed25519-dalek = { version = "2.1.1", features = ["serde", "rand_core"] }
1818
hashbrown = "0.14.3"
1919
rand_core = "0.6"
2020
rand = "0.8"
@@ -38,3 +38,9 @@ opt-level = 3
3838
debug = true
3939
codegen-units = 1
4040
lto = "fat"
41+
42+
# Release build with less LTO
43+
# Useful for faster builds or low-RAM environments
44+
[profile.release-lite]
45+
inherits = "release"
46+
lto = "thin"

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,56 @@ Stacks is a layer-2 blockchain that uses Bitcoin as a base layer for security an
2222
_For building on Windows, follow the rustup installer instructions at https://rustup.rs/._
2323

2424
```bash
25-
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
26-
$ source $HOME/.cargo/env
27-
$ rustup component add rustfmt
25+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
26+
source $HOME/.cargo/env
27+
rustup component add rustfmt
2828
```
2929

3030
- When building the [`master`](https://github.com/stacks-network/stacks-blockchain/tree/master) branch, ensure you are using the latest stable release:
3131

3232
```bash
33-
$ rustup update
33+
rustup update
3434
```
3535

3636
### 2. Clone the source repository:
3737

3838
```bash
39-
$ git clone --depth=1 https://github.com/stacks-network/stacks-blockchain.git
40-
$ cd stacks-blockchain
39+
git clone --depth=1 https://github.com/stacks-network/stacks-blockchain.git
40+
cd stacks-blockchain
4141
```
4242

4343
### 3. Build the project
4444

4545
```bash
46-
$ cargo build
46+
# Fully optimized release build
47+
cargo build --release
48+
# Faster but less optimized build. Necessary if < 16 GB RAM
49+
cargo build --profile release-lite
4750
```
4851

4952
## Testing
5053

5154
**Run the tests:**
5255

5356
```bash
54-
$ cargo test testnet -- --test-threads=1
57+
cargo test testnet -- --test-threads=1
5558
```
5659

5760
**Run all unit tests in parallel using [nextest](https://nexte.st/):**
5861

5962
_Warning, this typically takes a few minutes_
63+
6064
```bash
61-
$ cargo nextest run
65+
cargo nextest run
6266
```
6367

6468
## Run the testnet
6569

6670
You can observe the state machine in action locally by running:
6771

6872
```bash
69-
$ cd testnet/stacks-node
70-
$ cargo run --bin stacks-node -- start --config ./conf/testnet-follower-conf.toml
73+
cd testnet/stacks-node
74+
cargo run --bin stacks-node -- start --config ./conf/testnet-follower-conf.toml
7175
```
7276

7377
_On Windows, many tests will fail if the line endings aren't `LF`. Please ensure that you are have git's `core.autocrlf` set to `input` when you clone the repository to avoid any potential issues. This is due to the Clarity language currently being sensitive to line endings._

0 commit comments

Comments
 (0)