Skip to content
shleger edited this page Apr 23, 2024 · 30 revisions

Architecture Overview

Rosetta API for Cardano Blockchain

Context

This solution is an implementation of the Rosetta API specification for Cardano Blockchain.

Here and below we use C4 notation to describe the solution architecture.

Figure 1. Context Diagram

Context Diagram

The specific changes in this implementation can be found in cardano-specific-api-additions

To use this Rosetta API for Cardano you can build the project from source or use the pre-built docker image.

TODO -- insert link to docker image

The solution provides Construction API (mutation of data) and Data API (read data) with REST API that allows you to interact with the Cardano blockchain in a standard for Rosetta API way:

Implementation

The solution consist of the following four components:

  • Cardano Node
  • Yaci Indexer App (extended from yaci-store)
  • Rosetta API App
  • Database

This solution relies on the Cardano Node to provide the blockchain data. The Cardano Node is a full node that stores the entire history of the Cardano blockchain. The Cardano Node is used to query the blockchain data and to submit transactions to the blockchain.

Yaci Indexer App retrieves data on per block basis from the Cardano Node and stores it in a database. The data stored in efficient way that is only required by the Rosetta API.

Rosetta API App in case of Data API read data from the database and in case of Construction API it uses Cardano Node to submit transactions to the blockchain.

Figure 2. Component Diagram

Component Diagram

Cardano Node

The Cardano node is the top-level component within the network. Network nodes connect to each other within the networking layer, which is the driving force for delivering information exchange requirements. This includes new block diffusion and transaction information for establishing a better data flow. Cardano nodes maintain connections with peers that have been chosen via a custom peer-selection process. https://docs.cardano.org/learn/cardano-node

Yaci Indexer App

For indexing data from Cardano Blockchain we are using yaci-store project. This project provides a set of Spring Boot starters with customization possibility.

To limit data footprint we use a set of mappers to map Cardano Blockchain block data to the data only required by the Rosetta API.

Rosetta API App

The Rosetta API App is a Spring Boot application that provides a REST API for interacting with the Cardano blockchain.

For Data API it reads aggregated data from the database.

For Construction API it sends transactions into Cardano Blockchain using cardano-client-lib

Database

You can use any relational database, such as MySql, Postgres SQL or H2 database. The scheme is created automatically by the application (JPA).

Deployment

TODO: Add link to helm chart / docker compose files

We provide two modes of deployment:

  • All-in-one container mode (packing everything into one container)
  • Docker compose with multiple containers

Rosetta API deployment documentation can be found here: Docker deployment

Figure 3. Container Diagram Container Diagram