From 0787a6e0784cfea8c3d1abb5a271dfc372658370 Mon Sep 17 00:00:00 2001 From: rustaceanrob Date: Sun, 11 Oct 2026 03:07:11 +0100 Subject: [PATCH] ci: Add a weekly sanity check --- .github/workflows/weekly-check.yml | 17 +++++++++++++++++ node/README.md | 9 +++++++++ node/justfile | 11 +++++++++-- node/src/bin/ibd.rs | 3 +++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/weekly-check.yml b/.github/workflows/weekly-check.yml index 2943916..6f2f7a5 100644 --- a/.github/workflows/weekly-check.yml +++ b/.github/workflows/weekly-check.yml @@ -23,3 +23,20 @@ jobs: toolchain: ${{ matrix.toolchain }} components: clippy,rustfmt - run: just check + # Sync signet end-to-end against the latest published hintsfile. + signet: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: extractions/setup-just@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: "Install Bitcoin dependencies" + run: | + sudo apt-get update + sudo apt-get install build-essential cmake pkgconf python3 libevent-dev libboost-dev capnproto libcapnp-dev + - name: "Build node" + run: cargo build --release -p node --bin ibd + - name: "Sync signet" + timeout-minutes: 30 + working-directory: node + run: just signet diff --git a/node/README.md b/node/README.md index cf6dbe2..cd6202f 100644 --- a/node/README.md +++ b/node/README.md @@ -55,8 +55,17 @@ Arguments: stream until the connection is killed. ``` +Or use the [`just`](https://github.com/casey/just) shortcuts from this directory: + +```bash +just mainnet # download the latest bitcoin.hints and sync mainnet +just signet # download the latest signet.hints and sync signet +``` + If IBD completes, or you experience a bug, you will need to remove the kernel directories from this repository to run the binary again: ``` rm -rf blocks chainstate ``` + +Or equivalently, `just delete`. diff --git a/node/justfile b/node/justfile index 0ce66a8..e1e6626 100644 --- a/node/justfile +++ b/node/justfile @@ -1,5 +1,12 @@ -ibd: - cargo run --bin ibd ./bitcoin.hints --release +# Download the latest mainnet hintsfile and run a fresh sync to its stop height +mainnet: + curl -fsSL -o bitcoin.hints https://utxohints.store/hints/bitcoin + cargo run --release --bin ibd -- --hintsfile bitcoin.hints --network bitcoin + +# Download the latest signet hintsfile and run a fresh sync to its stop height +signet: + curl -fsSL -o signet.hints https://utxohints.store/hints/signet + cargo run --release --bin ibd -- --hintsfile signet.hints --network signet delete: rm -rf blocks chainstate blockfiles diff --git a/node/src/bin/ibd.rs b/node/src/bin/ibd.rs index 6ad38dd..e5ec9a1 100644 --- a/node/src/bin/ibd.rs +++ b/node/src/bin/ibd.rs @@ -121,4 +121,7 @@ fn main() { let acc_result = acc_task.join().unwrap(); tracing::info!("Verified: {acc_result}"); elapsed_time(main_routine_time); + if !acc_result { + std::process::exit(1); + } }