-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
132 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM rust:bookworm AS builder | ||
|
||
ARG GIT_COMMIT | ||
RUN test -n "$GIT_COMMIT" || (echo "GIT_COMMIT not set" && false) | ||
|
||
RUN echo "Building chainhook from commit: https://github.com/hirosystems/chainhook/commit/$GIT_COMMIT" | ||
|
||
RUN apt-get update && apt-get install -y libclang-dev | ||
RUN rustup toolchain install stable | ||
# RUN rustup component add rustfmt --toolchain stable | ||
|
||
WORKDIR /chainhook | ||
RUN git init && \ | ||
git remote add origin https://github.com/hirosystems/chainhook.git && \ | ||
git -c protocol.version=2 fetch --depth=1 origin "$GIT_COMMIT" && \ | ||
git reset --hard FETCH_HEAD | ||
|
||
RUN cargo build --package chainhook | ||
|
||
FROM debian:bookworm | ||
|
||
COPY --from=builder /chainhook/target/debug/chainhook /usr/local/bin/ | ||
|
||
COPY --from=dobtc/bitcoin:25.1 /opt/bitcoin-*/bin /usr/local/bin | ||
|
||
RUN apt-get update && apt-get install -y curl gettext-base jq | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
WORKDIR /root | ||
CMD ["chainhook"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[storage] | ||
working_dir = "cache" | ||
|
||
# The HTTP API allows you to register / deregister | ||
# predicates dynamically. | ||
# This is disabled by default. | ||
# | ||
[http_api] | ||
http_port = 20456 | ||
database_uri = "redis://redis:6379/" | ||
|
||
[network] | ||
mode = "devnet" | ||
bitcoind_rpc_url = "http://$BITCOIN_PEER_HOST:$BITCOIN_RPC_PORT" | ||
bitcoind_rpc_username = "$BITCOIN_RPC_USER" | ||
bitcoind_rpc_password = "$BITCOIN_RPC_PASS" | ||
|
||
# Chainhook must be able to receive Bitcoin block events. | ||
# These events can originate from either a Stacks node or a Bitcoin node's ZeroMQ interface. | ||
|
||
# By default, the service is set to receive Bitcoin block events from the Stacks node: | ||
stacks_node_rpc_url = "http://$STACKS_NODE_HOST" | ||
stacks_events_ingestion_port = 20455 | ||
|
||
# However, events can also be received directly from a Bitcoin node. | ||
# To achieve this, comment out the `stacks_node_rpc_url` line and uncomment the following line: | ||
# bitcoind_zmq_url = "tcp://0.0.0.0:18543" | ||
|
||
[limits] | ||
max_number_of_bitcoin_predicates = 100 | ||
max_number_of_concurrent_bitcoin_scans = 100 | ||
max_number_of_stacks_predicates = 10 | ||
max_number_of_concurrent_stacks_scans = 10 | ||
max_number_of_processing_threads = 16 | ||
max_number_of_networking_threads = 16 | ||
max_caching_memory_size_mb = 32000 | ||
|
||
# The TSV file is required for downloading historical data for your predicates. | ||
# If this is not a requirement, you can comment out the `tsv_file_url` line. | ||
# [[event_source]] | ||
# tsv_file_url = "https://archive.hiro.so/regtest/stacks-blockchain-api/regtest-stacks-blockchain-api-latest" | ||
|
||
# Enables a server that provides metrics that can be scraped by Prometheus. | ||
# This is disabled by default. | ||
# [monitoring] | ||
# prometheus_monitoring_port = 20457 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters