Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Nitrolite V1 Clearnode Specifications

This directory contains Clearnode architecture, models and communication flows that facilitate communication between user, SDK client, Node and Blockchains — the core off-chain engine for the Nitrolite V1 Protocol.

Contents

  • api.yaml - API definitions including types, state transitions, and RPC methods
  • data_models.mmd - Data model diagrams

Communication Flows

Remaining Flows

The following communication flows are not yet documented:

  • home chain migration - Cross-chain state migration between home channels
  • app session create / operate / withdraw / close - Full app session lifecycle beyond deposits

Project Structure

cerebro/                    # Cerebro Testing Client
clearnode/
    action_gateway/         # Rate limiting via gated actions
    api/
        app_session_v1/     # App session endpoints (create, deposit, operate, withdraw, close)
        apps_v1/            # Application registry endpoints
        channel_v1/         # Channel endpoints (create, submit_state, get_state, transfer)
        node_v1/            # Node info endpoints
        user_v1/            # User endpoints (balances, staking)
    config/
        migrations/
            postgres/       # Goose SQL migrations (embedded at compile time)
    event_handlers/         # Blockchain event processing (channel events, locking events)
    metrics/                # Prometheus metrics + lifespan metric aggregation
    store/
        database/           # GORM-based DB store
        memory/             # In-memory store for assets, blockchains, config
    blockchain_worker.go    # Processes pending BlockchainAction records
    runtime.go              # Embeds migrations, initializes services
    main.go                 # Entry point, EVM listeners, metric exporters
contracts/                  # Smart contracts (ChannelHub, Locking, etc.)
docs/                       # This directory
pkg/
    app/                    # App session types (AppSessionStatus, quorum, allocations)
    blockchain/
        evm/                # EVM client implementations
    core/                   # Core types: Channel, State, Transaction, Signer, Transition
    log/                    # Structured logging
    rpc/                    # RPC protocol: messages, requests, responses, errors
    sign/                   # Signer implementations (EthereumMsgSigner, EthereumRawSigner)
sdk/
    go/                     # Go SDK client
    ts/                     # TypeScript SDK client
    ts-compat/              # TypeScript compatibility SDK
test/                       # Integration test scenarios