@@ -24,6 +24,99 @@ More documentation about Leios can be found in the [web site](https://leios.card
2424- [ sim-rs] ( sim-rs ) contains experimental Rust code to simulate the Leios protocol
2525- [ site] ( site ) contains the sources of the aforementioned web site
2626
27+ ## Docker Simulation
28+
29+ You can run both the Rust and Haskell simulations using Docker to generate simulation trace logs.
30+
31+ ### Building the Docker Images
32+
33+ ``` bash
34+ # Build the Rust simulation image
35+ docker build --target rs -t ouroboros-leios/sim-rs:latest -f Dockerfile .
36+
37+ # Build the Haskell simulation image
38+ docker build --target hs -t ouroboros-leios/sim-hs:latest -f Dockerfile .
39+ ```
40+
41+ ### Running the Rust Simulation
42+
43+ The Rust simulation generates JSONL trace files that can be visualized using the web-based UI:
44+
45+ #### Basic Usage (Default Settings)
46+ ``` bash
47+ # Run with default settings
48+ docker run -v $( pwd) /output:/output ouroboros-leios/sim-rs:latest
49+ ```
50+
51+ #### Specifying Output File
52+ ``` bash
53+ # Run with custom output file location
54+ docker run -v $( pwd) /output:/output ouroboros-leios/sim-rs:latest /output/simulation.jsonl
55+ ```
56+
57+ #### Using Custom Topology and Config Files
58+ ``` bash
59+ # Mount your config directory and use custom files
60+ docker run \
61+ -v $( pwd) /output:/output \
62+ -v $( pwd) /data/simulation:/config \
63+ ouroboros-leios/sim-rs:latest /config/topology-dense-52.yaml /output/simulation.jsonl -s 20 -p /config/config.default.yaml
64+ ```
65+
66+ Common arguments for Rust simulation:
67+ - ` -s NUMBER ` : Number of slots to simulate
68+ - ` -p PATH ` : Path to custom parameters file
69+ - ` --trace-node NODE_ID ` : Enable tracing for specific node
70+ - ` --timescale SCALE ` : Adjust simulation speed (e.g., 16 for 16x faster)
71+
72+ ### Running the Haskell Simulation
73+
74+ The Haskell simulation generates log files with simulation data:
75+
76+ #### Basic Usage (Default Settings)
77+ ``` bash
78+ # Run with default settings (40 seconds)
79+ docker run -v $( pwd) /output:/output ouroboros-leios/sim-hs:latest
80+ ```
81+
82+ #### Custom Duration and Output File
83+ ``` bash
84+ # Run for 120 seconds with specific output file
85+ docker run -v $( pwd) /output:/output ouroboros-leios/sim-hs:latest \
86+ --output-seconds 120 \
87+ --output-file /output/my-simulation.log
88+ ```
89+
90+ #### Using Custom Configuration
91+ ``` bash
92+ # Run with custom topology and config files
93+ docker run \
94+ -v $( pwd) /output:/output \
95+ -v $( pwd) /data/simulation:/config \
96+ ouroboros-leios/sim-hs:latest \
97+ --topology /config/topology-dense-52.yaml \
98+ --config /config/config.default.yaml \
99+ --output-seconds 60 \
100+ --seed 12345
101+ ```
102+
103+ Common arguments for Haskell simulation:
104+ - ` --output-seconds NUMBER ` : Duration of simulation in seconds (default: 40)
105+ - ` --seed NUMBER ` : Random seed for reproducible runs
106+ - ` --topology PATH ` : Custom topology file
107+ - ` --config PATH ` : Custom configuration file
108+ - ` --output-file PATH ` : Custom output file location
109+
110+ > [ !NOTE]
111+ > The Rust simulation generates JSONL trace files that can be visualized using the web-based UI in the ` ui ` directory.
112+ > The Haskell simulation generates log files in its own format.
113+ >
114+ > To visualize Rust simulation traces:
115+ > 1 . Generate a trace file using the Rust simulation
116+ > 2 . Use the web UI in the ` ui ` directory to load and visualize the trace
117+ >
118+ > For Haskell simulation visualization, use the ` viz ` command option directly in the Haskell simulation binary (not available in Docker).
119+
27120## Specification
28121
29122Build the Agda specification for Leios using either
0 commit comments