Skip to content

Latest commit

 

History

History
142 lines (119 loc) · 10.4 KB

File metadata and controls

142 lines (119 loc) · 10.4 KB

Platform Services

The following diagram shows platform components and their dependencies:

                                 ┌───────────────┐
                                 │  Dash Core    │
                                 │  Blockchain   │
                                 └───────┬───────┘
                                         │
                   ┌─────────────────────┼─────────────────────────────┐
                   │                     │                             │
                   │        ┌────────────┼─────────────┐               │
                   │        │            │             │               │
          ┌────────▼────────┐    ┌───────▼───────┐     │      ┌───────▼───────┐
          │                 │    │               │     │      │               │
          │   Drive ABCI    │◄───┤  Tenderdash   │     │      │   DAPI API    │
          │  (Application   │    │  (Consensus   │     │      │  (JSON-RPC/   │
          │   Logic)        │    │   Engine)     │     │      │   gRPC API)   │
          │                 │    │               │     │      │               │
          └────────┬────────┘    └───────┬───────┘     │      └───────┬───────┘
                   │                     │             │              │
                   │                     │             │              │
                   │                     │             │      ┌───────▼───────┐
                   │                     │             │      │               │
                   │                     │             │      │  DAPI Core    │
                   │                     │             │      │   Streams     │
                   │                     │             │      │               │
                   │                     │             │      └───────┬───────┘
                   │                     │             │              │
                   │                     │             │              │
                   └─────────────────────┼─────────────┼──────────────┘
                                         │             │
                                 ┌───────▼─────────────▼───┐
                                 │                         │
                                 │         Gateway         │
                                 │                         │
                                 └─────────────────────────┘
                                           ▲
                                           │
                                           │
                                 ┌─────────┴─────────┐
                                 │                   │
                                 │      Clients      │
                                 │                   │
                                 └───────────────────┘

Gateway is the entry point for client applications, handling TLS termination and routing requests to the appropriate service:

  • Core-related and some Platform API calls are forwarded to DAPI API
  • Core streaming requests such as transactions and block headers are forwarded to DAPI Core Streams
  • The most of the queries to Platform state are forwarded directly to Drive ABCI

For detailed information about the Gateway service, see the Gateway Service documentation.

DAPI, Drive and Tenderdash communicate with Core via RPC to access layer 1 blockchain data and LLMQ functionality.

DAPI API service is interacting with Tenderdash to retrieve layer 2 blockchain data and broadcast state transitions. Also it requests proofs for state transitions from Drive ABCI.

Drive (ABCI and Tenderdash)

            ┌─────────────────────────────────────┐
            │                                     │
            │          ┌─────────────┐            │
            │          │             │            │
            │          │  Drive      │ ◄──────────┼── User API Requests
            │          │  ABCI       │            │
            │          │             │            │
            │          └──────┬──────┘            │
            │                 ▼  ABCI             │
            │          ┌─────────────┐            │
            │          │             │
            │          │  Tenderdash │            │
            │          │             │◄───────────┼── Consensus Messages
            │          └─────────────┘            │
            └─────────────────────────────────────┘

Drive ABCI and Tenderdash works together to execute blocks and build the platform state. They are using ABCI protocol to communicate with each other.

Drive ABCI is the application logic layer that processes state transitions and manages the platform state.

Responsibilities:

  • Process platform state transitions
  • Implement application logic
  • Maintain state database
  • Interface with Tenderdash consensus engine

Communication:

  • Connects to Core for blockchain data via RPC
  • Interfaces with Tenderdash for consensus
  • Provides gRPC API for DAPI services
  • Offers debugging tools (Tokio Console, GroveDB Visualizer)

Tenderdash is the consensus engine that provides Byzantine Fault Tolerant (BFT) consensus for the platform.

  • Communicates with other Tenderdash nodes via P2P
  • Provides RPC for DAPI API
Service Port Purpose Default Value Config Path Default Host Binding Host Config Path
Drive ABCI ABCI 26658 (fixed internal) (internal) -
gRPC 26670 (fixed internal) (internal) -
Metrics 29090 (mainnet), 39090 (testnet), 49090 (local) platform.drive.abci.metrics.port 127.0.0.1 (local) platform.drive.abci.metrics.host
Tokio Console 6669 (mainnet), 16669 (testnet), 26669 (local) platform.drive.abci.tokioConsole.port 127.0.0.1 (local) platform.drive.abci.tokioConsole.host
GroveDB Visualizer 8083 (mainnet), 18083 (testnet), 28083 (local) platform.drive.abci.grovedbVisualizer.port 127.0.0.1 (local) platform.drive.abci.grovedbVisualizer.host
Drive Tenderdash P2P 26656 platform.drive.tenderdash.p2p.port 0.0.0.0 (all) platform.drive.tenderdash.p2p.host
RPC 26657 platform.drive.tenderdash.rpc.port 127.0.0.1 (local) platform.drive.tenderdash.rpc.host
Metrics 26660 platform.drive.tenderdash.metrics.port 127.0.0.1 (local) platform.drive.tenderdash.metrics.host
pprof Debug 6060 platform.drive.tenderdash.pprof.port 127.0.0.1 (local) (fixed)

DAPI Services

5. rs-dapi (Rust)

Service Name: rs_dapi

Description: Rust implementation of DAPI that serves all Platform client traffic (gRPC, gRPC-Web, JSON-RPC, streaming, metrics).

Responsibilities:

  • Provide JSON-RPC, gRPC, and gRPC-Web APIs
  • Stream Core and Platform events
  • Proxy client traffic to Drive ABCI, Tenderdash, and Core
  • Expose health checks and Prometheus metrics

Communication:

  • Connects to Core via RPC and ZMQ
  • Connects to Drive ABCI via gRPC
  • Connects to Tenderdash via RPC and WebSockets
  • Served to external clients via the Gateway

rs-dapi Ports and Configuration:

Service Port Purpose Default Value Config Path Default Host Binding Host Config Path
rs-dapi (Rust) JSON-RPC 3009 (fixed internal) (internal) -
gRPC / gRPC-Web 3010 (fixed internal) (internal) -
Metrics & Health 9091 (mainnet), 19091 (testnet), 29091 (local) platform.dapi.rsDapi.metrics.port 127.0.0.1 platform.dapi.rsDapi.metrics.host

The rs-dapi metrics server exposes health endpoints alongside Prometheus data on /metrics from the same port. Dashmate applies network-specific defaults (mainnet 9091, testnet 19091, local 29091) so multiple presets can coexist on a host without conflicts.