Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
# 2. `.env` file contents
# 3. `.env.default` file contents.

# Each service also has its own .env.default, which is the one it reads when
# started from its own directory (`yarn workspace <name> start`).

# Clustering config went with archipelago-core — see docs/core-decommission-runbook.md.

HTTP_SERVER_PORT=5000
HTTP_SERVER_HOST=0.0.0.0

NATS_URL=

ARCHIPELAGO_FLUSH_FREQUENCY=2.0
ARCHIPELAGO_JOIN_DISTANCE=64
ARCHIPELAGO_LEAVE_DISTANCE=80
ARCHIPELAGO_PARCEL_SIZE=16

CHECK_HEARTBEAT_INTERVAL=60000
ARCHIPELAGO_STATUS_UPDATE_INTERVAL=10000
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ dist/
*.json

**/src/index.ts
core/src/logic/livekit.ts
8 changes: 0 additions & 8 deletions .github/workflows/docker-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ on:
- "main"

jobs:
archipelago-ea-core-deployment:
uses: decentraland/platform-actions/.github/workflows/apps-docker-next.yml@main
with:
service-name: archipelago-ea-core
image-name: archipelago-workers
deployment-environment: dev
secrets: inherit

archipelago-ea-stats-deployment:
uses: decentraland/platform-actions/.github/workflows/apps-docker-next.yml@main
with:
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ on:
- "created"

jobs:
archipelago-ea-core-deployment:
uses: decentraland/platform-actions/.github/workflows/apps-docker-release.yml@main
with:
service-name: archipelago-ea-core
image-name: archipelago-workers
deployment-environment: prd
secrets: inherit

archipelago-ea-stats-deployment:
uses: decentraland/platform-actions/.github/workflows/apps-docker-release.yml@main
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
required: true
type: choice
options:
- archipelago-ea-core
- archipelago-ea-ws-connector
- archipelago-ea-stats
description: Service name
Expand Down
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

[![Coverage Status](https://coveralls.io/repos/github/decentraland/archipelago-workers/badge.svg?branch=coverage)](https://coveralls.io/github/decentraland/archipelago-workers?branch=coverage)

The Archipelago Workers is a monorepo containing three services that implement the Archipelago protocol for clustering users into dynamic islands based on their positions in Decentraland's metaverse. The protocol enables scalable crowd management and efficient real-time communication for standalone realms.
The Archipelago Workers is a monorepo containing two services that support Decentraland's real-time communication layer: a WebSocket gateway for clients and a stats API for monitoring.

> **Island clustering has moved to Pulse.** In iteration 1 of the Archipelago ⇒ Pulse migration the `core` service was **removed** from this repo: Pulse authors the clustering and publishes `engine.islands` / `engine.discovery`, and comms-gatekeeper mints the LiveKit connection strings and publishes `engine.peer.{address}.island_changed`. The WebSocket Connector is unchanged, and the Stats Service keeps every endpoint until iteration 2. See [docs/core-decommission-runbook.md](docs/core-decommission-runbook.md), and [docs/island-clustering-algorithm.md](docs/island-clustering-algorithm.md) for the archived record of how core clustered.

## Table of Contents

Expand All @@ -18,13 +20,14 @@ The Archipelago Workers is a monorepo containing three services that implement t

## Features

- **Core Service**: Implements island clustering algorithms that dynamically group users into islands based on their in-world positions. Manages peer-to-island assignments, processes position updates, and publishes island change notifications via NATS.
- **WebSocket Connector Service**: Provides real-time bidirectional WebSocket connections for Decentraland clients. Handles Ethereum-based authentication, routes real-time messages (positions, chat, profiles), and maintains peer registry.
- **Stats Service**: Aggregates information about islands and peers, providing REST API endpoints for monitoring, analytics, and observability of the Archipelago system.
- **WebSocket Connector Service**: Provides real-time bidirectional WebSocket connections for Decentraland clients. Handles Ethereum-based authentication, routes real-time messages (positions, chat, profiles), maintains the peer registry, and forwards island assignments to clients. Untouched by the migration.
- **Stats Service**: Aggregates information about islands and peers, providing REST API endpoints for monitoring, analytics, and observability. Its peer map is still built from client heartbeats; its island topology now comes from Pulse, so `GET /islands` reports cluster IDs as `C{n}` with `maxPeers: 0` (clusters are uncapped).

## Dependencies

- **[Realm Provider](https://github.com/decentraland/realm-provider/)**: Exposes WebSocket connections to Decentraland clients
- **Pulse**: Authors the peer clustering and publishes `engine.islands` / `engine.discovery`
- **comms-gatekeeper**: Mints LiveKit connection strings and publishes `engine.peer.{address}.island_changed`
- **[Catalyst](https://github.com/decentraland/catalyst)**: Content server for fetching scene data (used by stats service)
- **NATS**: Message broker for peer heartbeats, disconnect events, island changes, and discovery messages
- **@dcl/protocol**: Archipelago protocol definitions
Expand All @@ -44,7 +47,7 @@ The monorepo includes:

Before running this service, ensure you have the following installed:

- **Node.js**: Version 18.x or higher (LTS recommended)
- **Node.js**: Version 24.x — see `.nvmrc`; the Docker image pins `node:24-trixie-slim`
- **Yarn**: Version 1.22.x or higher
- **Docker**: For containerized deployment and local development dependencies

Expand Down Expand Up @@ -102,20 +105,26 @@ To run all services in development mode:
yarn start:local
```

This will start all three services:
- **Core Service**: Island clustering engine
This will start both services:
- **WebSocket Connector Service**: WebSocket gateway for clients
- **Stats Service**: REST API for monitoring and analytics

Neither produces island assignments. For a client to receive one locally you also need Pulse publishing to the same broker and comms-gatekeeper subscribed to it.

### NATS Messages

The services communicate via the following NATS message topics:

- `peer.${address}.heartbeat` - Peer heartbeat messages
- `peer.${address}.disconnect` - Peer disconnect events
- `engine.peer.${address}.island_changed` - Island assignment changes
- `engine.discovery` - Service discovery messages
- `engine.islands` - Island status reports
| Subject | Published by | Consumed by |
| --- | --- | --- |
| `peer.${address}.heartbeat` | WS Connector | Stats |
| `peer.${address}.disconnect` | WS Connector | Stats |
| `peer.${address}.cluster_change` | Pulse | comms-gatekeeper |
| `engine.peer.${address}.island_changed` | comms-gatekeeper | WS Connector |
| `engine.discovery` | Pulse | Stats — feeds `/core-status` |
| `engine.islands` | Pulse | Stats — feeds `/islands` |

Only the two `peer.*` subjects are published by this repo. `engine.islands` from Pulse reports cluster IDs as `C{n}` and `maxPeers: 0`; `GET /islands` passes both through unchanged.

## Testing

Expand Down Expand Up @@ -160,5 +169,5 @@ For detailed AI Agent context, see [docs/ai-agent-context.md](docs/ai-agent-cont

---

**Note**: This is a monorepo containing three separate services. Each service can be run independently, but they work together to provide the complete Archipelago communication system.
**Note**: This is a monorepo containing two separate services. Each can be run independently. They no longer form a complete communication system on their own — Pulse and comms-gatekeeper own the clustering and the LiveKit token minting.

27 changes: 0 additions & 27 deletions core/.env.default

This file was deleted.

11 changes: 0 additions & 11 deletions core/jest.config.js

This file was deleted.

53 changes: 0 additions & 53 deletions core/package.json

This file was deleted.

Loading
Loading