# hyperliquid-dex/node architecture

> Architecture diagram of the GitHub repository hyperliquid-dex/node, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hyperliquid-dex/node
- Repository: https://github.com/hyperliquid-dex/node

## Overview

This repository supports operating a Hyperliquid node; its README describes the node workflow, while the tree also includes a scheduled data-pruning component. The principal workflow is to configure a chain, obtain the visor binary, and run it to start a node that streams network data. Operators can enable file outputs and local RPC/info services. The repository does not include the visor or node implementation, and no source excerpts were supplied, so internal runtime calls cannot be mapped. The pruning schedule-to-script link is inferred from filenames and shown as unverified.

Main entry points: [`pruner/cron/cron.d/prune`](https://github.com/hyperliquid-dex/node/blob/main/pruner/cron/cron.d/prune) (Prune schedule), [`pruner/scripts/prune.sh`](https://github.com/hyperliquid-dex/node/blob/main/pruner/scripts/prune.sh) (Prune script)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operation["Node operation"]
  node_chain_config["Chain configuration"]
  node_visor["Visor binary"]
  node_node["Hyperliquid node"]
end

subgraph group_outputs["Data outputs"]
  node_l1_data[("L1 data files")]
  node_state_snapshots[("State snapshots")]
  node_optional_outputs[("Optional event files")]
  node_replica_cmds[("Replica commands")]
end

subgraph group_interfaces["Local interfaces"]
  node_eth_rpc["EVM JSON-RPC"]
  node_info_server["Info server"]
end

subgraph group_pruning["Data pruning"]
  node_prune_schedule["Prune schedule<br/>[prune]"]
  node_prune_script["Prune script<br/>[prune.sh]"]
end

node_operator(("Node operator"))
node_peer_network(("P2P peers"))

node_operator -->|"configures chain"| node_chain_config
node_operator -->|"downloads and runs"| node_visor
node_visor -->|"spawns process"| node_node
node_node -->|"streams from peers"| node_peer_network
node_node -->|"writes transaction blocks"| node_l1_data
node_node -->|"writes snapshots"| node_state_snapshots
node_node -->|"writes enabled event data"| node_optional_outputs
node_node -->|"writes replica commands"| node_replica_cmds
node_node -->|"serves when enabled"| node_eth_rpc
node_node -->|"serves when enabled"| node_info_server
node_prune_schedule -.->|"likely schedules"| node_prune_script

click node_prune_schedule "https://github.com/hyperliquid-dex/node/blob/main/pruner/cron/cron.d/prune"
click node_prune_script "https://github.com/hyperliquid-dex/node/blob/main/pruner/scripts/prune.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chain_config,node_visor,node_node toneBlue
class node_l1_data,node_state_snapshots,node_optional_outputs,node_replica_cmds toneAmber
class node_eth_rpc,node_info_server toneMint
class node_prune_schedule,node_prune_script toneRose
class node_operator,node_peer_network toneIndigo
```

## Components

### Node operation

- **Chain configuration**
- **Visor binary**
- **Hyperliquid node**

### Data outputs

- **L1 data files**
- **State snapshots**
- **Optional event files**
- **Replica commands**

### Local interfaces

- **EVM JSON-RPC**
- **Info server**

### Data pruning

- [Prune schedule](https://github.com/hyperliquid-dex/node/blob/main/pruner/cron/cron.d/prune): `pruner/cron/cron.d/prune`
- [Prune script](https://github.com/hyperliquid-dex/node/blob/main/pruner/scripts/prune.sh): `pruner/scripts/prune.sh`

### Other components

- **Node operator**
- **P2P peers**

## Connections

- Node operator → Chain configuration: configures chain (evidence: `README.md`)
- Node operator → Visor binary: downloads and runs (evidence: `README.md`)
- Visor binary → Hyperliquid node: spawns process (evidence: `README.md`)
- Hyperliquid node → P2P peers: streams from peers (evidence: `README.md`)
- Hyperliquid node → L1 data files: writes transaction blocks (evidence: `README.md`)
- Hyperliquid node → State snapshots: writes snapshots (evidence: `README.md`)
- Hyperliquid node → Optional event files: writes enabled event data (evidence: `README.md`)
- Hyperliquid node → Replica commands: writes replica commands (evidence: `README.md`)
- Hyperliquid node → EVM JSON-RPC: serves when enabled (evidence: `README.md`)
- Hyperliquid node → Info server: serves when enabled (evidence: `README.md`)
- Prune schedule → Prune script: likely schedules
