Building dapps on Chromia
A decentralized application, or dapp, consists of various components that work together to serve a valuable purpose for users. Its decentralized functionality allows users to operate it without relying on a single company for control.
On Chromia, dapps have two main parts:
- The user-facing side: This is what users see and interact with, including buttons and screens. It acts as the storefront of your dapp.
- The decentralized backend: This core component runs on a specialized database known as a blockchain. Here, the real magic happens, ensuring security and transparency.
To build this backend, you will use Chromia's own programming language called Rell. Think of Rell as a toolkit designed specifically for constructing dapp backends on Chromia.
The structure of a decentralized application built in Rell resembles the following:
In Rell, you manage requests through two types of actions:
- Data-modifying requests (Operations): These requests modify the state of the database.
- Data-retrieving requests (Queries): These requests retrieve data from the database.
Relational operators play a crucial role in handling both types of requests, allowing you to leverage the power of relational programming concepts.
To learn Rell from the ground up, consider participating in the Rell Masterclass.
After you develop your dapp, you can quickly deploy and update it to Chromia's public testnet or mainnet. The deployment process remains straightforward and well-documented, making it easy for you to bring your decentralized application to life on Chromia's blockchain network.
How does the user interface connect to the backend? Chromia provides a postchain-client that allows you to link your dapp's frontend to the decentralized backend running on Chromia's blockchain network. This client library enables you to send transactions and retrieve information from a blockchain node using Rell.
You can choose from the following client libraries to interact with your dapps:
Library | Description |
---|---|
JavaScript/TypeScript | The JavaScript/TypeScript client library, known as postchain-client, provides functionality for interacting with a blockchain using JavaScript or TypeScript. |
REST Tool | The REST client offers a simple set of tools accessible through a web interface, allowing users to write to and query the blockchain without needing to install anything. |
Kotlin | The Kotlin client library, postchain-client, enables you to interact with a blockchain from a client app written in Kotlin or Java. |
C# | The client library known as postchain-client allows you to interact with a blockchain using C#. |
Rust | The Rust client offers a set of tools for interacting with the Chromia blockchain using the Rust programming language. It allows developers to perform queries, submit transactions, and manage blockchain operations in both single-node and multi-node setups. |
Python | Designed for Python developers, this client provides a convenient way to connect with the Chromia blockchain. It facilitates transaction handling, data querying, and the creation of decentralized applications, all through a Pythonic interface. |
Next steps
Next, we will explore dapp hosting fees in more detail and discuss the origins of the tokens used to reward Providers. Hosting fees and provider rewards form the backbone of Chromia's tokenomics model.