Merge pull request #4599 from jbencin/chore/release-lite-profile

chore: Add `release-lite` profile for low-RAM environments
This commit is contained in:
Jeff Bencin
2024-04-02 18:03:39 +00:00
committed by GitHub
2 changed files with 26 additions and 16 deletions

View File

@@ -37,3 +37,9 @@ opt-level = 3
debug = true
codegen-units = 1
lto = "fat"
# Release build with less LTO
# Useful for faster builds or low-RAM environments
[profile.release-lite]
inherits = "release"
lto = "thin"

View File

@@ -11,8 +11,8 @@ Reference implementation of the [Stacks blockchain](https://github.com/stacks-ne
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.
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg?style=flat)](https://www.gnu.org/licenses/gpl-3.0)
[![Release](https://img.shields.io/github/v/release/stacks-network/stacks-blockchain?style=flat)](https://github.com/stacks-network/stacks-blockchain/releases/latest)
[![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)
[![Release](https://img.shields.io/github/v/release/stacks-network/stacks-core?style=flat)](https://github.com/stacks-network/stacks-core/releases/latest)
[![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)
[![Discord Chat](https://img.shields.io/discord/621759717756370964.svg)](https://stacks.chat)
## Building
@@ -22,28 +22,31 @@ Stacks is a layer-2 blockchain that uses Bitcoin as a base layer for security an
_For building on Windows, follow the rustup installer instructions at https://rustup.rs/._
```bash
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source $HOME/.cargo/env
$ rustup component add rustfmt
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup component add rustfmt
```
- When building the [`master`](https://github.com/stacks-network/stacks-blockchain/tree/master) branch, ensure you are using the latest stable release:
- When building the [`master`](https://github.com/stacks-network/stacks-core/tree/master) branch, ensure you are using the latest stable release:
```bash
$ rustup update
rustup update
```
### 2. Clone the source repository:
```bash
$ git clone --depth=1 https://github.com/stacks-network/stacks-blockchain.git
$ cd stacks-blockchain
git clone --depth=1 https://github.com/stacks-network/stacks-core.git
cd stacks-core
```
### 3. Build the project
```bash
$ cargo build
# Fully optimized release build
cargo build --release
# Faster but less optimized build. Necessary if < 16 GB RAM
cargo build --profile release-lite
```
## Testing
@@ -51,14 +54,15 @@ $ cargo build
**Run the tests:**
```bash
$ cargo test testnet -- --test-threads=1
cargo test testnet -- --test-threads=1
```
**Run all unit tests in parallel using [nextest](https://nexte.st/):**
_Warning, this typically takes a few minutes_
```bash
$ cargo nextest run
cargo nextest run
```
## Run the testnet
@@ -66,8 +70,8 @@ $ cargo nextest run
You can observe the state machine in action locally by running:
```bash
$ cd testnet/stacks-node
$ cargo run --bin stacks-node -- start --config ./conf/testnet-follower-conf.toml
cd testnet/stacks-node
cargo run --bin stacks-node -- start --config ./conf/testnet-follower-conf.toml
```
_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._