A service for orchestrating the availability of Asset Bundles and LODs.
The Asset Bundle Registry acts as a gateway, enabling clients to retrieve the available Asset Bundles and LODs for each deployed scene on the Decentraland network. It ensures that optimized textures are always available for a given set of pointers, improving user experience and preventing empty scenes to be seen in-world.
This service integrates with our event-driven architecture, monitoring deployments of Catalyst entities that require optimization before rendering in the reference client. The optimization process is handled by the Asset Bundle Converter and LODs Generator.
- Entity Deployment: An entity requiring optimization before client-side rendering is deployed to a Catalyst.
- Forwarding Events: The Deployments-to-SQS service forwards the deployment to the event-driven architecture using SNS as a bridge.
- Marking for Optimization:
- This service listens to deployment events (via SQS) and marks the entity as
pending
for optimization. - Simultaneously, the Asset Bundle Converter and LODs Generator receive the deployment in their respective queues for processing.
- This service listens to deployment events (via SQS) and marks the entity as
- Optimization Completion:
- Once the Asset Bundle Converter completes optimization, it publishes an
AssetBundleConversionFinished
event to the event-driven architecture. (See event schema).
- Once the Asset Bundle Converter completes optimization, it publishes an
- State Transition:
- The Registry listens for
AssetBundleConversionFinished
events. - Upon receiving confirmation that an entity has been optimized and is ready for client retrieval, the service updates the deployment state from
pending
tocomplete
.
- The Registry listens for
- Client Requests:
- When a client requests textures for a scene, emote, or wearable, the Registry queries its database for the most recent optimized texture and serves it to the client.
This criteria can evolve and change over time. As of the time of writing, this Registry marks an entity as ready to be retrieved when it receives confirmation that the deployed entity has been optimized for Windows and Mac platforms. At the moment, LODs are not being considered for this state transition.
Returns the service status, version, and commit hash information.
Response:
{
"data": {
"version": "1.0.0",
"currentTime": 1648744800000,
"commitHash": "abc123"
}
}
Returns the optimization status for a specific entity. Requires authentication. Only returns data if the requesting user is the entity deployer.
Response:
{
"catalyst": "complete",
"complete": true,
"assetBundles": {
"mac": "complete",
"windows": "complete"
},
"lods": {
"mac": "complete",
"windows": "complete"
}
}
Status Values:
pending
: Asset is queued for optimizationcomplete
: Asset has been successfully optimizedfailed
: Asset optimization failed
Returns the optimization status for all entities owned by the authenticated user.
Response:
[
{
"catalyst": "complete",
"complete": true,
"assetBundles": {
"mac": "complete",
"windows": "complete"
},
"lods": {
"mac": "complete",
"windows": "complete"
}
}
// ... more entities
]
Admin endpoint for registering new entities for optimization. Requires authentication using API_ADMIN_TOKEN
environment variable.
Request Body:
{
"entityIds": ["bafkreig..."]
}
Response:
{
"failures": [
{
"entityId": "bafkreig...",
"error": "Error message"
}
],
"successes": [
"bafkreig..."
]
}
Required environment variables:
PG_COMPONENT_PSQL_CONNECTION_STRING
or individual PostgreSQL connection variables:PG_COMPONENT_PSQL_USER
PG_COMPONENT_PSQL_DATABASE
PG_COMPONENT_PSQL_PORT
PG_COMPONENT_PSQL_HOST
PG_COMPONENT_PSQL_PASSWORD
CATALYST_LOADBALANCER_HOST
ASSET_BUNDLE_CDN_URL
AWS_SNS_ARN
AWS_SNS_ENDPOINT
AWS_SQS_ENDPOINT
To start a new, fresh database, run the following command:
docker-compose up
The /src/scripts
directory contains utility scripts for populating the Asset Bundle Registry with entities. These scripts run locally but interact with remote Asset Bundle Registry instances.
Available scripts:
yarn scripts:populate-items
: Process wearables/emotes from a CSV fileyarn scripts:populate-scenes
: Process scenes from World Manifest
For detailed information about script usage, environment variables, and file formats, see Scripts Documentation.
Copy .env.default
to .env
and set the required variables:
cp .env.default .env
yarn
yarn build
yarn start
yarn test