Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/d2 delta q diagram #104

Merged
merged 11 commits into from
Dec 13, 2024
105 changes: 105 additions & 0 deletions delta_q/docs/overview.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
title: {
label: "delta-q - Component Diagram"
near: top-center
shape: text
style.font-size: 24
style.bold: true
}

# Styles
classes: {
component: {
style: {
stroke: "#2a2a2a"
fill: "#ffffff"
font-color: "#2a2a2a"
border-radius: 10
shadow: true
}
}
container: {
style: {
stroke: "#2a2a2a"
fill: "#f5f5f5"
font-color: "#2a2a2a"
border-radius: 10
shadow: true
}
}
subcomponent: {
style: {
stroke: "#666666"
fill: "#ffffff"
font-color: "#2a2a2a"
border-radius: 5
shadow: false
}
}
}

# Web Application Container
web-app: {
class: container
label: "Web Application"

editor: {
class: component
label: "Editor\n\nWeb-based editor for\nΔQ expressions"
}

visualizer: {
class: component
label: "Visualizer\n\nRenders CDFs and\nresource usage graphs"
}

storage: {
class: component
label: "Local Storage\n\nPersists expressions\nand models"
}
}

# Core Engine Container
core: {
class: container
label: "Core Engine"

parser: {
class: component
label: "Parser\n\nParses ΔQ expressions\nand metrics"
}

evaluator: {
class: component
label: "Evaluator\n\nComputes CDFs and\nresource metrics"
}

gossip: {
class: component
label: "Gossip Engine\n\nImplements gossip\noperator evaluation"
}
}

# Dependencies Container
deps: {
class: container
label: "Dependencies"

yew: {
class: component
label: "Yew Framework\n\nRust/WASM web\nframework"
}

wasm: {
class: component
label: "WASM Bindings\n\nWeb APIs and\nJavaScript interop"
}
}

# Relationships
web-app.editor -> core.parser: "Sends expressions"
web-app.editor -> web-app.storage: "Saves/loads"
web-app.visualizer -> core.evaluator: "Gets results"
core.parser -> core.evaluator: "Provides AST"
core.evaluator -> core.gossip: "Uses for gossip\noperations"
web-app -> deps.yew: "Built with"
deps.yew -> deps.wasm: "Uses"
Binary file added delta_q/docs/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
162 changes: 162 additions & 0 deletions simulation/docs/component.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
title: {
label: "ouroboros-leios-sim - Component Diagram"
near: top-center
shape: text
style.font-size: 24
style.bold: true
}

# Styles
classes: {
component: {
style: {
stroke: "#2a2a2a"
fill: "#ffffff"
font-color: "#2a2a2a"
border-radius: 10
shadow: true
}
}
container: {
style: {
stroke: "#2a2a2a"
fill: "#f5f5f5"
font-color: "#2a2a2a"
border-radius: 10
shadow: true
}
}
subcomponent: {
style: {
stroke: "#666666"
fill: "#ffffff"
font-color: "#2a2a2a"
border-radius: 5
shadow: false
}
}
}

# Protocol Engine Container
protocol-engine: {
class: container
label: "Protocol Engine"

praos: {
class: component
label: "Praos Protocol\n\nImplements core consensus\nand block chain"
}

leios: {
class: component
label: "Leios Protocol\n\nImplements input endorsement\nand ranking blocks"
}

relay: {
class: component
label: "Relay Protocol\n\nHandles block and vote\ndiffusion"
}

node-manager: {
class: component
label: "Node Manager\n\nManages node state and\nprotocol interactions"
}
}

# Channel Layer Container
channel-layer: {
class: container
label: "Channel Layer"

chan: {
class: component
label: "Generic Channel\n\nBase channel abstraction"
}

tcp: {
class: component
label: "TCP Channel\n\nSimulates TCP behavior"
}

mux: {
class: component
label: "Channel Multiplexer\n\nMultiplexes protocols"
}

driver: {
class: component
label: "Channel Driver\n\nManages protocol\nchannels"
}
}

# Visualization Engine Container
viz-engine: {
class: container
label: "Visualization Engine"

layout: {
class: component
label: "Layout Engine\n\nHandles visualization\nlayout"
}

relay-viz: {
class: component
label: "Relay Visualizer\n\nVisualizes relay\nprotocol state"
}

p2p-viz: {
class: component
label: "P2P Visualizer\n\nVisualizes P2P\nnetwork state"
}

frame-output: {
class: component
label: "Frame Output\n\nOutputs animation frames\nas PNG files"
}
}

