Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
77 changes: 35 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "btcnode-metrics"
edition = "2024"
version = "2.0.4"
version = "2.0.5"
description = "The Bitcoin node metrics exporter for Prometheus based on Rust Bitcoin Community's crate for Bitcoin JSON-RPC."
license-file = "LICENSE"
homepage = "https://github.com/AltaModaTech/btcnode-metrics"
Expand All @@ -21,3 +21,16 @@ toml = "1"
anyhow = "1"
corepc-client = { version = "0.10", features = ["client-sync"] }
thiserror = "2"


[package.metadata.docs.rs]
# Target to test build on, used as the default landing page (default: "x86_64-unknown-linux-gnu")
default-target = "x86_64-unknown-linux-gnu"
# Targets to build (default: see below)
targets = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc"
]
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@ FROM rust:bookworm AS build
# Dependencies
RUN USER=root apt-get update && apt-get upgrade -y

# Install the lastest version directly into path
RUN cargo install btcnode-metrics --root /usr/local
WORKDIR /app
RUN mkdir -p /app/src

# Copy source code
COPY Cargo.toml Cargo.lock ./
COPY src ./src

# Build and install
RUN cargo install --path . --root /usr/local

#####
# Final base
FROM debian:bookworm-slim

# copy the build target
COPY --from=build /usr/local/bin/btcnode-metrics /usr/local/bin/btcnode-metrics

# copy the bin and config
# copy the config
RUN mkdir /etc/btcnode-metrics
COPY ./config.local.toml /etc/btcnode-metrics/config.toml

# expose the port identified in the config
EXPOSE 9898
# expose the Prometheus metrics port specified in the config
EXPOSE 9332

ENV RUST_LOG=info

Expand Down
10 changes: 9 additions & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
###
# Copy this file to config.local.toml
# Edit config.local.toml to match your needs
# The Dockerfile copies config.local.toml to /etc/btcnode-metrics/config.toml in the final image.
###

# Bitcoin node config
[node]
rpc_url = "http://127.0.0.1:8332"
rpc_url = "http://127.0.0.1:9898"
rpc_user = "bitcoinrpc"
rpc_password = "changeme"

# Prometheus metrics host config
[server]
listen_addr = "0.0.0.0:9332"
Loading