Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
docs: WIP add Node architecture overview
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelstanley committed Jun 19, 2023
1 parent 40aa6af commit bc80e47
Showing 1 changed file with 133 additions and 1 deletion.
134 changes: 133 additions & 1 deletion offchain/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,138 @@
# Cartesi Node Reference Implementation

This file is a work in progress. It will soon document how to build, test and overall handle a Cartesi Node.
## Architecture

### Reader Data Flow

```mermaid
flowchart LR
A[State-fold Server] -->|Inputs via dispatcher/broker/proxy| B[Server Manager]
A -->|Inputs| C[Indexer]
B -->|Outputs| C
C -->|Inputs/Outputs| D[(PostgreSQL)]
D -->|Inputs/Outputs| E[Reader - Query Server/GraphQL API]
E -->|Inputs/Outputs| F[Frontend]
```

### Inspect Data Flow

```mermaid
flowchart LR
A[State-fold Server] -->|Inputs via dispatcher/broker/proxy| B[Server Manager]
C[Frontend] -->|Inspect Request| D[Inspect Server]
D -->|Inspect Request| B
B -->|Inspect Response| E[Inspect Server]
E -->|Inspect Response| F[Frontend]
```

### Validator Data Flow

```mermaid
flowchart LR
A[State-fold Server] -->|Inputs| B[Dispatcher]
B -->|Inputs| C(rollups-input-stream)
C -->|Inputs| D[ServerManagerBrokerProxy]
D -->|Inputs| E[ServerManager]
E -->|Claims| F[ServerManagerBrokerProxy]
F -->|Claims| G[Dispatcher]
```

### Indexer consuming from Broker

```mermaid
flowchart
direction LR
subgraph validator
a1[Dispatcher]-->|gRPC| a2[State-fold Server]
end
subgraph "Broker (Redis)"
b1[rollups-inputs-stream]
b2[rollups-claims-stream]
b3[rollups-outputs-stream]
end
subgraph server-manager
c1[Advance Runner]-->|gRPC| c2[Server Manager]
c3[Indexer]
end
d1[("Snapshot Repository (filesystem)")]
d2[(PostgreSQL)]
subgraph endpoints
e1[Inspect Server]
e2[GraphQL Server]
end
subgraph internet
f1[Frontend]
end
a1 -->|Inputs| b1
b2 -->|Outputs| a2
b1 -->|Consume| c1
b1 -->|Consume| c3
b3 -->|Consume| c3
c1 -->|Produce| b2
c1 -->|Produce| b3
c1 -->|Manage| d1
c2 -->|Load/Store| d1
e1 -->|gRPC| c2
c3 -->|Write inputs and outputs| d2
e2 -->|Read| d2
f1 -->|HTTP Inspect| e1
f1 -->|GraphQL API| e2
```

### Host mode

```mermaid
flowchart
direction LR
subgraph validator
a1[Dispatcher]-->|gRPC| a2[State-fold Server]
end
subgraph "Broker (Redis)"
b1[rollups-inputs-stream]
b2[rollups-claims-stream]
b3[rollups-outputs-stream]
end
subgraph server-manager
c1[Advance Runner]-->|gRPC| c2[Host Server Manager]
c3[Indexer]
end
d1[(PostgreSQL)]
subgraph endpoints
e1[Inspect Server]
e2[GraphQL Server]
end
subgraph host
f1[DApp Backend]
f2[Frontend]
end
a1 -->|Inputs| b1
b2 -->|Outputs| a2
b1 -->|Consume| c1
b1 -->|Consume| c3
b3 -->|Consume| c3
c1 -->|Produce| b2
c1 -->|Produce| b3
f1 -->|HTTP API| c2
e1 -->|gRPC| c2
c3 -->|Write inputs and outputs| d1
e2 -->|Read| d1
f2 -->|HTTP Inspect| e1
f2 -->|GraphQL API| e2
```

## Redis TLS Configuration

Expand Down

0 comments on commit bc80e47

Please sign in to comment.