Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2d08f72
fix: validate ts client predicates before registering (#639)
rafaelcr Aug 15, 2024
b24ddc6
chore: upgrade to build with rust 1.80 (#631)
chenrui333 Sep 17, 2024
b0af36a
ci: automatic releases (#644)
rafaelcr Oct 3, 2024
a2965c2
ci: optimize build caches (#649)
rafaelcr Oct 3, 2024
8c68352
ci: separate tests into component suites (#650)
rafaelcr Oct 4, 2024
63c753c
fix: return 500 status code to Stacks node when event ingestion fails…
rafaelcr Oct 8, 2024
9a6d362
Merge pull request #652 from hirosystems/main
rafaelcr Oct 9, 2024
6c1dfa9
fix: add a configurable max timeout for outgoing predicate payload re…
rafaelcr Oct 10, 2024
0a722b3
build: run redis tests using a docker integration environment (#655)
rafaelcr Oct 16, 2024
e44d84a
feat: parse `/stackerdb_chunks` Stacks node event (#653)
rafaelcr Oct 16, 2024
535226a
feat(ts-client): add persisted predicates and periodic health check (…
rafaelcr Oct 22, 2024
f48cda5
feat: add various new nakamoto block fields to `/new_block` ingestion…
zone117x Oct 22, 2024
c0b6bc8
chore: merge develop
rafaelcr Oct 22, 2024
21234c9
fix: increase stacks event server body size limit to 500MB (#660)
rafaelcr Oct 22, 2024
ff66bb2
feat(ts-client): add signer messages to stacks payloads (#657)
rafaelcr Oct 22, 2024
6a7a42c
Merge branch 'develop' into stacks-signers
zone117x Oct 23, 2024
99e5a61
feat: support tenure-height in block messages (#661)
zone117x Oct 23, 2024
aee14bc
feat: include signer messages in Stacks predicate payloads (#656)
rafaelcr Oct 23, 2024
081a101
Merge branch 'develop' into stacks-signers
rafaelcr Oct 23, 2024
cc93873
fix: signer pubkey calculation (#665)
rafaelcr Oct 24, 2024
b5ad4ba
feat: include recovered signer pubkeys in new block payload (#662)
zone117x Oct 24, 2024
71364c1
fix: update SignerMessage deserializing (#663)
zone117x Oct 24, 2024
d12acd9
feat: store signer messages in local sqlite database (#664)
rafaelcr Oct 25, 2024
44bd445
ci: publish stacks signers as beta release
rafaelcr Oct 25, 2024
a682ba0
chore(release): 1.9.0-stacks-signers.1 [skip ci]
semantic-release-bot Oct 25, 2024
34db714
ci: check out the correct git tag on release
rafaelcr Oct 25, 2024
279f648
Merge branch 'stacks-signers' of github.com:hirosystems/chainhook int…
rafaelcr Oct 25, 2024
ad5fd54
feat: add mock signer message support (#669)
rafaelcr Oct 25, 2024
b3a156f
chore(release): 1.9.0-stacks-signers.2 [skip ci]
semantic-release-bot Oct 25, 2024
c414d79
feat: add mock signature pubkey (#670)
rafaelcr Oct 25, 2024
dab83e1
chore(release): 1.9.0-stacks-signers.3 [skip ci]
semantic-release-bot Oct 25, 2024
3c117b5
fix: bump stacks codec
rafaelcr Oct 25, 2024
186d337
chore(release): 1.9.0-stacks-signers.4 [skip ci]
semantic-release-bot Oct 25, 2024
8bb59c1
fix: mock signature retrieval (#671)
rafaelcr Oct 25, 2024
c90091b
chore(release): 1.9.0-stacks-signers.5 [skip ci]
semantic-release-bot Oct 25, 2024
a01470e
fix: read stacks-core http event POST payloads for ignored events (#673)
zone117x Oct 31, 2024
367362a
chore(release): 1.9.0-stacks-signers.6 [skip ci]
semantic-release-bot Oct 31, 2024
1bc949a
fix: propagate error when trying to store peer info
Nov 6, 2024
cb5a7c3
Merge pull request #682 from hirosystems/chore/warn_mock_proposals
Nov 7, 2024
defd86f
chore(release): 1.9.0-stacks-signers.7 [skip ci]
semantic-release-bot Nov 7, 2024
1f9f37e
fix: only import stacks tsv if chainstate is empty (#684)
rafaelcr Nov 12, 2024
7b7cdf9
chore(release): 1.9.0-stacks-signers.8 [skip ci]
semantic-release-bot Nov 12, 2024
1aac0f1
Merge pull request #700 from hirosystems/stacks-signers
rafaelcr Feb 4, 2025
8247900
fix: ts client missing matches_regex option for print_event (#701)
pradel Feb 4, 2025
5f13912
feat: callback to intercept and modify predicates before re-registrat…
zone117x Feb 4, 2025
4e49608
fix: add missing fields to ordinal inscription reveals (#703)
rafaelcr Feb 6, 2025
34fffdc
chore: clean dependencies
hugoclrd Mar 13, 2025
d342d58
chore: use latest rustc version
hugoclrd Mar 13, 2025
a35b2c6
chore: clean dependencies
hugoclrd Mar 13, 2025
440d8fe
chore: upgrade stacks-core (#706)
hugoclrd Mar 27, 2025
0278893
ci: semantic-release use bot
deantchi Apr 1, 2025
0560525
Merge pull request #707 from hirosystems/ci/release-bot
deantchi Apr 1, 2025
5c74a55
chore: bump client lib package version to 2.4.0
rafaelcr Jun 3, 2025
6f9c718
fix: read contract_interface from Stacks node block events (#712)
rafaelcr Jun 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config → .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[alias]
chainhook-install = "install --path components/chainhook-cli --locked --force --features cli --features debug --no-default-features"

[env]
RUST_TEST_THREADS = "1"
182 changes: 98 additions & 84 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches:
- main
- beta
- develop
- stacks-signers
paths-ignore:
- '**/CHANGELOG.md'
pull_request:
Expand All @@ -15,41 +17,19 @@ concurrency:
cancel-in-progress: true

jobs:

get_release_info:
name: Get Release Info
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.new_release_tag.outputs.TAG }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get latest release
if: startsWith(github.ref, 'refs/heads/main')
id: release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
excludes: prerelease, draft

- name: Determine if release build
if: startsWith(github.ref, 'refs/heads/main')
id: new_release_tag
env:
LATEST_RELEASE: ${{ steps.release.outputs.release }}
run: |
CARGO_VERSION=v$(grep "version" components/chainhook-cli/Cargo.toml | head -n 1 | cut -d\" -f2)
if [[ "${CARGO_VERSION}" != "${LATEST_RELEASE}" ]]; then
echo "::set-output name=TAG::${CARGO_VERSION}"
echo "::warning::Will create release for version: ${CARGO_VERSION}"
else
echo "::warning::Will not create a release"
fi

test:
name: Generate test coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- suite: cli
features: redis_tests
- suite: sdk
features: stacks-signers
defaults:
run:
working-directory: ./components/chainhook-${{ matrix.suite }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -61,11 +41,8 @@ jobs:
rustup toolchain install stable --profile minimal
echo "RUST_VERSION_HASH=$(rustc --version | sha256sum | awk '{print $1}')" >> $GITHUB_ENV

- name: Install redis
run: sudo apt-get install -y redis-server

- name: Cache cargo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -76,22 +53,38 @@ jobs:
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION_HASH }}-${{ matrix.suite }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install and run cargo-tarpaulin
- name: Install cargo-tarpaulin
run: |
cargo install cargo-tarpaulin
cargo --version
cargo tarpaulin --out lcov --features redis_tests -- --test-threads=1

- name: Setup integration environment
run: |
sudo ufw disable
docker compose -f ../../dockerfiles/docker-compose.dev.yml up -d
docker compose -f ../../dockerfiles/docker-compose.dev.yml logs -t -f --no-color &> docker-compose-logs.txt &
if: matrix.suite == 'cli'

- name: Run tests
run: |
cargo tarpaulin --skip-clean --out lcov --features ${{ matrix.features }} -- --test-threads=1

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
token: ${{ secrets.CODECOV_TOKEN }}
codecov_yml_path: .github/codecov.yml

dist_chainhook:
name: Build Chainhook Distributions
- name: Print integration environment logs
run: cat docker-compose-logs.txt
if: matrix.suite == 'cli' && failure()

- name: Teardown integration environment
run: docker compose -f ../../dockerfiles/docker-compose.dev.yml down -v -t 0
if: matrix.suite == 'cli' && always()

distributions:
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -145,12 +138,12 @@ jobs:
run: echo "RUST_VERSION_HASH=$(rustc --version | sha256sum | awk '{print $1}')" >> $GITHUB_ENV

- name: Cache cargo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/
./target/${{ matrix.target }}/release/
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION_HASH }}-cargo-${{ hashFiles('./Cargo.lock') }}
./target/
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION_HASH }}-${{ matrix.target }}-cargo-${{ hashFiles('./Cargo.lock') }}

- name: Install wix (Windows)
if: matrix.os == 'windows-latest' && steps.cache-cargo.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -273,65 +266,89 @@ jobs:
# Separate uploads to prevent paths from being preserved
- name: Upload cargo artifacts (Linux)
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: chainhook-${{ env.SHORT_TARGET_NAME }}
path: chainhook-${{ env.SHORT_TARGET_NAME }}.tar.gz

- name: Upload cargo artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: chainhook-${{ env.SHORT_TARGET_NAME }}
path: chainhook-${{ env.SHORT_TARGET_NAME }}.msi

release:
name: Release
semantic-release:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main') && needs.get_release_info.outputs.tag != ''
needs:
- test
- dist_chainhook
- get_release_info
permissions:
actions: write
contents: write
- distributions
outputs:
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
new_release_git_tag: ${{ steps.semantic.outputs.new_release_git_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate release bot app token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.HIROSYSTEMS_RELEASE_BOT_ID }}
private-key: ${{ secrets.HIROSYSTEMS_RELEASE_BOT_PEM }}

- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Get bot user ID
id: bot-user-id
run: |
echo "user-id=$(gh api "/users/${{ steps.generate_token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: Download pre-built dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: Tag and Release
uses: ncipollo/release-action@v1
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
# Only run on non-PR events or only PRs that aren't from forks
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
SEMANTIC_RELEASE_PACKAGE: ${{ github.event.repository.name }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_CRATES_IO_API_KEY }}
GIT_AUTHOR_EMAIL: "${{ steps.bot-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com"
GIT_COMMITTER_EMAIL: "${{ steps.bot-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com"
with:
artifacts: "**/*.tar.gz,**/*.msi"
tag: ${{ needs.get_release_info.outputs.tag }}
commit: ${{ env.GITHUB_SHA }}
semantic_version: 19
extra_plugins: |
@semantic-release/changelog@6.0.3
@semantic-release/git@10.0.1
@semantic-release/exec@6.0.3
conventional-changelog-conventionalcommits@6.1.0

- name: Trigger pkg-version-bump workflow
uses: peter-evans/repository-dispatch@v1
if: steps.semantic.outputs.new_release_version != ''
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: released
client-payload: '{"tag": "${{ needs.get_release_info.outputs.tag }}"}'
client-payload: '{"tag": "${{ steps.semantic.outputs.new_release_version }}"}'

build-publish:
runs-on: ubuntu-latest
needs:
- test
- dist_chainhook
- get_release_info
needs: semantic-release
outputs:
docker_image_digest: ${{ steps.docker_push.outputs.digest }}
strategy:
fail-fast: false
matrix:
include:
- name: Chainhook
description: Chainhook is a reorg-aware indexing engine for the Stacks & Bitcoin blockchains.
image: ${{ github.repository }}
- image: ${{ github.repository }}
artifact: chainhook-linux-x64-glibc
dockerfile: dockerfiles/components/chainhook-node.dockerfile
steps:
Expand All @@ -340,11 +357,11 @@ jobs:
persist-credentials: false

- name: Checkout tag
if: needs.get_release_info.outputs.tag != ''
if: needs.semantic-release.outputs.new_release_version != ''
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ needs.get_release_info.outputs.tag }}
ref: ${{ needs.semantic-release.outputs.new_release_git_tag }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -358,8 +375,8 @@ jobs:
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},value=${{ needs.get_release_info.outputs.tag }},enable=${{ needs.get_release_info.outputs.tag != '' }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.get_release_info.outputs.tag }},enable=${{ needs.get_release_info.outputs.tag != '' }}
type=semver,pattern={{version}},value=${{ needs.semantic-release.outputs.new_release_version }},enable=${{ needs.semantic-release.outputs.new_release_version != '' }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.semantic-release.outputs.new_release_version }},enable=${{ needs.semantic-release.outputs.new_release_version != '' }}
type=raw,value=latest,enable={{is_default_branch}}

- name: Log in to DockerHub
Expand All @@ -369,7 +386,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Download pre-built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact }}

Expand All @@ -387,7 +404,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
push: ${{ (github.ref != 'refs/heads/main' || needs.get_release_info.outputs.tag != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
push: ${{ (github.ref != 'refs/heads/main' || needs.semantic-release.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}

deploy-dev:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -418,10 +435,9 @@ jobs:

auto-approve-dev:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main') && needs.get_release_info.outputs.tag != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
if: startsWith(github.ref, 'refs/heads/main') && needs.semantic-release.outputs.new_release_version != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
needs:
- build-publish
- get_release_info
steps:
- name: Approve pending deployments
run: |
Expand Down Expand Up @@ -462,11 +478,10 @@ jobs:

auto-approve-stg:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/main') && needs.get_release_info.outputs.tag != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
if: startsWith(github.ref, 'refs/heads/main') && needs.semantic-release.outputs.new_release_version != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
needs:
- build-publish
- deploy-dev
- get_release_info
steps:
- name: Approve pending deployments
run: |
Expand All @@ -490,8 +505,7 @@ jobs:
needs:
- build-publish
- deploy-staging
- get_release_info
if: startsWith(github.ref, 'refs/heads/main') && needs.get_release_info.outputs.tag != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
if: startsWith(github.ref, 'refs/heads/main') && needs.semantic-release.outputs.new_release_version != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
env:
DEPLOY_ENV: prd
environment:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ components/chainhook-types-js/dist
*.rdb
*.redb
cache/

components/chainhook-cli/src/service/tests/fixtures/tmp
components/chainhook-cli/src/archive/tests/fixtures/tmp
Chainhook.toml
**/src/service/tests/fixtures/tmp
**/src/archive/tests/fixtures/tmp
29 changes: 27 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"branches": [
"main"
"main",
{
"name": "beta",
"channel": "beta",
"prerelease": true
},
{
"name": "stacks-signers",
"channel": "stacks-signers",
"prerelease": true
}
],
"plugins": [
[
Expand All @@ -15,8 +25,23 @@
"preset": "conventionalcommits"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "sed -i -e '1h;2,$H;$!d;g' -e 's@name = \"chainhook\"\\nversion = \"[^\"]*\"@name = \"chainhook\"\\nversion = \"${nextRelease.version}\"@g' Cargo.toml Cargo.lock"
}
],
"@semantic-release/github",
"@semantic-release/changelog",
"@semantic-release/git"
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"components/chainhook-cli/Cargo.toml",
"components/chainhook-cli/Cargo.lock"
]
}
]
]
}
Loading
Loading