# vsc-eco/go-vsc-node architecture

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

- Interactive diagram: https://gitdiagram.com/vsc-eco/go-vsc-node
- Repository: https://github.com/vsc-eco/go-vsc-node

## Overview

VSC Node is the operational core of a blockchain network. Its principal workflow is to ingest Hive blocks, process network state and transactions, and expose node data through GraphQL; the node entry point also initializes persistence and peer networking. The repository includes distinct consensus, transaction, contract/WASM, oracle, and threshold-signing capabilities. The excerpts show startup wiring, but not most runtime calls between those subsystems, so those connections are omitted rather than inferred.

Main entry points: [`cmd/vsc-node/main.go`](https://github.com/vsc-eco/go-vsc-node/blob/main/cmd/vsc-node/main.go) (Node startup), [`modules/state-processing/state_engine.go`](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/state-processing/state_engine.go) (State processing), [`modules/hive/streamer/streamer.go`](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/hive/streamer/streamer.go) (Block ingestion), [`modules/p2p/libp2p.go`](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/p2p/libp2p.go) (Peer networking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Node Runtime"]
  node_node_entry["Node startup<br/>[main.go]"]
  node_aggregate["Plugin lifecycle<br/>[aggregate.go]"]
  node_gql["GraphQL API<br/>[gql.go]"]
end

subgraph group_consensus["Consensus and State"]
  node_state_engine["State processing<br/>[state_engine.go]"]
  node_block_producer["Block producer<br/>[blockProducer.go]"]
  node_election["Election proposer"]
  node_ledger["Ledger system<br/>[ledger_session.go]"]
  node_pendulum["Pendulum incentives<br/>[applier.go]"]
end

subgraph group_execution["Transactions and Contracts"]
  node_tx_pool["Transaction crafting<br/>[crafter.go]"]
  node_contract_runtime["Contract execution"]
  node_wasm["WASM runtime<br/>[runtime.go]"]
end

subgraph group_network["Network Services"]
  node_p2p["Peer networking<br/>[libp2p.go]"]
  node_announcements["Network announcements<br/>[announcements.go]"]
  node_tss["Threshold signing<br/>[tss.go]"]
  node_gateway["Gateway multisig<br/>[multisig.go]"]
end

subgraph group_data["External Data"]
  node_block_ingest["Block ingestion<br/>[streamer.go]"]
  node_haf_source["HAF source<br/>[source.go]"]
  node_database[("VSC database<br/>[vsc.go]")]
  node_oracle["Oracle services<br/>[oracle.go]"]
  node_availability["Data availability"]
end

node_operator(("Node operator"))
node_hive(("Hive network"))
node_api_client(("API client"))

node_operator -->|"starts"| node_node_entry
node_node_entry -->|"initializes"| node_database
node_node_entry -->|"configures"| node_block_ingest
node_node_entry -->|"initializes"| node_p2p
node_node_entry -->|"initializes"| node_announcements
node_node_entry -->|"initializes"| node_wasm
node_node_entry -->|"runs"| node_aggregate
node_hive -.->|"supplies blocks"| node_block_ingest
node_api_client -->|"queries"| node_gql
node_block_ingest -.->|"feeds blocks"| node_state_engine
node_state_engine -.->|"persists state"| node_database
node_block_producer -.->|"proposes state"| node_state_engine
node_election -.->|"selects producers"| node_block_producer
node_state_engine -.->|"updates balances"| node_ledger
node_tx_pool -.->|"submits calls"| node_contract_runtime
node_contract_runtime -.->|"executes code"| node_wasm
node_haf_source -.->|"supplies blocks"| node_block_ingest
node_oracle -.->|"provides observations"| node_state_engine
node_pendulum -.->|"applies incentives"| node_state_engine
node_tss -.->|"communicates over"| node_p2p
node_gateway -.->|"communicates over"| node_p2p
node_availability -.->|"serves data over"| node_p2p

click node_node_entry "https://github.com/vsc-eco/go-vsc-node/blob/main/cmd/vsc-node/main.go"
click node_aggregate "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/aggregate/aggregate.go"
click node_block_ingest "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/hive/streamer/streamer.go"
click node_haf_source "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/haf/source.go"
click node_database "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/db/vsc/vsc.go"
click node_state_engine "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/state-processing/state_engine.go"
click node_block_producer "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/block-producer/blockProducer.go"
click node_election "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/election-proposer/election-proposer.go"
click node_ledger "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/ledger-system/ledger_session.go"
click node_tx_pool "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/transaction-pool/crafter.go"
click node_contract_runtime "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/contract/execution-context/execution-context.go"
click node_wasm "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/wasm/runtime/runtime.go"
click node_gql "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/gql/gql.go"
click node_p2p "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/p2p/libp2p.go"
click node_announcements "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/announcements/announcements.go"
click node_tss "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/tss/tss.go"
click node_gateway "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/gateway/multisig.go"
click node_oracle "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/oracle/oracle.go"
click node_pendulum "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/incentive-pendulum/wasm/applier.go"
click node_availability "https://github.com/vsc-eco/go-vsc-node/blob/main/modules/data-availability/server/data-availability.go"

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_node_entry,node_aggregate,node_gql,node_api_client toneBlue
class node_state_engine,node_block_producer,node_election,node_ledger,node_pendulum toneAmber
class node_tx_pool,node_contract_runtime,node_wasm toneMint
class node_p2p,node_announcements,node_tss,node_gateway toneRose
class node_block_ingest,node_haf_source,node_database,node_oracle,node_availability,node_operator,node_hive toneIndigo
```

## Components

### Node Runtime

- [Node startup](https://github.com/vsc-eco/go-vsc-node/blob/main/cmd/vsc-node/main.go): `cmd/vsc-node/main.go`
- [Plugin lifecycle](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/aggregate/aggregate.go): `modules/aggregate/aggregate.go`
- [GraphQL API](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/gql/gql.go): `modules/gql/gql.go`

### Consensus and State

- [State processing](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/state-processing/state_engine.go): `modules/state-processing/state_engine.go`
- [Block producer](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/block-producer/blockProducer.go): `modules/block-producer/blockProducer.go`
- [Election proposer](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/election-proposer/election-proposer.go): `modules/election-proposer/election-proposer.go`
- [Ledger system](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/ledger-system/ledger_session.go): `modules/ledger-system/ledger_session.go`
- [Pendulum incentives](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/incentive-pendulum/wasm/applier.go): `modules/incentive-pendulum/wasm/applier.go`

### Transactions and Contracts

- [Transaction crafting](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/transaction-pool/crafter.go): `modules/transaction-pool/crafter.go`
- [Contract execution](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/contract/execution-context/execution-context.go): `modules/contract/execution-context/execution-context.go`
- [WASM runtime](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/wasm/runtime/runtime.go): `modules/wasm/runtime/runtime.go`

### Network Services

- [Peer networking](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/p2p/libp2p.go): `modules/p2p/libp2p.go`
- [Network announcements](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/announcements/announcements.go): `modules/announcements/announcements.go`
- [Threshold signing](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/tss/tss.go): `modules/tss/tss.go`
- [Gateway multisig](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/gateway/multisig.go): `modules/gateway/multisig.go`

### External Data

- [Block ingestion](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/hive/streamer/streamer.go): `modules/hive/streamer/streamer.go`
- [HAF source](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/haf/source.go): `modules/haf/source.go`
- [VSC database](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/db/vsc/vsc.go): `modules/db/vsc/vsc.go`
- [Oracle services](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/oracle/oracle.go): `modules/oracle/oracle.go`
- [Data availability](https://github.com/vsc-eco/go-vsc-node/blob/main/modules/data-availability/server/data-availability.go): `modules/data-availability/server/data-availability.go`

### Other components

- **Node operator**
- **Hive network**
- **API client**

## Connections

- Node operator → Node startup: starts (evidence: `cmd/vsc-node/main.go`)
- Node startup → VSC database: initializes (evidence: `cmd/vsc-node/main.go`)
- Node startup → Block ingestion: configures (evidence: `cmd/vsc-node/main.go`)
- Node startup → Peer networking: initializes (evidence: `cmd/vsc-node/main.go`)
- Node startup → Network announcements: initializes (evidence: `cmd/vsc-node/main.go`)
- Node startup → WASM runtime: initializes (evidence: `cmd/vsc-node/main.go`)
- Node startup → Plugin lifecycle: runs (evidence: `cmd/vsc-node/main.go`)
- Hive network → Block ingestion: supplies blocks
- API client → GraphQL API: queries (evidence: `README.md`)
- Block ingestion → State processing: feeds blocks
- State processing → VSC database: persists state
- Block producer → State processing: proposes state
- Election proposer → Block producer: selects producers
- State processing → Ledger system: updates balances
- Transaction crafting → Contract execution: submits calls
- Contract execution → WASM runtime: executes code
- HAF source → Block ingestion: supplies blocks
- Oracle services → State processing: provides observations
- Pendulum incentives → State processing: applies incentives
- Threshold signing → Peer networking: communicates over
- Gateway multisig → Peer networking: communicates over
- Data availability → Peer networking: serves data over
