From 2c1c2557a9688f45a01aa671d104fc38ca7c0ac9 Mon Sep 17 00:00:00 2001 From: Jeff Bencin Date: Wed, 27 Mar 2024 17:13:23 -0400 Subject: [PATCH 1/2] chore: Add `release-lite` profile for low-RAM environments --- Cargo.toml | 10 ++++++++-- README.md | 26 +++++++++++++++----------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bb0fc69a7..bf3845e36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,8 @@ members = [ "testnet/stacks-node"] # Dependencies we want to keep the same between workspace members -[workspace.dependencies] -ed25519-dalek = { version = "2.1.1", features = ["serde", "rand_core"] } +[workspace.dependencies] +ed25519-dalek = { version = "2.1.1", features = ["serde", "rand_core"] } hashbrown = "0.14.3" rand_core = "0.6" rand = "0.8" @@ -38,3 +38,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" diff --git a/README.md b/README.md index e61829ff3..4914569a5 100644 --- a/README.md +++ b/README.md @@ -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: ```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-blockchain.git +cd stacks-blockchain ``` ### 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._ From cf4fab40eaf8b4135bfc2c97804e4ca38eb20096 Mon Sep 17 00:00:00 2001 From: Jeff Bencin Date: Mon, 1 Apr 2024 10:44:36 -0400 Subject: [PATCH 2/2] chore: Update "stacks-blockchain" -> "stacks-core" --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4914569a5..e1b79a887 100644 --- a/README.md +++ b/README.md @@ -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 @@ -27,7 +27,7 @@ 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 @@ -36,8 +36,8 @@ 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