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
23 changes: 21 additions & 2 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"crates/cow-venue",
"crates/nexum-cli",
"crates/nexum-launch",
"crates/nexum-macros",
"crates/nexum-runtime",
"crates/nexum-sdk",
Expand All @@ -11,6 +12,7 @@ members = [
"crates/nexum-venue-sdk",
"crates/nexum-venue-test",
"crates/nexum-world",
"crates/shepherd",
"crates/shepherd-backtest",
"crates/shepherd-cow-host",
"crates/shepherd-sdk",
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.6
#
# Multi-stage build for `nexum` (Shepherd) - the engine binary
# plus the five production WASM modules baked into a single image.
# Multi-stage build for `shepherd` - the cow composition-root engine
# binary plus the five production WASM modules baked into a single image.
#
# Stage 1 (`build`): full Rust toolchain + wasm32-wasip2 target, builds
# the engine in release mode + each module to a Component Model wasm
Expand Down Expand Up @@ -65,7 +65,7 @@ FROM chef AS build
# changed workspace crate. `--locked` stays on the real builds below, which
# validate the committed Cargo.lock verbatim.
COPY --from=planner /src/recipe.json recipe.json
RUN cargo chef cook --release -p nexum-cli --recipe-path recipe.json \
RUN cargo chef cook --release -p shepherd --recipe-path recipe.json \
&& cargo chef cook --release --target wasm32-wasip2 \
-p twap-monitor -p ethflow-watcher -p price-alert \
-p balance-tracker -p stop-loss --recipe-path recipe.json
Expand All @@ -77,7 +77,7 @@ COPY . .

# Engine binary in release. --locked ensures the committed Cargo.lock
# is used verbatim so builds are reproducible.
RUN cargo build -p nexum-cli --release --locked
RUN cargo build -p shepherd --release --locked

# Five production modules. The wasm artefacts land under
# `target/wasm32-wasip2/release/<name_with_underscores>.wasm`.
Expand Down Expand Up @@ -108,7 +108,7 @@ RUN apt-get update \
&& install -d -o root -g root -m 0755 /etc/shepherd

# Engine binary.
COPY --from=build /src/target/release/nexum /usr/local/bin/nexum
COPY --from=build /src/target/release/shepherd /usr/local/bin/shepherd

# Module .wasm artefacts. The Component Model wasm files are loaded
# by the engine at boot via the `[[modules]]` entries in engine.toml.
Expand Down Expand Up @@ -138,5 +138,5 @@ EXPOSE 9100
# `--engine-config /etc/shepherd/engine.toml` matches the production
# guide's expected mount point. Operators override via
# `docker run ... -v /path/to/engine.toml:/etc/shepherd/engine.toml:ro`.
ENTRYPOINT ["/usr/bin/tini", "--", "nexum"]
ENTRYPOINT ["/usr/bin/tini", "--", "shepherd"]
CMD ["--engine-config", "/etc/shepherd/engine.toml"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Looking for the org? See **[github.com/nullislabs](https://github.com/nullislabs
| Path | Purpose |
| --- | --- |
| `crates/nexum-runtime/` | The **engine** - the Nexum Runtime's reference host: a wasmtime implementation of the `nexum:host` contract. |
| `crates/nexum-cli/` | The `nexum` binary - a thin CLI over the runtime library. |
| `crates/nexum-launch/` | The generic launcher library - shared CLI, config load, tracing, and the preset-driven launch. |
| `crates/nexum-cli/` | The bare `nexum` binary - the core lattice with no extension payload. |
| `crates/shepherd/` | The `shepherd` binary - the cow composition root wiring the cow-api extension. |
| `crates/nexum-sdk/` | Generic guest SDK - the host trait seam, bind macro, chain/config/address helpers, wasi:http `fetch`, and tracing facade for any module. |
| `crates/shepherd-sdk/` | CoW-domain guest SDK - the cow-api trait and CoW Protocol helpers on top of `nexum-sdk`. |
| `wit/nexum-host/` | The **`nexum:host`** WIT package - the host/guest contract every engine implements and every module imports. |
Expand Down
7 changes: 1 addition & 6 deletions crates/nexum-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ name = "nexum"
path = "src/main.rs"

[dependencies]
nexum-launch = { path = "../nexum-launch" }
nexum-runtime = { path = "../nexum-runtime" }
# Composition root wires the cow-api host extension into the reference
# lattice; the runtime itself carries no cow dependency.
shepherd-cow-host = { path = "../shepherd-cow-host" }

anyhow.workspace = true
clap.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
60 changes: 0 additions & 60 deletions crates/nexum-cli/src/cli.rs

This file was deleted.

58 changes: 0 additions & 58 deletions crates/nexum-cli/src/launch.rs

This file was deleted.

47 changes: 5 additions & 42 deletions crates/nexum-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,48 +1,11 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

mod cli;
mod launch;
//! The bare `nexum` engine binary: the core lattice with no extension
//! payload, composed over the generic launcher.

use clap::Parser;
use tracing::info;
use tracing_subscriber::EnvFilter;
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use crate::cli::Cli;
use nexum_runtime::engine_config;
use nexum_runtime::preset::CoreRuntime;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();

let mut engine_cfg = engine_config::load_or_default(cli.engine_config.as_deref())?;
if let Some(n) = cli.log_backfill_concurrency {
engine_cfg.engine.log_backfill_concurrency = n;
}

let env_filter = EnvFilter::try_from_default_env()
.or_else(|_| EnvFilter::try_new(&engine_cfg.engine.log_level))
.unwrap_or_else(|_| EnvFilter::new("info"));
// Structured logging: JSON by default (machine-readable
// for production; one `jq` query reconstructs any dispatch
// timeline); `--pretty-logs` opts back into the 0.1 human-readable
// formatter for local dev. The same `EnvFilter` applies to both
// so `RUST_LOG=debug` works identically.
if cli.pretty_logs {
tracing_subscriber::fmt()
.with_env_filter(env_filter)
.with_target(true)
.init();
} else {
tracing_subscriber::fmt()
.with_env_filter(env_filter)
.with_target(true)
.json()
.flatten_event(true)
.with_current_span(false)
.init();
}

info!("nexum starting");

launch::run_from_config(&engine_cfg, cli.wasm.as_deref(), cli.manifest.as_deref()).await
nexum_launch::run("nexum", CoreRuntime).await
}
17 changes: 17 additions & 0 deletions crates/nexum-launch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "nexum-launch"
version = "0.2.0"
edition.workspace = true
license.workspace = true
repository.workspace = true

[lints]
workspace = true

[dependencies]
nexum-runtime = { path = "../nexum-runtime" }

anyhow.workspace = true
clap.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
Loading
Loading