Development

Codebase overview

Below you can find a breakdown of the Blobscan's codebase.

Architecture

Blobscan.com is comprised of the following major components:

  • Web App: A Next.js application hosted on Vercel that spins up a tRPC API that communicates with the database via Prisma. It also uses Tailwind CSS for styling.
  • REST API: An express app that runs the tRPC API with OpenAPI support. It exposes some of the tRPC API endpoints as REST endpoints for the public and external services such as the indexer.
  • Indexer: A Rust service that listens to the Ethereum blockchain looking for blocks and transactions containing blobs and forwards them to the REST API to be indexed.

Repository structure

Blobscan is a monorepo managed with Turborepo which contains two main folders: apps and packages.

The indexer is not part of the monorepo and it's located in a separate repository.

Apps

Blobscan is composed of the following apps:

AppDescription
@blobscan/docsNextjs app that contains the documentation.
@blobscan/webNextjs app that contains the web app.
@blobscan/rest-api-serverExpress app that contains the REST API.

CLI

Blobscan has the following command line interfaces:

CLIDescription
@blobscan/blob-propagation-jobs-cliCLI to run the blob propagation jobs.
@blobscan/stats-aggregation-cliCLI to run the stats aggregation jobs.

Packages

Here you can find all the shared packages used by the apps:

PackageDescription
@blobscan/apitRPC routers and procedures used by the web app and the REST API
@blobscan/@blobscan/blob-propagatorMechanism for propagating blob data across various storage systems through bullmq sandboxed workers.
@blobscan/blob-storage-managerOrchestrates the storage/retrieval of blobs in/from different storage providers. Currently it supports Google Cloud Storage, Swarm, and PostgreSQL database.
@blobscan/dayjsExtended Day.js with plugins.
@blobscan/dbPrisma schema and a Prisma client with extensions containing custom methods queries.
@blobscan/loggerShared logger utilities.
@blobscan/open-telemetryOtel configuration and sdk setup.
@blobscan/testShared test utilities and fixtures.
@blobscan/zodShared Zod schemas and utilities.
@blobscan/eth-formatProvides utility functions for handling Ethereum value conversions and formatting.

Tooling

Blobscan uses the following tools:

ToolDescription
@blobscan/eslintESLint configuration shared across all packages.
@blobscan/githubGitHub actions shared.
@blobscan/svgo-configSvgo configuration.
@blobscan/tailwind-configTailwind configuration shared across all packages.
@blobscan/typescriptTypescript configuration shared across all packages.
Previous
Funding