feat(node): self-contained binary — embed Rholang resources, defaults.conf, eliminate kamon#492
Merged
spreston8 merged 2 commits intorust/stagingfrom Apr 30, 2026
Merged
Conversation
….conf, eliminate kamon
Bake the genesis-ceremony Rholang sources and the HOCON defaults into the
node binary at compile time so a node only needs --data-dir and ports to
run. Production CWD requirement (workspace tree at runtime), the
`DEFAULT_DIR` env var, and the kamon.conf parallel-config-file shim are
all gone.
Changes:
- Embed all 11 .rho/.rhox genesis resources via include_str! in a new
casper/src/rust/genesis/contracts/embedded_rho.rs. Rewrite the call
sites in standard_deploys.rs to use a small `embedded_source` helper.
Delete CompiledRholangSource::apply / apply_with_env / load_source and
CompiledRholangTemplate::load_template (the file-loading machinery
that walked an 8-path search ladder relative to CWD). Production code
no longer touches the filesystem for Rholang sources; missing-asset
bugs become build errors.
- Embed defaults.conf via include_str! + hocon::HoconLoader::load_str.
Drop the `default_dir: &Path` parameter from
configuration::builder::build and the `DEFAULT_DIR` env var read in
main.rs. Override semantics unchanged: --config-file <path> and
<data_dir>/rnode.conf auto-load still apply on top of the embedded
baseline.
- Eliminate kamon.conf entirely. The InfluxDB and Zipkin reporters in
node/src/rust/diagnostics/ are hand-rolled Rust — they only borrowed
the JVM-Kamon HOCON schema for migration compatibility. Move the two
fields the Rust code actually consumed (tick_interval and the
InfluxDB endpoint) into NodeConf::Metrics under defaults.conf. Delete
KamonConf, configuration/kamon.rs, kamon.conf, the load_kamon_config
parsing path, and KamonConf plumbing through main.rs / mod.rs /
diagnostics.
- Delete unreferenced JVM logging artifacts: logback.xml,
logging-template/* (never read by any Rust code).
- Test-side filesystem .rho loading is preserved via a new
casper/tests/util/rholang/test_rho_loader.rs (load_test_rho), kept
out of the production binary. The 20 test files that loaded
.rho fixtures from disk are migrated.
- Dockerfile: drop the COPY steps that staged
node/src/main/resources/, casper/src/main/resources/, and
rholang/examples/ into the runtime image. The binary is now fully
self-contained.
Verified:
cargo build --release --tests --workspace clean
cargo test --release -p casper --test mod 345 passed / 0 failed
./target/release/node run --standalone reaches isReady:true
from /tmp with no
DEFAULT_DIR env var
and no workspace
tree on disk
Tail-end documentation and config-template cleanup that the self-contained-binary commit (d129086) implied but didn't touch. - README.md: clarify that the built-in defaults.conf is embedded into the binary at compile time via include_str! (not a runtime file lookup), so operators understand that the on-disk file is the source of the embed rather than a runtime dependency. - docs/node/README.md: update the config build pipeline description. Step 1 now describes `HoconLoader::new().load_str(EMBEDDED_DEFAULTS)` with a note that no `node/src/main/resources/` directory is required at runtime. Step 2 is reworded for accuracy. - node/src/main/resources/defaults.conf: drop the stale `kamon-influxdb` reference from the metrics-section comment. - Helm chart cleanup: * docker/helm/f1r3fly/configs/common/logback.xml: deleted (the JVM-Logback config was never read by the Rust binary; the enclosing `node/src/main/resources/logback.xml` was deleted in d129086, but the Helm chart still mounted a sibling copy). * docker/helm/f1r3fly/templates/statefulsets.yaml: drop the /var/lib/rnode/logback.xml subPath mount that pointed at the now-removed ConfigMap entry. * docker/helm/f1r3fly/templates/{deployable,observer}-rnode-configmaps.yaml: rewrite the Kamon-era comment in the embedded defaults.conf template; metrics endpoints (tick-interval, influxdb-endpoint) now live under the same `metrics` section in NodeConf. No code changes; binary rebuilt to verify the embedded HOCON still parses cleanly. Justfile already used --config-file overrides correctly (no DEFAULT_DIR env var, no CWD requirement); no recipe changes needed.
This was referenced May 1, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the Rust node binary fully self-contained at runtime: bake the genesis-ceremony Rholang sources and the HOCON defaults into the executable at compile time. After this lands,
target/release/node run --data-dir <dir>works from any CWD with no `DEFAULT_DIR` env var, no workspace tree on disk, and no resource-file mounts in the runtime container.This unblocks lighter-weight integration test infrastructure (subprocess-based provider, planned next) and removes a class of "works on my machine" CWD-dependency bugs.
What's in scope
Commit 1 (`d1290862`) — feat(node): self-contained binary
Net diff: ~80 LOC added, ~370 LOC deleted across 41 files.
Commit 2 (`58f5f776`) — docs(node): align README + Helm chart
Tail-end documentation and config-template cleanup that the first commit implied but didn't touch.
`Justfile` audited — already correct. Recipes pass `--config-file=...` explicitly; no `DEFAULT_DIR` env var, no CWD requirement. Zero changes needed there.
Why this approach
Embed-only (rather than "embed first, fall back to file") was chosen as the production approach. Rationale:
Test plan
Compatibility notes
Co-Authored-By: Claude noreply@anthropic.com