The Euclid Development Environment is an upgradeable project framework to simplify the process of configuring a local development environment for metagraph developers on the Constellation Network.
Getting started with metagraph development can be challenging due to the infrastructure requirements for a minimal development environment. This is a significantly bigger challenge for Constellation Network developers compared to developers on blockchain-based networks due to the inherent complexity of Constellation's microservice-based architecture. The Euclid Development Environment was created to simplify that process as much as possible for metagraph developers, so that developers can focus on building their applications and business logic rather than deploying infrastructure. It includes open source tools that can be used as a starting point for developing more customized tooling specific to your project team’s needs.
Minimal Development Environment
A minimal development environment for the Constellation Network consists of the following components:
- 1 Global L0 node
- 3 Metagraph L0 node
- 3 Metagraph L1 - Currency nodes
- 3 DAG L1 nodes (optional)
- 3 Metagraph L1 - Data nodes (optional)
Note that a cluster of at least three L1 nodes is necessary for the L1 layer to reach consensus (Metagraph L1 - Currency + DAG L1 + Metagraph L1 - Data).
See Network Architecture for an overview of the role each cluster plays in the Hypergraph.
For local development, it is sufficient to run each necessary node in a Docker container on a single developer machine. The minimal setup requires at least 5 docker containers which can be taxing on system resources. For that reason, we recommend your development machine have a minimum of 16 GB of RAM with at least 8GB of that RAM allocated to Docker. We recommend allocating 10GB RAM or more for a smoother development experience if your development machine can support it.
The system requirements for running a Euclid Development Environment project are:
- Linux or macOS operating system
- 16 GB RAM or more
- Docker installed with 8GB RAM allocated to it
The Euclid Development Environment includes the following components:
- The Hydra CLI tool for building and managing clusters of docker containers for each of the network configurations
- Docker files for building and connecting each of the required local clusters
- A Telemetry Dashboard consisting of two additional docker containers running Prometheus and Grafana.
Clone the repo from Github
git clone https://github.com/Constellation-Labs/euclid-development-environment.git
See Hydra CLI for additional installation and configuration instructions.
Project Directory Structure
The project has the following structure:
- custom-project (your-project-name)
This directory contains all docker configuration files for generating each of the network clusters. This directory should generally not need to be edited directly and can be upgraded using the hydra script to gain access to newly released configurations.
The scripts directory contains the
euclid.json file contains your environment variables that allow you to customize the configuration generated by
hydra. The github_token variable is required to run
This directory contains your local source code for each project under the
project directory. These directories will be empty by default, until the project is installed using
hydra install which will generate these project directories from a template. The files in these directories are automatically included in the metagraph-l0, data-l1, and currency-l1 docker containers when you run
In this directory inside the
global-l0 subdirectory, you will find the genesis file for your Global L0 network. Updating this file will allow you to attribute DAG token amounts to addresses at the genesis of your network. The source for the Global L0 network is stored in a jar file under
source/docker since this codebase is not meant to be modified.
Similarly, within the
metagraph-l0 subdirectory, you will find the genesis file for your Currency L0 network. Updating this file will allow you to attribute metagraph token amounts to addresses at the genesis of your network.
p12-files directory, you will find p12 files used in the default node configuration. You may update these files to use your own keys for your nodes. Environment variables in the
euclid.json file should be updated with the new file aliases and passwords if you do choose to update them.