Skip to main content

List your dapp on the Chromia Mainnet Vault

This guide provides step-by-step instructions for listing your decentralized application (dapp) on the Chromia Mainnet Vault. Following these steps will make your dapp discoverable to users and streamline the onboarding process.

Prerequisites

  • A deployed dapp on the Chromia Mainnet
  • Access to your dapp's codebase
  • Media files for your dapp (icons, screenshots, etc.)

Steps to the listing

To list your dapp, you need to implement the following query and supporting functions in your dapp's codebase:

  1. Implement the required query and functions:

    • Integrate the find_dapp_details query into your dapp's codebase. This query retrieves and formats your dapp's details.

      query find_dapp_details(dapp_rowid: rowid, requested_content_types: list<dapps.dapp_content_type>? = null)
    • Implement the supporting functions:

      • map_dapp_details: Maps dapp details, including associated blockchains and media content.

        function map_dapp_details(dapp, requested_content_types: list<dapp_content_type>? = null) {
        val blockchains = find_and_map_dapp_blockchains(dapp);
        val dapp_media = if (not empty(requested_content_types)) find_and_map_dapp_media(
        dapp,
        requested_content_types
        ) else null;

        return (
        rowid = dapp.rowid,
        name = dapp.name,
        description = dapp.description,
        launch_url = dapp.launch_url,
        genre = dapp.genre,
        chain_list = blockchains,
        content = dapp_media
        ).to_gtv_pretty();
        }
      • find_and_map_dapp_blockchains: Retrieves and maps blockchains your dapp interacts with.

        function find_and_map_dapp_blockchains(dapp) =
        blockchain @* { dapp } (
        @omit @sort .rowid,
        name = .name,
        brid = .brid,
        role = .role
        );
      • find_and_map_dapp_media: Retrieves and maps media content associated with your dapp (e.g., screenshots, icons).

        function find_and_map_dapp_media(dapp, requested_content_types: list<dapp_content_type>) =
        dapp_media @* {
        dapp,
        .type in requested_content_types
        } (
        @omit @sort .rowid,
        name = .name,
        url = .url,
        type = .type
        );
  2. Prepare your media content:

    • Upload your media files (screenshots, icons, etc.) to Filehub, a decentralized storage solution.
    • Within the find_and_map_dapp_media function, map the URLs of your uploaded media files.
  3. Automatic listing:

    • Once you've implemented the query and functions, your dapp will be automatically listed in the Chromia Mainnet Vault based on the information it provides.
  4. Verification for a checkmark (optional):

    • To receive a verified checkmark on the Vault:
      1. Contact the Chromia team admin for final verification.
      2. They will review your dapp to ensure it meets their quality standards.

Example usage

Here’s an example implementation of the find_dapp_details query:

query find_dapp_details(dapp_rowid: rowid, requested_content_types: list<dapp_content_type>? = null) {
val dapp = get_dapp_by_rowid(dapp_rowid);
return map_dapp_details(dapp, requested_content_types);
}

function get_dapp_by_rowid(dapp_rowid: rowid) =
dapp @ { .rowid = dapp_rowid } (
rowid = .rowid,
name = .name,
description = .description,
launch_url = .launch_url,
genre = .genre
);

The data in the example is stored in the following entities.

entity dapp {
key name;
mutable description: text = "";
mutable launch_url: text = "";
mutable genre: text = "";
}

entity dapp_media {
key dapp, name;
mutable url: text = "";
type: dapp_content_type;
}

entity blockchain {
key dapp, brid: byte_array;
index brid;
index mutable name: text;
mutable role: text;
}

Example of storing the data

To store the required data, use the setUpMocks.ts script with the Filehub media links. For more details, refer to the following GitLab repository: GitLab: dapp-aggregator setupMocks.ts.