# warden-protocol/wardenprotocol architecture

> Architecture diagram of the GitHub repository warden-protocol/wardenprotocol, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/warden-protocol/wardenprotocol
- Repository: https://github.com/warden-protocol/wardenprotocol

## Overview

##### Main Components

a. Core Protocol Layer:
- Warden Chain (Cosmos SDK-based blockchain)
- Smart Contract Layer (including EVM compatibility)
- Protocol Modules (x/warden, x/act, x/async, x/gmp)

b. Client Applications:
- SpaceWard (Web Interface)
- Automated Orders System
- CLI Tools (wardend, wardenkms)

c. Development & Integration:
- API Layer (REST/gRPC)
- Client SDKs (wardenjs, go-client)
- Smart Contract Integration

##### Architectural Layers

**┌─ Application Layer ─────────────────────┐**
- SpaceWard UI | Automated Orders | Tools │
- Integration Layer ────────────────────┐│
- WardenJS SDK | Go Client | REST/gRPC  ││
- Protocol Core ─────────────────────┐ ││
- Modules | Smart Contracts | Chain   │ ││
- Infrastructure ──────────────────┐ │ ││
- Cosmos SDK | Tendermint | EVM    │ │ ││
- ┘─┘─┘┘

##### Key Relationships to Highlight

a. Module Interactions:
- GMP (General Message Passing) interactions
- Smart contract integration points

b. Client-Protocol Communication:
- API endpoints and SDK connections
- Authentication and signature flows
- Precompile interfaces

##### Implementation Details

Use these symbols:
- Hexagons for modules
- Rectangles for applications
- Diamonds for decision points

##### Additional Elements

Include:
- Version information
- Protocol boundaries
- External service connections
- Monitoring points
- Error handling paths

##### Notes

Annotations for:
- Critical paths
- Security considerations
- Scaling points
- Future expansion areas

This architectural representation will serve as a crucial reference for understanding the system's structure and interactions, facilitating both development and maintenance activities.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef frontend fill:#a8e6cf,stroke:#3b6978
    classDef backend fill:#dcedc1,stroke:#3b6978
    classDef protocol fill:#ffd3b6,stroke:#3b6978
    classDef infrastructure fill:#ffaaa5,stroke:#3b6978
    classDef api fill:#98c1d9,stroke:#3b6978
    classDef storage fill:#ddd,stroke:#3b6978
    classDef testing fill:#e6e6e6,stroke:#3b6978
    classDef docs fill:#f7f7f7,stroke:#3b6978

    subgraph Application
        UI[SpaceWard UI]:::frontend
        AOS[Automated Orders System]:::frontend
        CLI[CLI Tools]:::frontend
    end

    subgraph Integration
        JSDK[WardenJS SDK]:::api
        GoSDK[Go Client SDK]:::api
        API[REST/gRPC API]:::api
    end

    subgraph Core
        WMOD[x/warden Module]:::protocol
        AMOD[x/act Module]:::protocol
        ASMOD[x/async Module]:::protocol
        GMOD[x/gmp Module]:::protocol
        SC[Smart Contracts]:::protocol
        PCORE[Protocol Core]:::protocol
        EVM[EVM Integration]:::protocol
    end

    subgraph Infrastructure
        COSMOS[Cosmos SDK]:::infrastructure
        TEND[Tendermint]:::infrastructure
        EVMI[EVM Engine]:::infrastructure
    end

    subgraph Testing
        IT[Integration Tests]:::testing
        TF[Test Framework]:::testing
    end

    subgraph Documentation
        DD[Developer Docs]:::docs
        PD[Protocol Docs]:::docs
    end

    %% Relationships
    UI --> JSDK
    AOS --> JSDK
    CLI --> GoSDK
    JSDK --> API
    GoSDK --> API
    API --> WMOD
    API --> AMOD
    API --> ASMOD
    API --> GMOD
    WMOD --> PCORE
    AMOD --> PCORE
    ASMOD --> PCORE
    GMOD --> PCORE
    SC --> EVM
    EVM --> PCORE
    PCORE --> COSMOS
    COSMOS --> TEND
    EVM --> EVMI

    %% Click Events
    click UI "https://github.com/warden-protocol/wardenprotocol/tree/main/spaceward"
    click AOS "https://github.com/warden-protocol/wardenprotocol/tree/main/automated-orders"
    click CLI "https://github.com/warden-protocol/wardenprotocol/tree/main/cmd/wardend"
    click JSDK "https://github.com/warden-protocol/wardenprotocol/tree/main/wardenjs"
    click GoSDK "https://github.com/warden-protocol/wardenprotocol/tree/main/go-client"
    click API "https://github.com/warden-protocol/wardenprotocol/tree/main/api"
    click WMOD "https://github.com/warden-protocol/wardenprotocol/tree/main/warden/x/warden"
    click AMOD "https://github.com/warden-protocol/wardenprotocol/tree/main/warden/x/act"
    click ASMOD "https://github.com/warden-protocol/wardenprotocol/tree/main/warden/x/async"
    click GMOD "https://github.com/warden-protocol/wardenprotocol/tree/main/warden/x/gmp"
    click SC "https://github.com/warden-protocol/wardenprotocol/tree/main/contracts"
    click PCORE "https://github.com/warden-protocol/wardenprotocol/tree/main/warden/app"
    click EVM "https://github.com/warden-protocol/wardenprotocol/tree/main/precompiles"
    click IT "https://github.com/warden-protocol/wardenprotocol/tree/main/tests"
    click TF "https://github.com/warden-protocol/wardenprotocol/tree/main/tests/framework"
    click DD "https://github.com/warden-protocol/wardenprotocol/tree/main/docs/developer-docs"
    click PD "https://github.com/warden-protocol/wardenprotocol/tree/main/protocol-developer-docs"

    %% Legend
    classDef legend fill:#f9f9f9,stroke:#333,stroke-width:1px
    class UI,AOS,CLI frontend
    class JSDK,GoSDK,API api
    class WMOD,AMOD,ASMOD,GMOD,SC,PCORE,EVM protocol
    class COSMOS,TEND,EVMI infrastructure
    class IT,TF testing
    class DD,PD docs
```
