Skip to content

Commit c383bdd

Browse files
authored
Merge pull request #4599 from jbencin/chore/release-lite-profile
chore: Add `release-lite` profile for low-RAM environments
2 parents 95f5d74 + cf4fab4 commit c383bdd

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
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"
@@ -37,3 +37,9 @@ opt-level = 3
3737
debug = true
3838
codegen-units = 1
3939
lto = "fat"
40+
41+
# Release build with less LTO
42+
# Useful for faster builds or low-RAM environments
43+
[profile.release-lite]
44+
inherits = "release"
45+
lto = "thin"

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Reference implementation of the [Stacks blockchain](https://github.com/stacks-ne
1111
Stacks is a layer-2 blockchain that uses Bitcoin as a base layer for security and enables decentralized apps and predictable smart contracts using the [Clarity language](https://clarity-lang.org/). Stacks implements [Proof of Transfer (PoX)](https://community.stacks.org/pox) mining that anchors to Bitcoin security. Leader election happens at the Bitcoin blockchain and Stacks (STX) miners write new blocks on the separate Stacks blockchain. With PoX there is no need to modify Bitcoin to enable smart contracts and decentralized apps.
1212

1313
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=flat)](https://www.gnu.org/licenses/gpl-3.0)
14-
[![Release](https://img.shields.io/github/v/release/stacks-network/stacks-blockchain?style=flat)](https://github.com/stacks-network/stacks-blockchain/releases/latest)
15-
[![Build Status](https://github.com/stacks-network/stacks-blockchain/actions/workflows/ci.yml/badge.svg?branch=master&event=workflow_dispatch&style=flat)](https://github.com/stacks-network/stacks-blockchain/actions/workflows/ci.yml?query=event%3Aworkflow_dispatch+branch%3Amaster)
14+
[![Release](https://img.shields.io/github/v/release/stacks-network/stacks-core?style=flat)](https://github.com/stacks-network/stacks-core/releases/latest)
15+
[![Build Status](https://github.com/stacks-network/stacks-core/actions/workflows/ci.yml/badge.svg?branch=master&event=workflow_dispatch&style=flat)](https://github.com/stacks-network/stacks-core/actions/workflows/ci.yml?query=event%3Aworkflow_dispatch+branch%3Amaster)
1616
[![Discord Chat](https://img.shields.io/discord/621759717756370964.svg)](https://stacks.chat)
1717

1818
## Building
@@ -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

30-
- When building the [`master`](https://github.com/stacks-network/stacks-blockchain/tree/master) branch, ensure you are using the latest stable release:
30+
- When building the [`master`](https://github.com/stacks-network/stacks-core/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-core.git
40+
cd stacks-core
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)