repowiselayerzero-labs/layerzero-v2

Architecture of layerzero-labs/layerzero-v2

layerzero-labs/layerzero-v2 is 555 source files holding 3,011 symbols across 2 modules, written mainly in Rust, TypeScript, JavaScript. The largest module is packages, with 546 files, and 19 files are entry points into the dependency graph.

How layerzero-v2 fits together

Application contracts built with the OApp standard in /oapp call the LayerZero Endpoint, the core protocol contract interface that lives in /protocol. Messages pass through the append-only MessageLibs in /messagelib, which hold reference implementations of how DVNs and Executors communicate with Ultra Light Nodes on each chain. On Solana, packages/layerzero-v2/solana/anchor-latest/programs/endpoint-interface/src/lib.rs is the entry point for the endpoint interface program, and packages/layerzero-v2/solana/anchor-latest/libs/oapp/src/lib.rs is the entry point for the OApp library. The packages directory holds the bulk of the repository's files. The GitHub workflow .github/workflows/lint-build-test.yaml covers linting, building, and testing the code.

Largest modules

  • packages: 546 files and 17,528 lines of code
  • root: 6 files and 130 lines of code
  • .github: 2 files and 51 lines of code
  • .devcontainer: 1 file and 95 lines of code

Languages

By file count: Rust 232 files, TypeScript 127 files, JavaScript 5 files, Shell 2 files.

Documentation

Repowise documents layerzero-v2 in 474 pages generated from the source.

More on layerzero-v2: summary and FAQ, codebase overview, code health.