/architecture

This repository aims to have the main Decentraland Architecture

Primary LanguageMakefileApache License 2.0Apache-2.0

Decentraland Architecture

This repository aims to have the main Decentraland Architecture, defined using dot language. The goal is to help you understand it's components, responsibilities, how they interact and help you navigate through them.

Architecture

Index

Catalyst

A Catalyst is a server that runs different services. These services currently work as the backbone for Decentraland. Some of these project are:

If you just want to run a Catalyst server, please check the Catalyst Owner repository. You can check the list of available servers used by Decentraland in the Catalyst Monitor

Repositories:

Comms

The Communication Service, also known as Lighthouse, is in charge of orchestrating the P2P networks between users connected to Decentraland. It needs to determine which are the candidates for a P2P connection and do the WebRTC signaling to establish the connection. Most of this logic is done through 2 external components the PeerJS Server (connects WebRTC peers) and Archipelago (receives users positions and groups them in islands)

Lambdas

This service provides a set of utilities required by the Catalyst Server Clients/Consumers in order to retrieve or validate data. Some of the validations run in these functions are ownership related and for that it uses The Graph to query the blockchain.

Content Server

The Content Server currently stores many of the Entities used in Decentraland. For example scenes, wearables and profiles. Content servers will automatically sync with each other, as long as they were all approved by the DAO.

If you set up a local content server, it will receive all updates by those other DAO Catalysts. However, new deployments that happen on your local server will not be sent to other servers.

Nginx

Nginx is the reverse proxy used to route traffic to the Catalysts Services.

CLI

This CLI provides tooling/commands to assist you in the scenes development process. Some of the commands will help you scaffold a new scene project, locally start and visualize the scene in order to test it and deploy it to a content server to be incorporated in your Decentraland parcel.

Repositories:

Catalyst Client

This client library can be used to interact with Decentraland's Catalyst servers. You can both fetch data, or deploy new entities to the server you specify.

Repositories:

Web Browser

Repositories:

Peer Library

The Peer Library manages Websocket connections for WebRTC signaling, Islands, Notifications and Location Data and WebRTC Connections for peers positions, scene bus, global chat and voice chat (private chat goes through the Matrix Synapse Server and the Matrix Client).

Repositories:

Kernel: Voice Chat Module

This Module is the codec to hook WebAudio & Worklets to comms

Kernel: Client Comms

Abstraction over the Communication Protocol

Kernel: Scene Loader System

Module that loads and unloads the scenes/parcels based on user position.

Kernel: Scene

High level wrapper around the runtime scene

Kernel: Avatar Scene

It is a regular Decentraland Scene, it has the size of the world. And it renders the avatars using the SDK

Matrix Client

The Matrix Client can be used to interact Decentraland's users, providing the ability to send private messages and add people as friends.

Sagas

Like an ESB. Everything is connected to Sagas

Synapse

Synapse server is an implementation of the Matrix Protocol, created for secure, decentralized communications. In the context of Decentraland it is used to manage private chats between peers and friendships.

Explorer Website

REACT Application to load Kernel and Renderer

Repositories:

Scene Runtime

Kernel: Runtime

The Runtime handles SDK bindings and messaging with the Scene in Kernel

Compiler Bundle

AMD

This Module manages loading of RPC modules to interact with different components of Decentraland

Repositories

ECS

The public library to interact with Decentraland. Sometimes people refers to the ECS as “The SDK”

User Code

The user generated code is part of the bundle of the Scenes

How to Update this Repository

The architecture is something live and from time to time we may need to update this diagram and information, in order to do so the file architecture.dot contains the definition of the image architecture.svg. It can be a bit challenging to update and make it look nice, the VSCode extension Graphviz Interactive Preview can be very helpful to view your changes as you make them. Once the architecture dot file is updated you need to compile it and regenerate the architecture.svg file, for that you first need to install graphviz and then you can just run the make command. Note that with any change on the diagram you need to validate that this readme describing it's components is still updated.