# Event Monitor Container
monitor: {
class: container
label: "Event Monitor"

metrics: {
class: component
label: "Metrics Collector\n\nCollects in-memory\nperformance metrics"
}

tracer: {
class: component
label: "Event Tracer\n\nTraces protocol and\nnetwork events in memory"
}
}

# Core Layer Relationships
channel-layer.tcp -> channel-layer.chan: "Implements"
channel-layer.mux -> channel-layer.chan: "Uses"
channel-layer.driver -> channel-layer.chan: "Uses"
channel-layer.mux -> channel-layer.tcp: "Routes over"
channel-layer.driver -> channel-layer.mux: "Uses for routing"

# Protocol Layer Relationships
protocol-engine.relay -> channel-layer.driver: "Uses for messaging"
protocol-engine.praos -> channel-layer.driver: "Uses for consensus"
protocol-engine.leios -> protocol-engine.praos: "Extends consensus"
protocol-engine.leios -> protocol-engine.relay: "Uses for diffusion"
protocol-engine.node-manager -> channel-layer.driver: "Manages connections"

# Visualization Layer Relationships
viz-engine.relay-viz -> protocol-engine.relay: "Visualizes state"
viz-engine.p2p-viz -> channel-layer.tcp: "Visualizes network"
viz-engine.layout -> viz-engine.relay-viz: "Provides layout"
viz-engine.layout -> viz-engine.p2p-viz: "Provides layout"
viz-engine.frame-output -> viz-engine.relay-viz: "Captures frames"
viz-engine.frame-output -> viz-engine.p2p-viz: "Captures frames"

# Monitoring Relationships
monitor.metrics -> viz-engine.relay-viz: "Provides metrics"
monitor.metrics -> viz-engine.p2p-viz: "Provides metrics"
monitor.tracer -> channel-layer.tcp: "Traces network"
monitor.tracer -> protocol-engine.praos: "Traces consensus"
monitor.tracer -> protocol-engine.leios: "Traces protocol"
monitor.tracer -> protocol-engine.relay: "Traces diffusion"
Binary file added simulation/docs/component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions simulation/docs/container.d2
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
title: {
label: "ouroboros-leios-sim - Container Diagram"
near: top-center
shape: text
style.font-size: 24
style.bold: true
}

# Styles
classes: {
container: {
style: {
stroke: "#2a2a2a"
fill: "#f5f5f5"
font-color: "#2a2a2a"
border-radius: 10
shadow: true
}
}
external: {
style: {
stroke: "#2a2a2a"
fill: "#ffffff"
font-color: "#2a2a2a"
border-radius: 10
stroke-dash: 5
}
}
actor: {
style: {
stroke: "#2a2a2a"
fill: "#ffffff"
font-color: "#2a2a2a"
border-radius: 25
shadow: true
}
}
}

user: {
class: actor
label: "User\n\nSimulation operator"
}

protocol-engine: {
class: container
label: "Protocol Engine\n[Haskell]\n\nImplements Praos and\nLeios protocols"
}

network: {
class: container
label: "Channel Layer\n[Haskell]\n\nSimulates TCP connections\nand multiplexing"
}

monitor: {
class: container
label: "Event Monitor\n[Haskell]\n\nCollects in-memory metrics\nand traces events"
}

viz: {
class: container
label: "Visualization Engine\n[Haskell]\n\nRenders protocol and\nnetwork state"
}

filesystem: {
class: external
label: "Filesystem\n\nStores configuration and\nanimation frames"
}

# Relationships
user -> viz: "Views protocol\nbehavior"
user -> filesystem: "Configures simulation\nparameters"

viz -> filesystem: "Reads config files and\nwrites animation frames"
viz -> protocol-engine: "Visualizes protocol state"
viz -> network: "Visualizes network state"
viz -> monitor: "Displays metrics"

protocol-engine -> network: "Uses for message transport"
protocol-engine -> monitor: "Emits protocol events"
protocol-engine -> filesystem: "Reads protocol config"

network -> monitor: "Reports network metrics"

filesystem -> user: "Provides simulation\nresults"
Binary file added simulation/docs/container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.