# trushaliphatak/smart-listener-cross-chain-interoperability architecture

> Architecture diagram of the GitHub repository trushaliphatak/smart-listener-cross-chain-interoperability, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trushaliphatak/smart-listener-cross-chain-interoperability
- Repository: https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability

## Overview

This is a smart-listener cross-chain transaction framework. A source-chain event is observed by each listener, validated and persisted, then listener votes are checked for consensus; approved transactions are executed through a configured destination adapter and their state is exposed through an API and dashboard. The graph includes the documented monitoring, consensus, retry, storage, and Fabric integration branches. Some implementation details, including the API server and contract internals, were not excerpted, so their links are limited to indexed references or documented behavior.

Main entry points: [`listener/src/listenerProcess.ts`](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/listenerProcess.ts) (Listener coordinator), [`listener/src/executor.ts`](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/executor.ts) (Execution and retries), [`listener/src/types.ts`](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/types.ts) (Transaction types), [`listener/src/db.ts`](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/db.ts) (Transaction and vote store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_contracts["Chain contracts"]
  node_sender["Sender contract<br/>[SenderContract.sol]"]
  node_receiver["Receiver mock<br/>[ReceiverMock.sol]"]
end

subgraph group_listener["Listener runtime"]
  node_listener_process["Listener coordinator<br/>[listenerProcess.ts]"]
  node_evm_adapter["EVM event adapter<br/>[evmAdapter.ts]"]
  node_consensus["Vote consensus<br/>[consensus.ts]"]
  node_executor["Execution and retries<br/>[executor.ts]"]
  node_simulated_adapter["Simulated destination"]
  node_fabric_adapter["Fabric destination<br/>[fabricAdapter.ts]"]
  node_config["Runtime configuration<br/>[config.ts]"]
  node_types["Transaction types<br/>[types.ts]"]
end

subgraph group_storage_api["Storage and API"]
  node_database[("Transaction and vote store<br/>[db.ts]")]
  node_api_server["Listener API<br/>[apiServer.ts]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_api["Dashboard API client<br/>[api.ts]"]
  node_transaction_detail["Transaction detail view"]
  node_dashboard_entry["Dashboard entry<br/>[main.tsx]"]
end

node_source_chain[("Source EVM chain")]
node_user(("Transaction sender"))

node_user -.->|"submits request"| node_sender
node_sender -.->|"emits events"| node_source_chain
node_source_chain -->|"provides events"| node_evm_adapter
node_evm_adapter -->|"delivers events"| node_listener_process
node_listener_process -->|"stores transactions and votes"| node_database
node_listener_process -->|"evaluates votes"| node_consensus
node_listener_process -->|"starts execution"| node_executor
node_executor -->|"reads and updates state"| node_database
node_executor -->|"dispatches execution"| node_simulated_adapter
node_executor -->|"dispatches execution"| node_fabric_adapter
node_listener_process -->|"uses settings"| node_config
node_evm_adapter -->|"uses settings"| node_config
node_executor -->|"uses retry settings"| node_config
node_database -->|"selects backend"| node_config
node_listener_process -->|"uses transaction types"| node_types
node_consensus -->|"uses vote types"| node_types
node_executor -->|"uses transaction types"| node_types
node_simulated_adapter -->|"uses result types"| node_types
node_fabric_adapter -->|"uses result types"| node_types
node_api_server -->|"reads transaction data"| node_database
node_dashboard_api -->|"requests API data"| node_api_server
node_transaction_detail -->|"loads transaction data"| node_dashboard_api
node_dashboard_entry -.->|"renders view"| node_transaction_detail
node_simulated_adapter -.->|"simulates destination"| node_receiver

click node_sender "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/contracts/SenderContract.sol"
click node_receiver "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/contracts/ReceiverMock.sol"
click node_listener_process "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/listenerProcess.ts"
click node_evm_adapter "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/sourceAdapter/evmAdapter.ts"
click node_consensus "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/consensus.ts"
click node_executor "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/executor.ts"
click node_simulated_adapter "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/destinationAdapter/simulatedAdapter.ts"
click node_fabric_adapter "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/destinationAdapter/fabricAdapter.ts"
click node_config "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/config.ts"
click node_types "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/types.ts"
click node_database "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/db.ts"
click node_api_server "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/apiServer.ts"
click node_dashboard_api "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/dashboard/src/api.ts"
click node_transaction_detail "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/dashboard/src/components/TransactionDetail.tsx"
click node_dashboard_entry "https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/dashboard/src/main.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sender,node_receiver toneBlue
class node_listener_process,node_evm_adapter,node_consensus,node_executor,node_simulated_adapter,node_fabric_adapter,node_config,node_types,node_source_chain toneAmber
class node_database,node_api_server toneMint
class node_dashboard_api,node_transaction_detail,node_dashboard_entry toneRose
class node_user toneIndigo
```

## Components

### Chain contracts

- [Sender contract](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/contracts/SenderContract.sol): `contracts/SenderContract.sol`
- [Receiver mock](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/contracts/ReceiverMock.sol): `contracts/ReceiverMock.sol`

### Listener runtime

- [Listener coordinator](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/listenerProcess.ts): `listener/src/listenerProcess.ts`
- [EVM event adapter](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/sourceAdapter/evmAdapter.ts): `listener/src/sourceAdapter/evmAdapter.ts`
- [Vote consensus](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/consensus.ts): `listener/src/consensus.ts`
- [Execution and retries](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/executor.ts): `listener/src/executor.ts`
- [Simulated destination](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/destinationAdapter/simulatedAdapter.ts): `listener/src/destinationAdapter/simulatedAdapter.ts`
- [Fabric destination](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/destinationAdapter/fabricAdapter.ts): `listener/src/destinationAdapter/fabricAdapter.ts`
- [Runtime configuration](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/config.ts): `listener/src/config.ts`
- [Transaction types](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/types.ts): `listener/src/types.ts`

### Storage and API

- [Transaction and vote store](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/db.ts): `listener/src/db.ts`
- [Listener API](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/listener/src/apiServer.ts): `listener/src/apiServer.ts`

### Dashboard

- [Dashboard API client](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/dashboard/src/api.ts): `dashboard/src/api.ts`
- [Transaction detail view](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/dashboard/src/components/TransactionDetail.tsx): `dashboard/src/components/TransactionDetail.tsx`
- [Dashboard entry](https://github.com/trushaliphatak/smart-listener-cross-chain-interoperability/blob/main/dashboard/src/main.tsx): `dashboard/src/main.tsx`

### Other components

- **Source EVM chain**
- **Transaction sender**

## Connections

- Transaction sender → Sender contract: submits request
- Sender contract → Source EVM chain: emits events
- Source EVM chain → EVM event adapter: provides events (evidence: `listener/src/sourceAdapter/evmAdapter.ts`)
- EVM event adapter → Listener coordinator: delivers events (evidence: `listener/src/listenerProcess.ts`)
- Listener coordinator → Transaction and vote store: stores transactions and votes (evidence: `listener/src/listenerProcess.ts`)
- Listener coordinator → Vote consensus: evaluates votes (evidence: `listener/src/listenerProcess.ts`)
- Listener coordinator → Execution and retries: starts execution (evidence: `listener/src/listenerProcess.ts`)
- Execution and retries → Transaction and vote store: reads and updates state (evidence: `listener/src/executor.ts`)
- Execution and retries → Simulated destination: dispatches execution (evidence: `listener/src/executor.ts`)
- Execution and retries → Fabric destination: dispatches execution (evidence: `listener/src/executor.ts`)
- Listener coordinator → Runtime configuration: uses settings (evidence: `listener/src/listenerProcess.ts`)
- EVM event adapter → Runtime configuration: uses settings (evidence: `listener/src/sourceAdapter/evmAdapter.ts`)
- Execution and retries → Runtime configuration: uses retry settings (evidence: `listener/src/executor.ts`)
- Transaction and vote store → Runtime configuration: selects backend (evidence: `listener/src/db.ts`)
- Listener coordinator → Transaction types: uses transaction types (evidence: `listener/src/listenerProcess.ts`)
- Vote consensus → Transaction types: uses vote types (evidence: `listener/src/consensus.ts`)
- Execution and retries → Transaction types: uses transaction types (evidence: `listener/src/executor.ts`)
- Simulated destination → Transaction types: uses result types (evidence: `listener/src/destinationAdapter/simulatedAdapter.ts`)
- Fabric destination → Transaction types: uses result types (evidence: `listener/src/destinationAdapter/fabricAdapter.ts`)
- Listener API → Transaction and vote store: reads transaction data (evidence: `listener/src/apiServer.ts`)
- Dashboard API client → Listener API: requests API data (evidence: `dashboard/src/api.ts`)
- Transaction detail view → Dashboard API client: loads transaction data (evidence: `dashboard/src/components/TransactionDetail.tsx`)
- Dashboard entry → Transaction detail view: renders view
- Simulated destination → Receiver mock: simulates destination (evidence: `listener/src/destinationAdapter/simulatedAdapter.ts`)
