Constellation Network
IntroductionFundamentalsFor DevelopersNode Validators
  • Index
  • Introduction
  • Elements
    • Toolkit
    • Development Environment
    • Hydra CLI
    • Developer Dashboard
    • Telemetry Dashboard
    • Metagraph Monitoring Service
  • Metagraph Framework
    • Overview
    • Framework Architecture
    • Installation
    • Currency
      • Working with Tokens
    • Data
      • State Management
      • Lifecycle functions
    • Framework Endpoints
    • Custom Endpoints
  • Guides
    • Quick Start
    • Send a Transaction
    • Manual Setup
    • Customize Rewards Logic
    • Custom Data Validation
    • Working with p12 files
    • Snapshot Fees
    • Deploy a Metagraph
      • Security groups
      • Key pairs
      • Base instance
        • Generating base instance
        • Connect to the instance
        • Generating AMI (Image) from Base Instance
        • Launching instances from AMI
      • Start Metagraph Instances
        • Configuring P12 Files
        • Start Global L0 Instances
        • Start Metagraph L0 Instances
        • Start Currency L1 Instances
        • Start Data L1 Instances
  • Resources
    • Network APIs
    • Example Codebases
    • Metagraph Development Video Series
Powered by GitBook

Main

  • Website
  • Get DAG
  • Explore Projects
  • Partners

Socials

  • Telegram
  • Discord
  • X (Twitter)

Tools

  • Wallet
  • DAG Explorer
  • Coingecko

© 2025 CONSTELLATION NETWORK

On this page

Was this helpful?

Export as PDF
  1. Metagraph Framework

Framework Architecture

PreviousOverviewNextInstallation

Last updated 2 months ago

Was this helpful?

This section contains information about the Metagraph Framework and its relation to the deployed architecture of a metagraph.

In order to understand how the framework functions, it is important to understand the multi-layered architecture of a metagraph. Make sure you're familiar with before continuing.

Code Structure

A new metagraph project generated from the will have the following module directory structure:

- modules/
- - l0/
- - - Main.scala
- - l1/
- - - Main.scala
- - data_l1/
- - - Main.scala
- - shared_data
- - - Main.scala

Let's break down each directory and its function.

L0

This directory contains a Main.scala file with a Main object instance that extends CurrencyL0App. CurrencyL0App contains overridable functions that allow for customization of the operation of the metagraph L0 layer including validation, snapshot formation, and management of off chain state. It also contains the rewards overridable function that allows for minting of new tokens on the network.

note

While the class CurrencyL0App has the "Currency" in its name, it defines the L0 layer through which both Currency L1 and Data L1 data flows.

This directory contains a Main.scala file with a Main object instance that extends CurrencyL1App. CurrencyL1App contains overridable functions relevant to customizing token validation behavior such as transactionValidator.

This directory contains an empty Main.scala file but is provided as a suggestion for application directory structure. Several of the lifecycle functions are run on both Data L1 and on L0. For example, serializers/deserializers, validators, and data types will likely shared between layers. Organizing them in a separate directory makes their use in multiple layers clear.

L1

L1 Data

This directory also contains a Main.scala file, with a Main object instance that extends CurrencyL1App. In order to have this L1 behave as a DataApplication, the dataApplication method should be overridden with your custom configuration. The metagraph examples repo has implemented examples to reference, for example the .

Shared Data

See the for more information.

Metagraph Architecture
​
currency template
​
​
​
NFT example
​
Data Application Lifecycle