# coelhoxyz/lunespy architecture

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

- Interactive diagram: https://gitdiagram.com/coelhoxyz/lunespy
- Repository: https://github.com/coelhoxyz/lunespy

## Overview

##### Main Components
- Client Module: Found under the "lunespy/client" directory. It contains submodules for handling various transaction types (alias, burn, cancel lease, issue, lease, mass, reissue, and transfer) and wallet operations (account generation, constants, validators, etc.).
- Server Module: Located in the "lunespy/server" directory. It handles server-side responsibilities such as processing addresses, blocks, node information, and processing transactions.
- Utilities Module – Within the "lunespy/utils" directory, it mainly contains crypto-related helper functions (algorithms, converters) that support both client and server functionalities.
- External Dependencies – Represent the Lunes blockchain network (nodes, mainnet/testnet) that LunesPy interacts with. This is vital since the library is designed for communication with blockchain nodes.

##### Relationships and Interactions
- Server Module Interaction: Show how the Server Module polls or receives blockchain information such as block updates, node statuses, or transaction validations.

##### Relevant Technologies and Frameworks
- Python: Central language of implementation.
- Docker Configurations: Although not core to the LunesPy library, the “docker” directory components (such as the deploynode Dockerfile and environment configurations) may be noted as part of deployment scenarios.
- Testing: The “test” directory can be represented as a supportive environment ensuring that components such as transactions, wallet functionalities, server interactions, and utility functions are verified through unit tests.

##### Elements to be Included
- Clear labels and names for every component (e.g., Transaction Module, Wallet Module, Crypto Utilities, Server – Blocks, Nodes, Addresses)
- From Client submodules (transaction types, wallet) to External Blockchain Nodes.
- From both Client and Server modules to the shared Utility (crypto) modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "LunesPy Core Library"
        subgraph "Client Module"
            CP0["Client Module"]:::client
            CP1["Transactions"]:::client
            CP2["Wallet Module"]:::client
            CP0 --> CP1
            CP0 --> CP2
        end
        subgraph "Server Module"
            SP0["Server Module"]:::server
            SP1["Address Module"]:::server
            SP2["Blocks Module"]:::server
            SP3["Nodes Module"]:::server
            SP4["Transactions Module"]:::server
            SP0 --> SP1
            SP0 --> SP2
            SP0 --> SP3
            SP0 --> SP4
        end
    end

    CU["Crypto Utilities"]:::util
    EX["Lunes Blockchain"]:::external

    %% Client Module Transactions interactions with External Blockchain
    CP1 -->|"sendTx"| EX
    CP2 -->|"sendWallet"| EX

    %% Server Module interactions with External Blockchain
    SP1 -->|"query"| EX
    SP2 -->|"query"| EX
    SP3 -->|"query"| EX
    SP4 -->|"processTx"| EX

    %% Dependencies on Crypto Utilities (from Client Module)
    CP0 -->|"uses"| CU
    CP1 -->|"uses"| CU
    CP2 -->|"uses"| CU

    %% Dependencies on Crypto Utilities (from Server Module)
    SP0 -->|"uses"| CU
    SP1 -->|"uses"| CU
    SP2 -->|"uses"| CU
    SP3 -->|"uses"| CU
    SP4 -->|"uses"| CU

    %% Click Events
    click CP0 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/client"
    click CP1 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/client/transactions"
    click CP2 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/client/wallet"
    click SP0 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/server"
    click SP1 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/server/address"
    click SP2 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/server/blocks"
    click SP3 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/server/nodes"
    click SP4 "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/server/transactions"
    click CU "https://github.com/coelhoxyz/lunespy/tree/main/lunespy/utils/crypto"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef server fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef util fill:#FFFF99,stroke:#000,stroke-width:1px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
