# gnolang/gno architecture

> Architecture diagram of the GitHub repository gnolang/gno, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gnolang/gno
- Repository: https://github.com/gnolang/gno

## Overview

##### High-Level Architecture Components

The system should be divided into three main layers:

a. Core Components:
- GnoVM (Gno Virtual Machine)
- Tendermint2 (Consensus Engine)
- Gno.land Blockchain
- Smart Contract Layer

b. Development Tools:
- Command-line Tools (gnokey, gnoland, gnoweb)
- Developer Tools (gno CLI, goscan, genproto)
- Gno Playground

c. Supporting Infrastructure:
- Documentation System
- Testing Framework
- Package Management

##### Component Relationships

**[User/Developer Interface Layer]**
- Gno Playground (Web Interface)
- CLI Tools

- v
**[Application Layer]**
- Smart Contracts
- Package Management
- Authentication/Keys

- v
**[Core Layer]**
- GnoVM
- Tendermint2
- State Management

- v
**[Storage Layer]**
- IAVL Tree
- Database

##### Key Technical Elements

a. GnoVM Section:
- Interpreter
- Package System
- Standard Library
- Type System

b. Blockchain Section:
- Consensus Engine (Tendermint2)
- State Machine
- Transaction Processing
- P2P Network

c. Development Tools Section:
- CLI Tools
- Web Interface
- Package Management
- Testing Framework

##### Specific Implementation Details

Directories and their purposes:
- /gnovm - Virtual Machine Implementation
- /gno.land - Blockchain Implementation
- /tm2 - Tendermint2 Consensus Engine
- /examples - Smart Contract Examples
- /docs - Documentation System
- /contribs - Enhanced Tools

##### Data Flow Indicators

Show:
- Smart Contract Deployment Flow
- Transaction Processing Flow
- State Updates
- P2P Communication
- Client-Node Interactions

##### Integration Points

Highlight:
- API Endpoints
- IPC Mechanisms
- External Service Connections
- Tool Integration Points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#2374ab,color:#fff
    classDef tools fill:#7dba84,color:#000
    classDef contract fill:#ff8c42,color:#000
    classDef infra fill:#95a5a6,color:#000
    classDef interface fill:#f1c40f,color:#000

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Development Tools]:::tools
        L3[Smart Contracts]:::contract
        L4[Infrastructure]:::infra
        L5[Interfaces]:::interface
    end

    %% User/Developer Interface Layer
    subgraph "Interface Layer"
        UI[Gno Playground]:::interface
        CLI["Command-line Tools"]:::interface
        DevTools["Developer Tools"]:::interface
    end

    %% Development Tools Details
    subgraph "Development Tools"
        GnoKey["gnokey"]:::tools
        GnoLand["gnoland"]:::tools
        GnoWeb["gnoweb"]:::tools
        GnoCLI["gno CLI"]:::tools
        GoScan["goscan"]:::tools
        GenProto["genproto"]:::tools
    end

    %% Application Layer
    subgraph "Application Layer"
        SmartContracts["Smart Contracts"]:::contract
        PackageManagement["Package Management"]:::tools
        Authentication["Authentication/Keys"]:::core
        ClientSDK["Client SDK"]:::tools
    end

    %% Core Layer
    subgraph "Core Layer"
        GnoVM["GnoVM"]:::core
        Tendermint["Tendermint2"]:::core
        StateManagement["State Management"]:::core
    end

    %% VM Components
    subgraph "GnoVM Components"
        Interpreter["Interpreter"]:::core
        PackageSystem["Package System"]:::core
        StdLib["Standard Library"]:::core
        TypeSystem["Type System"]:::core
    end

    %% Storage Layer
    subgraph "Storage Layer"
        IAVL["IAVL Tree"]:::infra
        DB["Database"]:::infra
    end

    %% Supporting Infrastructure
    subgraph "Infrastructure"
        Docs["Documentation"]:::infra
        Tests["Testing Framework"]:::infra
    end

    %% Relationships
    UI --> SmartContracts
    CLI --> SmartContracts
    DevTools --> SmartContracts
    SmartContracts --> GnoVM
    GnoVM --> StateManagement
    StateManagement --> IAVL
    IAVL --> DB
    Tendermint --> StateManagement
    PackageManagement --> GnoVM
    Authentication --> StateManagement

    %% Click Events
    click GnoVM "https://github.com/gnolang/gno/tree/master/gnovm/"
    click Tendermint "https://github.com/gnolang/gno/tree/master/tm2/"
    click SmartContracts "https://github.com/gnolang/gno/tree/master/examples/gno.land/"
    click GnoKey "https://github.com/gnolang/gno/tree/master/gno.land/cmd/gnokey/"
    click GnoLand "https://github.com/gnolang/gno/tree/master/gno.land/cmd/gnoland/"
    click GnoWeb "https://github.com/gnolang/gno/tree/master/gno.land/cmd/gnoweb/"
    click GnoCLI "https://github.com/gnolang/gno/tree/master/gnovm/cmd/gno/"
    click GoScan "https://github.com/gnolang/gno/tree/master/misc/goscan/"
    click GenProto "https://github.com/gnolang/gno/tree/master/misc/genproto/"
    click Docs "https://github.com/gnolang/gno/tree/master/docs/"
    click Tests "https://github.com/gnolang/gno/tree/master/gnovm/tests/"
    click PackageManagement "https://github.com/gnolang/gno/tree/master/gnovm/pkg/gnomod/"
    click StdLib "https://github.com/gnolang/gno/tree/master/gnovm/stdlibs/"
    click ClientSDK "https://github.com/gnolang/gno/tree/master/gno.land/pkg/gnoclient/"
```
