# Quick Start

## Quick Start Guide

This guide will walk you through the process of setting up a minimal development environment using the Euclid Development Environment project, installing the Metagraph Framework, and launching clusters. The process should take less than an hour, including installing dependencies.

{% hint style="info" %}
**Windows Support**

Primary development focus for this SDK is based on UNIX-based operating systems like macOS or Linux. With that being said, Windows support is available using the Windows Subsystem for Linux (WSL) to emulate a UNIX environment. The following guide has been tested in that environment and works wells.

See [Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install) for more detail in setting up WSL on your Windows machine.
{% endhint %}

## Install Dependencies[​](https://docs.constellationnetwork.io/sdk/guides/quick-start#install-dependencies) <a href="#install-dependencies" id="install-dependencies"></a>

**Install Basic Dependencies**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#install-basic-dependencies)

Many developers can skip this step because these dependencies are already installed.

* [Node JS](https://nodejs.org/en)
* [Yarn](https://classic.yarnpkg.com/en/docs/install)
* [Docker](https://docs.docker.com/get-docker/)
* [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)
* [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
* [Scala 2.13](https://www.scala-lang.org/download/)
* [Jq](https://jqlang.github.io/jq/download/)
* [Yq](https://github.com/mikefarah/yq)

**Install argc**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#install-argc)

```sh
cargo install argc
```

**Install Giter**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#install-giter)

```sh
cs install giter8
```

**Configure Docker**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#configure-docker)

The Euclid Development Environment starts up to 10 individual docker containers to create a minimal development environment which takes some significant system resources. Configure docker to make at least 8GB of RAM available. If you are using Docker Desktop, this setting can be found under Preferences -> Resources.

## Install[​](https://docs.constellationnetwork.io/sdk/guides/quick-start#install) <a href="#install" id="install"></a>

**Clone**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#clone)

Clone the Euclid Development Environment project to your local machine.

```sh
git clone https://github.com/Constellation-Labs/euclid-development-environment
cd euclid-development-environment
```

See the [Development Environment](https://docs.constellationnetwork.io/metagraph-development/elements/development-environment) section for an overview of the directory structure of the project.

**Configure**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#configure)

Update the `project_name` field to the name of your project.

**Hydra**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#hydra)

Familiarize yourself with the `hydra` CLI. We can use the `hydra` CLI tool to build the necessary docker containers and manage our network clusters.

```sh
scripts/hydra -h

USAGE: hydra <COMMAND>

COMMANDS:
  install                           Installs a local framework and detaches project
  install-template                  Installs a project from templates
  build                             Build containers
  start-genesis                     Start containers from the genesis snapshot (erasing history) [aliases: start_genesis]
  start-rollback                    Start containers from the last snapshot (maintaining history) [aliases: start_rollback]
  stop                              Stop containers
  destroy                           Destroy containers
  purge                             Destroy containers and images
  status                            Check the status of the containers
  remote-deploy                     Remotely deploy to cloud instances using Ansible [aliases: remote_deploy]
  remote-start                      Remotely start the metagraph on cloud instances using Ansible [aliases: remote_start]
  remote-status                     Check the status of the remote nodes
  update                            Update Euclid
  logs                              Get the logs from containers
  install-monitoring-service        Download the metagraph-monitoring-service (https://github.com/Constellation-Labs/metagraph-monitoring-service) [aliases: install_monitoring_service]
  remote-deploy-monitoring-service  Deploy the metagraph-monitoring-service to remote host [aliases: remote_deploy_monitoring_service]
  remote-start-monitoring-service   Start the metagraph-monitoring-service on remote host [aliases: remote_start_monitoring_service]
```

**Install Project**[**​**](https://docs.constellationnetwork.io/sdk/guides/quick-start#install-project)

Running the `install` command will do two things:

* Creates currency-l0 and currency-l1 projects from a g8 template and moves them to the `source/project` directory.
* Detach your project from the source repo.

Detaching your project from the source repo removes its remote git configuration and prepares your project to be included in your own version control. Once detached, your project can be updated with `hydra`.

```sh
scripts/hydra install   
```

You can import a metagraph template from custom examples by using the following command:

```sh
scripts/hydra install-template
```

By default, we use the [Metagraph Examples](https://github.com/Constellation-Labs/metagraph-examples) repository. You should provide the template name when running this command. To list the templates available to install, type:

```sh
scripts/hydra install-template --list
```

## Build[​](https://docs.constellationnetwork.io/sdk/guides/quick-start#build) <a href="#build" id="build"></a>

Build your network clusters with hydra. By default, this builds `metagraph-ubuntu`, `metagraph-base-image`, and `prometheus` + `grafana` monitoring containers. These images will allow deploy the containers with metagraph layers: `global-l0`, `metagraph-l0`, `currency-l1`, and `data-l1`. The `dag-l1` layer is not built by default since it isn't strictly necessary for metagraph development. You can include it on the `euclid.json` file.

Start the build process. This can take a significant amount of time... be patient.

```sh
scripts/hydra build
```

## Run[​](https://docs.constellationnetwork.io/sdk/guides/quick-start#run) <a href="#run" id="run"></a>

After your containers are built, go ahead and start them with the `start-genesis` command. This starts all network components from a fresh genesis snapshot.

```sh
scripts/hydra start-genesis
```

Once the process is complete you should see output like this:

```sh
################################################################
######################### METAGRAPH INFO #########################

Metagraph ID: :your_id


Container metagraph-node-1 URLs
Global L0: http://localhost:9000/node/info
Metagraph L0: http://localhost:9200/node/info
Currency L1: http://localhost:9300/node/info
Data L1: http://localhost:9400/node/info


Container metagraph-node-2 URLs
Metagraph L0: http://localhost:9210/node/info
Currency L1: http://localhost:9310/node/info
Data L1: http://localhost:9410/node/info


Container metagraph-node-3 URLs
Metagraph L0: http://localhost:9220/node/info
Currency L1: http://localhost:9320/node/info
Data L1: http://localhost:9420/node/info


Clusters URLs
Global L0: http://localhost:9000/cluster/info
Metagraph L0: http://localhost:9200/cluster/info
Currency L1: http://localhost:9300/cluster/info
Data L1: http://localhost:9400/cluster/info

####################################################################
```

You can also check the status of your containers with the `status` command.

```sh
scripts/hydra status
```

## Next Steps[​](https://docs.constellationnetwork.io/sdk/guides/quick-start#next-steps) <a href="#next-steps" id="next-steps"></a>

You now have a minimal development environment installed and running 🎉

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Send your first transaction</strong></td><td>Set up the FE Developer Dashboard and send your hello world metagraph transaction.</td></tr><tr><td><strong>Manual Setup</strong></td><td>Prefer to configure your environment by hand? Explore manual setup.</td></tr></tbody></table>
