# vitreus-foundation/power-plant architecture

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

- Interactive diagram: https://gitdiagram.com/vitreus-foundation/power-plant
- Repository: https://github.com/vitreus-foundation/power-plant

## Overview

Vitreus is a Polkadot-SDK relay-chain node with a custom runtime and Frontier EVM support. The main workflow is an operator launching the node, which exposes RPC for wallets and applications to submit transactions and inspect chain state. Runtime pallets provide token claims, VNRG fee handling and exchange, energy generation, governance, membership and NFT features. RPC also exposes broker, fee, generation, NFT, node and Ethereum methods. The node/service and runtime internals are only partly sampled, so uncertain wiring is omitted; documented capabilities are retained as distinct subsystems.

Main entry points: [`runtime/vitreus/src/lib.rs`](https://github.com/vitreus-foundation/power-plant/blob/main/runtime/vitreus/src/lib.rs) (Vitreus runtime), [`rpc/src/lib.rs`](https://github.com/vitreus-foundation/power-plant/blob/main/rpc/src/lib.rs) (RPC server), [`src/main.rs`](https://github.com/vitreus-foundation/power-plant/blob/main/src/main.rs) (Node binary), [`cli/src/cli.rs`](https://github.com/vitreus-foundation/power-plant/blob/main/cli/src/cli.rs) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_node["Node and RPC"]
  node_node_bin["Node binary<br/>[main.rs]"]
  node_cli["CLI<br/>[cli.rs]"]
  node_chain_spec["Chain spec<br/>[lib.rs]"]
  node_service["Node service<br/>[lib.rs]"]
  node_rpc["RPC server<br/>[lib.rs]"]
  node_eth_rpc["Ethereum RPC<br/>[eth.rs]"]
  node_broker_rpc["Broker RPC<br/>[lib.rs]"]
  node_fee_rpc["Fee RPC<br/>[lib.rs]"]
  node_generation_rpc["Generation RPC<br/>[lib.rs]"]
  node_nft_rpc["NFT RPC<br/>[lib.rs]"]
end

subgraph group_runtime["Chain runtime"]
  node_runtime["Vitreus runtime<br/>[lib.rs]"]
  node_precompiles["EVM precompiles<br/>[precompiles.rs]"]
end

subgraph group_energy["Energy economy"]
  node_broker["Energy broker<br/>[lib.rs]"]
  node_energy_fee["Energy fees<br/>[lib.rs]"]
  node_dynamic_energy["Dynamic energy<br/>[lib.rs]"]
  node_generation["Energy generation<br/>[impls.rs]"]
end

subgraph group_features["Chain features"]
  node_claiming["Token claims<br/>[lib.rs]"]
  node_governance["Governance extensions<br/>[impls.rs]"]
  node_treasury["Treasury extension<br/>[lib.rs]"]
  node_membership["VIP privileges<br/>[lib.rs]"]
  node_reputation["Reputation<br/>[impls.rs]"]
  node_nac["NAC NFTs<br/>[lib.rs]"]
  node_vesting["Simple vesting<br/>[lib.rs]"]
  node_faucet["Faucet<br/>[lib.rs]"]
end

node_operator(("Operator"))
node_wallet(("Wallet or app"))

node_operator -->|"launches"| node_node_bin
node_node_bin -.->|"starts CLI"| node_cli
node_cli -->|"exports service"| node_service
node_service -.->|"uses chain spec"| node_chain_spec
node_wallet -->|"calls RPC"| node_rpc
node_rpc -->|"registers"| node_broker_rpc
node_rpc -->|"registers"| node_fee_rpc
node_rpc -->|"registers"| node_generation_rpc
node_rpc -->|"registers"| node_nft_rpc
node_rpc -->|"creates Ethereum RPC"| node_eth_rpc
node_runtime -->|"provides exchange"| node_broker
node_runtime -->|"provides fees"| node_energy_fee
node_runtime -.->|"configures EVM"| node_precompiles
node_broker -->|"sells fee token"| node_energy_fee
node_runtime -.->|"includes pallet"| node_dynamic_energy
node_runtime -.->|"includes pallet"| node_generation
node_runtime -.->|"includes pallet"| node_claiming
node_runtime -.->|"includes pallet"| node_governance
node_runtime -.->|"includes pallet"| node_treasury
node_runtime -.->|"includes pallet"| node_membership
node_runtime -.->|"includes pallet"| node_reputation
node_runtime -.->|"includes pallet"| node_nac
node_runtime -.->|"includes pallet"| node_vesting
node_runtime -.->|"includes pallet"| node_faucet

click node_node_bin "https://github.com/vitreus-foundation/power-plant/blob/main/src/main.rs"
click node_cli "https://github.com/vitreus-foundation/power-plant/blob/main/cli/src/cli.rs"
click node_chain_spec "https://github.com/vitreus-foundation/power-plant/blob/main/node/chain-spec/src/lib.rs"
click node_service "https://github.com/vitreus-foundation/power-plant/blob/main/node/service/src/lib.rs"
click node_rpc "https://github.com/vitreus-foundation/power-plant/blob/main/rpc/src/lib.rs"
click node_eth_rpc "https://github.com/vitreus-foundation/power-plant/blob/main/rpc/src/eth.rs"
click node_broker_rpc "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-broker/rpc/src/lib.rs"
click node_fee_rpc "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-fee/rpc/src/lib.rs"
click node_generation_rpc "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-generation/rpc/src/lib.rs"
click node_nft_rpc "https://github.com/vitreus-foundation/power-plant/blob/main/rpc/nfts-rpc/src/lib.rs"
click node_runtime "https://github.com/vitreus-foundation/power-plant/blob/main/runtime/vitreus/src/lib.rs"
click node_precompiles "https://github.com/vitreus-foundation/power-plant/blob/main/runtime/vitreus/src/precompiles.rs"
click node_broker "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-broker/src/lib.rs"
click node_energy_fee "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-fee/src/lib.rs"
click node_dynamic_energy "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/dynamic-energy/src/lib.rs"
click node_generation "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-generation/src/pallet/impls.rs"
click node_claiming "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/claiming/src/lib.rs"
click node_governance "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/democracy-extension/src/impls.rs"
click node_treasury "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/treasury-extension/src/lib.rs"
click node_membership "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/privileges/src/lib.rs"
click node_reputation "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/reputation/src/pallet/impls.rs"
click node_nac "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/nac-managing/src/lib.rs"
click node_vesting "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/simple-vesting/src/lib.rs"
click node_faucet "https://github.com/vitreus-foundation/power-plant/blob/main/pallets/faucet/src/lib.rs"

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_bin,node_cli,node_chain_spec,node_service,node_rpc,node_eth_rpc,node_broker_rpc,node_fee_rpc,node_generation_rpc,node_nft_rpc toneBlue
class node_runtime,node_precompiles toneAmber
class node_broker,node_energy_fee,node_dynamic_energy,node_generation toneMint
class node_claiming,node_governance,node_treasury,node_membership,node_reputation,node_nac,node_vesting,node_faucet toneRose
class node_operator,node_wallet toneIndigo
```

## Components

### Node and RPC

- [Node binary](https://github.com/vitreus-foundation/power-plant/blob/main/src/main.rs): `src/main.rs`
- [CLI](https://github.com/vitreus-foundation/power-plant/blob/main/cli/src/cli.rs): `cli/src/cli.rs`
- [Chain spec](https://github.com/vitreus-foundation/power-plant/blob/main/node/chain-spec/src/lib.rs): `node/chain-spec/src/lib.rs`
- [Node service](https://github.com/vitreus-foundation/power-plant/blob/main/node/service/src/lib.rs): `node/service/src/lib.rs`
- [RPC server](https://github.com/vitreus-foundation/power-plant/blob/main/rpc/src/lib.rs): `rpc/src/lib.rs`
- [Ethereum RPC](https://github.com/vitreus-foundation/power-plant/blob/main/rpc/src/eth.rs): `rpc/src/eth.rs`
- [Broker RPC](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-broker/rpc/src/lib.rs): `pallets/energy-broker/rpc/src/lib.rs`
- [Fee RPC](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-fee/rpc/src/lib.rs): `pallets/energy-fee/rpc/src/lib.rs`
- [Generation RPC](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-generation/rpc/src/lib.rs): `pallets/energy-generation/rpc/src/lib.rs`
- [NFT RPC](https://github.com/vitreus-foundation/power-plant/blob/main/rpc/nfts-rpc/src/lib.rs): `rpc/nfts-rpc/src/lib.rs`

### Chain runtime

- [Vitreus runtime](https://github.com/vitreus-foundation/power-plant/blob/main/runtime/vitreus/src/lib.rs): `runtime/vitreus/src/lib.rs`
- [EVM precompiles](https://github.com/vitreus-foundation/power-plant/blob/main/runtime/vitreus/src/precompiles.rs): `runtime/vitreus/src/precompiles.rs`

### Energy economy

- [Energy broker](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-broker/src/lib.rs): `pallets/energy-broker/src/lib.rs`
- [Energy fees](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-fee/src/lib.rs): `pallets/energy-fee/src/lib.rs`
- [Dynamic energy](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/dynamic-energy/src/lib.rs): `pallets/dynamic-energy/src/lib.rs`
- [Energy generation](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/energy-generation/src/pallet/impls.rs): `pallets/energy-generation/src/pallet/impls.rs`

### Chain features

- [Token claims](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/claiming/src/lib.rs): `pallets/claiming/src/lib.rs`
- [Governance extensions](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/democracy-extension/src/impls.rs): `pallets/democracy-extension/src/impls.rs`
- [Treasury extension](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/treasury-extension/src/lib.rs): `pallets/treasury-extension/src/lib.rs`
- [VIP privileges](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/privileges/src/lib.rs): `pallets/privileges/src/lib.rs`
- [Reputation](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/reputation/src/pallet/impls.rs): `pallets/reputation/src/pallet/impls.rs`
- [NAC NFTs](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/nac-managing/src/lib.rs): `pallets/nac-managing/src/lib.rs`
- [Simple vesting](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/simple-vesting/src/lib.rs): `pallets/simple-vesting/src/lib.rs`
- [Faucet](https://github.com/vitreus-foundation/power-plant/blob/main/pallets/faucet/src/lib.rs): `pallets/faucet/src/lib.rs`

### Other components

- **Operator**
- **Wallet or app**

## Connections

- Operator → Node binary: launches
- Node binary → CLI: starts CLI
- CLI → Node service: exports service
- Node service → Chain spec: uses chain spec
- Wallet or app → RPC server: calls RPC
- RPC server → Broker RPC: registers (evidence: `rpc/src/lib.rs`)
- RPC server → Fee RPC: registers (evidence: `rpc/src/lib.rs`)
- RPC server → Generation RPC: registers (evidence: `rpc/src/lib.rs`)
- RPC server → NFT RPC: registers (evidence: `rpc/src/lib.rs`)
- RPC server → Ethereum RPC: creates Ethereum RPC (evidence: `rpc/src/lib.rs`)
- Vitreus runtime → Energy broker: provides exchange
- Vitreus runtime → Energy fees: provides fees
- Vitreus runtime → EVM precompiles: configures EVM (evidence: `runtime/vitreus/src/lib.rs`)
- Energy broker → Energy fees: sells fee token
- Vitreus runtime → Dynamic energy: includes pallet
- Vitreus runtime → Energy generation: includes pallet
- Vitreus runtime → Token claims: includes pallet
- Vitreus runtime → Governance extensions: includes pallet
- Vitreus runtime → Treasury extension: includes pallet
- Vitreus runtime → VIP privileges: includes pallet
- Vitreus runtime → Reputation: includes pallet
- Vitreus runtime → NAC NFTs: includes pallet
- Vitreus runtime → Simple vesting: includes pallet
- Vitreus runtime → Faucet: includes pallet
