Skip to content

Commit a11dd5a

Browse files
Docs/d2 hs (#103)
* docs: rs component & container diagram ci: generate diagram pngs from d2 files * refactor: component diagram * Short-pipeline Leios updates (#97) * fix: rename diagram * fix: merge main * docs: haskell simulation * refactor: hs container & component diagram * Auto-generate diagram PNGs [skip ci] --------- Co-authored-by: Yves Hauser <[email protected]>
1 parent c663225 commit a11dd5a

File tree

4 files changed

+247
-0
lines changed

4 files changed

+247
-0
lines changed

simulation/docs/component.d2

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
title: {
2+
label: "ouroboros-leios-sim - Component Diagram"
3+
near: top-center
4+
shape: text
5+
style.font-size: 24
6+
style.bold: true
7+
}
8+
9+
# Styles
10+
classes: {
11+
component: {
12+
style: {
13+
stroke: "#2a2a2a"
14+
fill: "#ffffff"
15+
font-color: "#2a2a2a"
16+
border-radius: 10
17+
shadow: true
18+
}
19+
}
20+
container: {
21+
style: {
22+
stroke: "#2a2a2a"
23+
fill: "#f5f5f5"
24+
font-color: "#2a2a2a"
25+
border-radius: 10
26+
shadow: true
27+
}
28+
}
29+
subcomponent: {
30+
style: {
31+
stroke: "#666666"
32+
fill: "#ffffff"
33+
font-color: "#2a2a2a"
34+
border-radius: 5
35+
shadow: false
36+
}
37+
}
38+
}
39+
40+
# Protocol Engine Container
41+
protocol-engine: {
42+
class: container
43+
label: "Protocol Engine"
44+
45+
praos: {
46+
class: component
47+
label: "Praos Protocol\n\nImplements core consensus\nand block chain"
48+
}
49+
50+
leios: {
51+
class: component
52+
label: "Leios Protocol\n\nImplements input endorsement\nand ranking blocks"
53+
}
54+
55+
relay: {
56+
class: component
57+
label: "Relay Protocol\n\nHandles block and vote\ndiffusion"
58+
}
59+
60+
node-manager: {
61+
class: component
62+
label: "Node Manager\n\nManages node state and\nprotocol interactions"
63+
}
64+
}
65+
66+
# Channel Layer Container
67+
channel-layer: {
68+
class: container
69+
label: "Channel Layer"
70+
71+
chan: {
72+
class: component
73+
label: "Generic Channel\n\nBase channel abstraction"
74+
}
75+
76+
tcp: {
77+
class: component
78+
label: "TCP Channel\n\nSimulates TCP behavior"
79+
}
80+
81+
mux: {
82+
class: component
83+
label: "Channel Multiplexer\n\nMultiplexes protocols"
84+
}
85+
86+
driver: {
87+
class: component
88+
label: "Channel Driver\n\nManages protocol\nchannels"
89+
}
90+
}
91+
92+
# Visualization Engine Container
93+
viz-engine: {
94+
class: container
95+
label: "Visualization Engine"
96+
97+
layout: {
98+
class: component
99+
label: "Layout Engine\n\nHandles visualization\nlayout"
100+
}
101+
102+
relay-viz: {
103+
class: component
104+
label: "Relay Visualizer\n\nVisualizes relay\nprotocol state"
105+
}
106+
107+
p2p-viz: {
108+
class: component
109+
label: "P2P Visualizer\n\nVisualizes P2P\nnetwork state"
110+
}
111+
112+
frame-output: {
113+
class: component
114+
label: "Frame Output\n\nOutputs animation frames\nas PNG files"
115+
}
116+
}
117+
118+
# Event Monitor Container
119+
monitor: {
120+
class: container
121+
label: "Event Monitor"
122+
123+
metrics: {
124+
class: component
125+
label: "Metrics Collector\n\nCollects in-memory\nperformance metrics"
126+
}
127+
128+
tracer: {
129+
class: component
130+
label: "Event Tracer\n\nTraces protocol and\nnetwork events in memory"
131+
}
132+
}
133+
134+
# Core Layer Relationships
135+
channel-layer.tcp -> channel-layer.chan: "Implements"
136+
channel-layer.mux -> channel-layer.chan: "Uses"
137+
channel-layer.driver -> channel-layer.chan: "Uses"
138+
channel-layer.mux -> channel-layer.tcp: "Routes over"
139+
channel-layer.driver -> channel-layer.mux: "Uses for routing"
140+
141+
# Protocol Layer Relationships
142+
protocol-engine.relay -> channel-layer.driver: "Uses for messaging"
143+
protocol-engine.praos -> channel-layer.driver: "Uses for consensus"
144+
protocol-engine.leios -> protocol-engine.praos: "Extends consensus"
145+
protocol-engine.leios -> protocol-engine.relay: "Uses for diffusion"
146+
protocol-engine.node-manager -> channel-layer.driver: "Manages connections"
147+
148+
# Visualization Layer Relationships
149+
viz-engine.relay-viz -> protocol-engine.relay: "Visualizes state"
150+
viz-engine.p2p-viz -> channel-layer.tcp: "Visualizes network"
151+
viz-engine.layout -> viz-engine.relay-viz: "Provides layout"
152+
viz-engine.layout -> viz-engine.p2p-viz: "Provides layout"
153+
viz-engine.frame-output -> viz-engine.relay-viz: "Captures frames"
154+
viz-engine.frame-output -> viz-engine.p2p-viz: "Captures frames"
155+
156+
# Monitoring Relationships
157+
monitor.metrics -> viz-engine.relay-viz: "Provides metrics"
158+
monitor.metrics -> viz-engine.p2p-viz: "Provides metrics"
159+
monitor.tracer -> channel-layer.tcp: "Traces network"
160+
monitor.tracer -> protocol-engine.praos: "Traces consensus"
161+
monitor.tracer -> protocol-engine.leios: "Traces protocol"
162+
monitor.tracer -> protocol-engine.relay: "Traces diffusion"

simulation/docs/component.png

993 KB
Loading

simulation/docs/container.d2

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
title: {
2+
label: "ouroboros-leios-sim - Container Diagram"
3+
near: top-center
4+
shape: text
5+
style.font-size: 24
6+
style.bold: true
7+
}
8+
9+
# Styles
10+
classes: {
11+
container: {
12+
style: {
13+
stroke: "#2a2a2a"
14+
fill: "#f5f5f5"
15+
font-color: "#2a2a2a"
16+
border-radius: 10
17+
shadow: true
18+
}
19+
}
20+
external: {
21+
style: {
22+
stroke: "#2a2a2a"
23+
fill: "#ffffff"
24+
font-color: "#2a2a2a"
25+
border-radius: 10
26+
stroke-dash: 5
27+
}
28+
}
29+
actor: {
30+
style: {
31+
stroke: "#2a2a2a"
32+
fill: "#ffffff"
33+
font-color: "#2a2a2a"
34+
border-radius: 25
35+
shadow: true
36+
}
37+
}
38+
}
39+
40+
user: {
41+
class: actor
42+
label: "User\n\nSimulation operator"
43+
}
44+
45+
protocol-engine: {
46+
class: container
47+
label: "Protocol Engine\n[Haskell]\n\nImplements Praos and\nLeios protocols"
48+
}
49+
50+
network: {
51+
class: container
52+
label: "Channel Layer\n[Haskell]\n\nSimulates TCP connections\nand multiplexing"
53+
}
54+
55+
monitor: {
56+
class: container
57+
label: "Event Monitor\n[Haskell]\n\nCollects in-memory metrics\nand traces events"
58+
}
59+
60+
viz: {
61+
class: container
62+
label: "Visualization Engine\n[Haskell]\n\nRenders protocol and\nnetwork state"
63+
}
64+
65+
filesystem: {
66+
class: external
67+
label: "Filesystem\n\nStores configuration and\nanimation frames"
68+
}
69+
70+
# Relationships
71+
user -> viz: "Views protocol\nbehavior"
72+
user -> filesystem: "Configures simulation\nparameters"
73+
74+
viz -> filesystem: "Reads config files and\nwrites animation frames"
75+
viz -> protocol-engine: "Visualizes protocol state"
76+
viz -> network: "Visualizes network state"
77+
viz -> monitor: "Displays metrics"
78+
79+
protocol-engine -> network: "Uses for message transport"
80+
protocol-engine -> monitor: "Emits protocol events"
81+
protocol-engine -> filesystem: "Reads protocol config"
82+
83+
network -> monitor: "Reports network metrics"
84+
85+
filesystem -> user: "Provides simulation\nresults"

simulation/docs/container.png

461 KB
Loading

0 commit comments

Comments
 (0)