Files
zeekayandHanzo Dev 221a690739 hanzod: the per-machine daemon (HIP-1330 phase 1)
One ZAP socket (<data>/hanzo/hanzod.zap.sock, 0600, peer uid checked) and a
loopback view on 127.0.0.1:3690. A /v1 prefix table of Subsystems, started on
the first frame and stopped when idle: the cloud host, the Dev worker (a child
over a socketpair, bearer verified against the issuer's discovery before a byte
reaches it), Hanzo Engine at /v1/engine, and /v1/chain through the steward.
Identity is read through hanzo-identity, shared with the CLI. Programs run only
if their sha256 is pinned. Privileged actions go to an append-only ledger.

Co-authored-by: Hanzo Dev <[email protected]>
2026-11-21 01:44:04 -08:00

50 lines
2.3 KiB
Docker

# hanzo-chain — built for the architecture it is built on, and run on almost nothing.
#
# NO CROSS-COMPILE HERE. Each architecture is built on a runner of that
# architecture, so the binary that ships for an arch was compiled by a native
# toolchain rather than emulated. The lab runs both pools.
FROM rust:1-slim-bookworm AS build
WORKDIR /src
# git, because cargo needs it here. lux-node is a private git dependency and
# cargo's built-in fetcher resolved neither the URL rewrite nor the tag it is
# locked to — it authenticated and then reported the revision missing. Handing
# the fetch to git itself resolves both, and this base ships no git binary.
RUN apt-get update \
&& apt-get install --no-install-recommends -y git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
# Manifests first, so a source edit re-runs the compile and not the resolve.
COPY Cargo.toml Cargo.lock ./
COPY LICENSE README.md ./
COPY chain chain
COPY daemon daemon
COPY zap zap
# Locked, and the lockfile ships: a resolver left free to drift builds a tree
# nobody ran.
#
# lux-node is a git dependency on a private repository, named by an ssh:// URL
# that Cargo.lock records, so the credential arrives here and the URL is
# rewritten rather than edited — editing it would invalidate the lock. The
# secret is readable only by this command and lands in no layer. Without it
# cargo stops at "failed to authenticate when downloading repository".
RUN --mount=type=secret,id=gh_token \
export GIT_CONFIG_GLOBAL=/tmp/gitcred && \
tok=$(cat /run/secrets/gh_token) && \
printf '[url "https://x-access-token:%[email protected]/"]\n\tinsteadOf = https://github.com/\n\tinsteadOf = ssh://[email protected]/\n' "$tok" > "$GIT_CONFIG_GLOBAL" && \
cargo build --release --locked -p hanzo-chain \
&& test -s target/release/hanzo-chain \
&& rm -f /tmp/gitcred
# cc, not static: hanzo-chain links libc and libgcc and nothing else, so the image is
# the binary plus the two libraries it names.
FROM gcr.io/distroless/cc-debian12
COPY --from=build /src/target/release/hanzo-chain /usr/local/bin/hanzo-chain
# The RPC and the validator mesh. A validator is named by the key it proves on
# every link, so the mesh port is not an admin surface and needs no gate of its
# own.
EXPOSE 9630 9631
ENTRYPOINT ["/usr/local/bin/hanzo-chain"]