logos-blockchain-testing/docs/architecture-overview.html
2025-12-20 09:51:51 +01:00

472 lines
30 KiB
HTML

<!DOCTYPE HTML>
<html lang="en" class="light" dir="ltr">
<head>
<!-- Book generated using mdBook -->
<meta charset="UTF-8">
<title>Architecture Overview - Logos Blockchain Testing Framework Book</title>
<!-- Custom HTML head -->
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="favicon.svg">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" href="css/variables.css">
<link rel="stylesheet" href="css/general.css">
<link rel="stylesheet" href="css/chrome.css">
<link rel="stylesheet" href="css/print.css" media="print">
<!-- Fonts -->
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
<link rel="stylesheet" href="fonts/fonts.css">
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="highlight.css">
<link rel="stylesheet" href="tomorrow-night.css">
<link rel="stylesheet" href="ayu-highlight.css">
<!-- Custom theme stylesheets -->
</head>
<body class="sidebar-visible no-js">
<div id="body-container">
<!-- Provide site root to javascript -->
<script>
var path_to_root = "";
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
</script>
<!-- Work around some values being stored in localStorage wrapped in quotes -->
<script>
try {
var theme = localStorage.getItem('mdbook-theme');
var sidebar = localStorage.getItem('mdbook-sidebar');
if (theme.startsWith('"') && theme.endsWith('"')) {
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
}
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
}
} catch (e) { }
</script>
<!-- Set the theme before any content is loaded, prevents flash -->
<script>
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var html = document.querySelector('html');
html.classList.remove('light')
html.classList.add(theme);
var body = document.querySelector('body');
body.classList.remove('no-js')
body.classList.add('js');
</script>
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var body = document.querySelector('body');
var sidebar = null;
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
sidebar_toggle.checked = sidebar === 'visible';
body.classList.remove('sidebar-visible');
body.classList.add("sidebar-" + sidebar);
</script>
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="project-context-primer.html"><strong aria-hidden="true">1.</strong> Project Context Primer</a></li><li class="chapter-item expanded "><a href="what-you-will-learn.html"><strong aria-hidden="true">2.</strong> What You Will Learn</a></li><li class="chapter-item expanded "><a href="quickstart.html"><strong aria-hidden="true">3.</strong> Quickstart</a></li><li class="chapter-item expanded "><a href="part-i.html"><strong aria-hidden="true">4.</strong> Part I — Foundations</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="introduction.html"><strong aria-hidden="true">4.1.</strong> Introduction</a></li><li class="chapter-item expanded "><a href="architecture-overview.html" class="active"><strong aria-hidden="true">4.2.</strong> Architecture Overview</a></li><li class="chapter-item expanded "><a href="testing-philosophy.html"><strong aria-hidden="true">4.3.</strong> Testing Philosophy</a></li><li class="chapter-item expanded "><a href="scenario-lifecycle.html"><strong aria-hidden="true">4.4.</strong> Scenario Lifecycle</a></li><li class="chapter-item expanded "><a href="design-rationale.html"><strong aria-hidden="true">4.5.</strong> Design Rationale</a></li></ol></li><li class="chapter-item expanded "><a href="part-ii.html"><strong aria-hidden="true">5.</strong> Part II — User Guide</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="workspace-layout.html"><strong aria-hidden="true">5.1.</strong> Workspace Layout</a></li><li class="chapter-item expanded "><a href="annotated-tree.html"><strong aria-hidden="true">5.2.</strong> Annotated Tree</a></li><li class="chapter-item expanded "><a href="authoring-scenarios.html"><strong aria-hidden="true">5.3.</strong> Authoring Scenarios</a></li><li class="chapter-item expanded "><a href="workloads.html"><strong aria-hidden="true">5.4.</strong> Core Content: Workloads & Expectations</a></li><li class="chapter-item expanded "><a href="scenario-builder-ext-patterns.html"><strong aria-hidden="true">5.5.</strong> Core Content: ScenarioBuilderExt Patterns</a></li><li class="chapter-item expanded "><a href="best-practices.html"><strong aria-hidden="true">5.6.</strong> Best Practices</a></li><li class="chapter-item expanded "><a href="usage-patterns.html"><strong aria-hidden="true">5.7.</strong> Usage Patterns</a></li><li class="chapter-item expanded "><a href="examples.html"><strong aria-hidden="true">5.8.</strong> Examples</a></li><li class="chapter-item expanded "><a href="examples-advanced.html"><strong aria-hidden="true">5.9.</strong> Advanced & Artificial Examples</a></li><li class="chapter-item expanded "><a href="cucumber-bdd.html"><strong aria-hidden="true">5.10.</strong> Cucumber/BDD Interface</a></li><li class="chapter-item expanded "><a href="running-scenarios.html"><strong aria-hidden="true">5.11.</strong> Running Scenarios</a></li><li class="chapter-item expanded "><a href="runners.html"><strong aria-hidden="true">5.12.</strong> Runners</a></li><li class="chapter-item expanded "><a href="node-control.html"><strong aria-hidden="true">5.13.</strong> RunContext: BlockFeed & Node Control</a></li><li class="chapter-item expanded "><a href="chaos.html"><strong aria-hidden="true">5.14.</strong> Chaos Workloads</a></li><li class="chapter-item expanded "><a href="topology-chaos.html"><strong aria-hidden="true">5.15.</strong> Topology & Chaos Patterns</a></li></ol></li><li class="chapter-item expanded "><a href="part-iii.html"><strong aria-hidden="true">6.</strong> Part III — Developer Reference</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="scenario-model.html"><strong aria-hidden="true">6.1.</strong> Scenario Model (Developer Level)</a></li><li class="chapter-item expanded "><a href="api-levels.html"><strong aria-hidden="true">6.2.</strong> API Levels: Builder DSL vs. Direct</a></li><li class="chapter-item expanded "><a href="extending.html"><strong aria-hidden="true">6.3.</strong> Extending the Framework</a></li><li class="chapter-item expanded "><a href="custom-workload-example.html"><strong aria-hidden="true">6.4.</strong> Example: New Workload & Expectation (Rust)</a></li><li class="chapter-item expanded "><a href="internal-crate-reference.html"><strong aria-hidden="true">6.5.</strong> Internal Crate Reference</a></li></ol></li><li class="chapter-item expanded "><a href="part-iv.html"><strong aria-hidden="true">7.</strong> Part IV — Operations & Deployment</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="operations-overview.html"><strong aria-hidden="true">7.1.</strong> Overview</a></li><li class="chapter-item expanded "><a href="prerequisites.html"><strong aria-hidden="true">7.2.</strong> Prerequisites & Setup</a></li><li class="chapter-item expanded "><a href="running-examples.html"><strong aria-hidden="true">7.3.</strong> Running Examples</a></li><li class="chapter-item expanded "><a href="ci-integration.html"><strong aria-hidden="true">7.4.</strong> CI Integration</a></li><li class="chapter-item expanded "><a href="environment-variables.html"><strong aria-hidden="true">7.5.</strong> Environment Variables</a></li><li class="chapter-item expanded "><a href="logging-observability.html"><strong aria-hidden="true">7.6.</strong> Logging & Observability</a></li></ol></li><li class="chapter-item expanded "><a href="part-v.html"><strong aria-hidden="true">8.</strong> Part V — Appendix</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="dsl-cheat-sheet.html"><strong aria-hidden="true">8.1.</strong> Builder API Quick Reference</a></li><li class="chapter-item expanded "><a href="troubleshooting.html"><strong aria-hidden="true">8.2.</strong> Troubleshooting Scenarios</a></li><li class="chapter-item expanded "><a href="faq.html"><strong aria-hidden="true">8.3.</strong> FAQ</a></li><li class="chapter-item expanded "><a href="glossary.html"><strong aria-hidden="true">8.4.</strong> Glossary</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>
<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>
<div id="page-wrapper" class="page-wrapper">
<div class="page">
<div id="menu-bar-hover-placeholder"></div>
<div id="menu-bar" class="menu-bar sticky">
<div class="left-buttons">
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
<i class="fa fa-bars"></i>
</label>
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
<i class="fa fa-paint-brush"></i>
</button>
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
</ul>
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
<i class="fa fa-search"></i>
</button>
</div>
<h1 class="menu-title">Logos Blockchain Testing Framework Book</h1>
<div class="right-buttons">
<a href="print.html" title="Print this book" aria-label="Print this book">
<i id="print-button" class="fa fa-print"></i>
</a>
</div>
</div>
<div id="search-wrapper" class="hidden">
<form id="searchbar-outer" class="searchbar-outer">
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
</form>
<div id="searchresults-outer" class="searchresults-outer hidden">
<div id="searchresults-header" class="searchresults-header"></div>
<ul id="searchresults">
</ul>
</div>
</div>
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
<script>
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
});
</script>
<div id="content" class="content">
<main>
<h1 id="architecture-overview"><a class="header" href="#architecture-overview">Architecture Overview</a></h1>
<p>The framework follows a clear flow: <strong>Topology → Scenario → Deployer → Runner → Workloads → Expectations</strong>.</p>
<h2 id="core-flow"><a class="header" href="#core-flow">Core Flow</a></h2>
<pre><code class="language-mermaid">flowchart LR
A(Topology&lt;br/&gt;shape cluster) --&gt; B(Scenario&lt;br/&gt;plan)
B --&gt; C(Deployer&lt;br/&gt;provision &amp; readiness)
C --&gt; D(Runner&lt;br/&gt;orchestrate execution)
D --&gt; E(Workloads&lt;br/&gt;drive traffic)
E --&gt; F(Expectations&lt;br/&gt;verify outcomes)
</code></pre>
<h2 id="crate-architecture"><a class="header" href="#crate-architecture">Crate Architecture</a></h2>
<pre><code class="language-mermaid">flowchart TB
subgraph Examples["Runner Examples"]
LocalBin[local_runner.rs]
ComposeBin[compose_runner.rs]
K8sBin[k8s_runner.rs]
CucumberBin[cucumber_*.rs]
end
subgraph Workflows["Workflows (Batteries Included)"]
DSL[ScenarioBuilderExt&lt;br/&gt;Fluent API]
TxWorkload[Transaction Workload]
DAWorkload[DA Workload]
ChaosWorkload[Chaos Workload]
Expectations[Built-in Expectations]
end
subgraph Core["Core Framework"]
ScenarioModel[Scenario Model]
Traits[Deployer + Runner Traits]
BlockFeed[BlockFeed]
NodeClients[Node Clients]
Topology[Topology Generation]
end
subgraph Deployers["Runner Implementations"]
LocalDeployer[LocalDeployer]
ComposeDeployer[ComposeDeployer]
K8sDeployer[K8sDeployer]
end
subgraph Support["Supporting Crates"]
Configs[Configs &amp; Topology]
Nodes[Node API Clients]
Cucumber[Cucumber Extensions]
end
Examples --&gt; Workflows
Examples --&gt; Deployers
Workflows --&gt; Core
Deployers --&gt; Core
Deployers --&gt; Support
Core --&gt; Support
Workflows --&gt; Support
style Examples fill:#e1f5ff
style Workflows fill:#e1ffe1
style Core fill:#fff4e1
style Deployers fill:#ffe1f5
style Support fill:#f0f0f0
</code></pre>
<h3 id="layer-responsibilities"><a class="header" href="#layer-responsibilities">Layer Responsibilities</a></h3>
<p><strong>Runner Examples (Entry Points)</strong></p>
<ul>
<li>Executable binaries that demonstrate framework usage</li>
<li>Wire together deployers, scenarios, and execution</li>
<li>Provide CLI interfaces for different modes</li>
</ul>
<p><strong>Workflows (High-Level API)</strong></p>
<ul>
<li><code>ScenarioBuilderExt</code> trait provides fluent DSL</li>
<li>Built-in workloads (transactions, DA, chaos)</li>
<li>Common expectations (liveness, inclusion)</li>
<li>Simplifies scenario authoring</li>
</ul>
<p><strong>Core Framework (Foundation)</strong></p>
<ul>
<li><code>Scenario</code> model and lifecycle orchestration</li>
<li><code>Deployer</code> and <code>Runner</code> traits (extension points)</li>
<li><code>BlockFeed</code> for real-time block observation</li>
<li><code>RunContext</code> providing node clients and metrics</li>
<li>Topology generation and validation</li>
</ul>
<p><strong>Runner Implementations</strong></p>
<ul>
<li><code>LocalDeployer</code> - spawns processes on host</li>
<li><code>ComposeDeployer</code> - orchestrates Docker Compose</li>
<li><code>K8sDeployer</code> - deploys to Kubernetes cluster</li>
<li>Each implements <code>Deployer</code> trait</li>
</ul>
<p><strong>Supporting Crates</strong></p>
<ul>
<li><code>configs</code> - Topology configuration and generation</li>
<li><code>nodes</code> - HTTP/RPC client for node APIs</li>
<li><code>cucumber</code> - BDD/Gherkin integration</li>
</ul>
<h3 id="extension-points"><a class="header" href="#extension-points">Extension Points</a></h3>
<pre><code class="language-mermaid">flowchart LR
Custom[Your Code] -.implements.-&gt; Workload[Workload Trait]
Custom -.implements.-&gt; Expectation[Expectation Trait]
Custom -.implements.-&gt; Deployer[Deployer Trait]
Workload --&gt; Core[Core Framework]
Expectation --&gt; Core
Deployer --&gt; Core
style Custom fill:#ffe1f5
style Core fill:#fff4e1
</code></pre>
<p><strong>Extend by implementing:</strong></p>
<ul>
<li><code>Workload</code> - Custom traffic generation patterns</li>
<li><code>Expectation</code> - Custom success criteria</li>
<li><code>Deployer</code> - Support for new deployment targets</li>
</ul>
<p>See <a href="extending.html">Extending the Framework</a> for details.</p>
<h3 id="components"><a class="header" href="#components">Components</a></h3>
<ul>
<li><strong>Topology</strong> describes the cluster: how many nodes, their roles, and the high-level network and data-availability parameters they should follow.</li>
<li><strong>Scenario</strong> combines that topology with the activities to run and the checks to perform, forming a single plan.</li>
<li><strong>Deployer</strong> provisions infrastructure on the chosen backend (local processes, Docker Compose, or Kubernetes), waits for readiness, and returns a Runner.</li>
<li><strong>Runner</strong> orchestrates scenario execution: starts workloads, observes signals, evaluates expectations, and triggers cleanup.</li>
<li><strong>Workloads</strong> generate traffic and conditions that exercise the system.</li>
<li><strong>Expectations</strong> observe the run and judge success or failure once activity completes.</li>
</ul>
<p>Each layer has a narrow responsibility so that cluster shape, deployment choice,
traffic generation, and health checks can evolve independently while fitting
together predictably.</p>
<h2 id="entry-points"><a class="header" href="#entry-points">Entry Points</a></h2>
<p>The framework is consumed via <strong>runnable example binaries</strong> in <code>examples/src/bin/</code>:</p>
<ul>
<li><code>local_runner.rs</code> — Spawns nodes as host processes</li>
<li><code>compose_runner.rs</code> — Deploys via Docker Compose (requires <code>NOMOS_TESTNET_IMAGE</code> built)</li>
<li><code>k8s_runner.rs</code> — Deploys via Kubernetes Helm (requires cluster + image)</li>
</ul>
<p><strong>Recommended:</strong> Use the convenience script:</p>
<pre><code class="language-bash">scripts/run/run-examples.sh -t &lt;duration&gt; -v &lt;validators&gt; -e &lt;executors&gt; &lt;mode&gt;
# mode: host, compose, or k8s
</code></pre>
<p>This handles circuit setup, binary building/bundling, image building, and execution.</p>
<p><strong>Alternative:</strong> Direct cargo run (requires manual setup):</p>
<pre><code class="language-bash">POL_PROOF_DEV_MODE=true cargo run -p runner-examples --bin &lt;name&gt;
</code></pre>
<p><strong>Important:</strong> All runners require <code>POL_PROOF_DEV_MODE=true</code> to avoid expensive Groth16 proof generation that causes timeouts.</p>
<p>These binaries use the framework API (<code>ScenarioBuilder</code>) to construct and execute scenarios.</p>
<h2 id="builder-api"><a class="header" href="#builder-api">Builder API</a></h2>
<p>Scenarios are defined using a fluent builder pattern:</p>
<pre><code class="language-rust ignore">use std::time::Duration;
use testing_framework_core::scenario::ScenarioBuilder;
use testing_framework_workflows::ScenarioBuilderExt;
pub fn scenario_plan() -&gt; testing_framework_core::scenario::Scenario&lt;()&gt; {
ScenarioBuilder::topology_with(|t| t.network_star().validators(3).executors(2))
.wallets(50)
.transactions_with(|txs| txs.rate(5).users(20))
.da_with(|da| da.channel_rate(1).blob_rate(2))
.expect_consensus_liveness()
.with_run_duration(Duration::from_secs(90))
.build()
}</code></pre>
<p><strong>Key API Points:</strong></p>
<ul>
<li>Topology uses <code>.topology_with(|t| { t.validators(N).executors(M) })</code> closure pattern</li>
<li>Workloads are configured via <code>_with</code> closures (<code>transactions_with</code>, <code>da_with</code>, <code>chaos_with</code>)</li>
<li>Chaos workloads require <code>.enable_node_control()</code> and a compatible runner</li>
</ul>
<h2 id="deployers"><a class="header" href="#deployers">Deployers</a></h2>
<p>Three deployer implementations:</p>
<div class="table-wrapper"><table><thead><tr><th>Deployer</th><th>Backend</th><th>Prerequisites</th><th>Node Control</th></tr></thead><tbody>
<tr><td><code>LocalDeployer</code></td><td>Host processes</td><td>Binaries (built on demand or via bundle)</td><td>No</td></tr>
<tr><td><code>ComposeDeployer</code></td><td>Docker Compose</td><td>Image with embedded assets/binaries</td><td>Yes</td></tr>
<tr><td><code>K8sDeployer</code></td><td>Kubernetes Helm</td><td>Cluster + image loaded</td><td>Not yet</td></tr>
</tbody></table>
</div>
<p><strong>Compose-specific features:</strong></p>
<ul>
<li>Observability is external (set <code>NOMOS_METRICS_QUERY_URL</code> / <code>NOMOS_METRICS_OTLP_INGEST_URL</code> / <code>NOMOS_GRAFANA_URL</code> as needed)</li>
<li>Optional OTLP trace/metrics endpoints (<code>NOMOS_OTLP_ENDPOINT</code>, <code>NOMOS_OTLP_METRICS_ENDPOINT</code>)</li>
<li>Node control for chaos testing (restart validators/executors)</li>
</ul>
<h2 id="assets-and-images"><a class="header" href="#assets-and-images">Assets and Images</a></h2>
<h3 id="docker-image"><a class="header" href="#docker-image">Docker Image</a></h3>
<p>Built via <code>scripts/build/build_test_image.sh</code>:</p>
<ul>
<li>Embeds KZG circuit parameters and binaries from <code>testing-framework/assets/stack/kzgrs_test_params/kzgrs_test_params</code></li>
<li>Includes runner scripts: <code>run_nomos_node.sh</code>, <code>run_nomos_executor.sh</code></li>
<li>Tagged as <code>NOMOS_TESTNET_IMAGE</code> (default: <code>logos-blockchain-testing:local</code>)</li>
<li><strong>Recommended:</strong> Use prebuilt bundle via <code>scripts/build/build-bundle.sh --platform linux</code> and set <code>NOMOS_BINARIES_TAR</code> before building image</li>
</ul>
<h3 id="circuit-assets"><a class="header" href="#circuit-assets">Circuit Assets</a></h3>
<p>KZG parameters required for DA workloads:</p>
<ul>
<li><strong>Host path:</strong> <code>testing-framework/assets/stack/kzgrs_test_params/kzgrs_test_params</code> (note repeated filename—directory contains file <code>kzgrs_test_params</code>)</li>
<li><strong>Container path:</strong> <code>/kzgrs_test_params/kzgrs_test_params</code> (for compose/k8s)</li>
<li><strong>Override:</strong> <code>NOMOS_KZGRS_PARAMS_PATH=/custom/path/to/file</code> (must point to file)</li>
<li><strong>Fetch via:</strong> <code>scripts/setup/setup-nomos-circuits.sh v0.3.1 /tmp/circuits</code> or use <code>scripts/run/run-examples.sh</code></li>
</ul>
<h3 id="compose-stack"><a class="header" href="#compose-stack">Compose Stack</a></h3>
<p>Templates and configs in <code>testing-framework/runners/compose/assets/</code>:</p>
<ul>
<li><code>docker-compose.yml.tera</code> — Stack template (validators, executors)</li>
<li>Cfgsync config: <code>testing-framework/assets/stack/cfgsync.yaml</code></li>
<li>Monitoring assets (not deployed by the framework): <code>testing-framework/assets/stack/monitoring/</code></li>
</ul>
<h2 id="logging-architecture"><a class="header" href="#logging-architecture">Logging Architecture</a></h2>
<p><strong>Two separate logging pipelines:</strong></p>
<div class="table-wrapper"><table><thead><tr><th>Component</th><th>Configuration</th><th>Output</th></tr></thead><tbody>
<tr><td><strong>Runner binaries</strong></td><td><code>RUST_LOG</code></td><td>Framework orchestration logs</td></tr>
<tr><td><strong>Node processes</strong></td><td><code>NOMOS_LOG_LEVEL</code>, <code>NOMOS_LOG_FILTER</code> (+ <code>NOMOS_LOG_DIR</code> on host runner)</td><td>Consensus, DA, mempool logs</td></tr>
</tbody></table>
</div>
<p><strong>Node logging:</strong></p>
<ul>
<li><strong>Local runner:</strong> Writes to temporary directories by default (cleaned up). Set <code>NOMOS_TESTS_TRACING=true</code> + <code>NOMOS_LOG_DIR</code> for persistent files.</li>
<li><strong>Compose runner:</strong> Default logs to container stdout/stderr (<code>docker logs</code>). To write per-node files, set <code>tracing_settings.logger: !File</code> in <code>testing-framework/assets/stack/cfgsync.yaml</code> (and mount a writable directory).</li>
<li><strong>K8s runner:</strong> Logs to pod stdout/stderr (<code>kubectl logs</code>). To write per-node files, set <code>tracing_settings.logger: !File</code> in <code>testing-framework/assets/stack/cfgsync.yaml</code> (and mount a writable directory).</li>
</ul>
<p><strong>File naming:</strong> Per-node files use prefix <code>nomos-node-{index}</code> or <code>nomos-executor-{index}</code> (may include timestamps).</p>
<h2 id="observability"><a class="header" href="#observability">Observability</a></h2>
<p><strong>Prometheus-compatible metrics querying (optional):</strong></p>
<ul>
<li>The framework does <strong>not</strong> deploy Prometheus/Grafana.</li>
<li>Provide a Prometheus-compatible base URL (PromQL API) via <code>NOMOS_METRICS_QUERY_URL</code>.</li>
<li>Accessible in expectations when configured: <code>ctx.telemetry().prometheus().map(|p| p.base_url())</code></li>
</ul>
<p><strong>Grafana dashboards (optional):</strong></p>
<ul>
<li>Dashboards live in <code>testing-framework/assets/stack/monitoring/grafana/dashboards/</code> and can be imported into your Grafana.</li>
<li>If you set <code>NOMOS_GRAFANA_URL</code>, the deployer prints it in <code>TESTNET_ENDPOINTS</code>.</li>
</ul>
<p><strong>Node APIs:</strong></p>
<ul>
<li>HTTP endpoints per node for consensus info, network status, DA membership</li>
<li>Accessible in expectations: <code>ctx.node_clients().validator_clients().get(0)</code></li>
</ul>
<p><strong>OTLP (optional):</strong></p>
<ul>
<li>Trace endpoint: <code>NOMOS_OTLP_ENDPOINT=http://localhost:4317</code></li>
<li>Metrics endpoint: <code>NOMOS_OTLP_METRICS_ENDPOINT=http://localhost:4318</code></li>
<li>Disabled by default (no noise if unset)</li>
</ul>
<p>For detailed logging configuration, see <a href="logging-observability.html">Logging &amp; Observability</a>.</p>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="prev" href="introduction.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="testing-philosophy.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
<div style="clear: both"></div>
</nav>
</div>
</div>
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="prev" href="introduction.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
<i class="fa fa-angle-left"></i>
</a>
<a rel="next prefetch" href="testing-philosophy.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<script>
window.playground_copyable = true;
</script>
<script src="elasticlunr.min.js"></script>
<script src="mark.min.js"></script>
<script src="searcher.js"></script>
<script src="clipboard.min.js"></script>
<script src="highlight.js"></script>
<script src="book.js"></script>
<!-- Custom JS scripts -->
<script src="theme/mermaid-init.js"></script>
</div>
</body>
</html>