Skip to content

zulu-network/zulu-prime-block-explorer

 
 

ZuluPrime Block Explorer

Online blockchain browser for viewing and analyzing ZuluPrime blockchain.

📌 Overview

This repository is a monorepo consisting of 4 packages:

  • Worker - an indexer service for ZuluPrime blockchain data. The purpose of the service is to read blockchain data in real time, transform it and fill in it's database with the data in a way that makes it easy to be queried by the API service.
  • Data Fetcher - a service that exposes and implements an HTTP endpoint to retrieve aggregated data for a certain block / range of blocks from the blockchain. This endpoint is called by the Worker service.
  • API - a service providing Web API for retrieving structured ZuluPrime blockchain data collected by Worker. It connects to the Worker's database to be able to query the collected data.
  • App - a front-end app providing an easy-to-use interface for users to view and inspect transactions, blocks, contracts and more. It makes requests to the API to get the data and presents it in a way that's easy to read and understand.

🏛 Architecture

The following diagram illustrates how are the block explorer components connected:

flowchart
  subgraph blockchain[Blockchain]
    Blockchain[ZuluPrime JSON-RPC API]
  end

  subgraph explorer[Block explorer]
    Database[("Block explorer DB<br/>(PostgreSQL)")]
    Worker(Worker service)
    Data-Fetcher(Data Fetcher service)
    API(API service)
    App(App)
    
    Worker-."Request aggregated data (HTTP)".->Data-Fetcher
    Data-Fetcher-."Request data (HTTP)".->Blockchain
    Worker-.Save processed data.->Database

    API-.Query data.->Database
    App-."Request data (HTTP)".->API
    App-."Request data (HTTP)".->Blockchain
  end

  Worker-."Request data (HTTP)".->Blockchain

Worker service retrieves aggregated data from the Data Fetcher via HTTP and also directly from the blockchain using ZuluPrime JSON-RPC API, processes it and saves into the database. API service is connected to the same database where it gets the data from to handle API requests. It performs only read requests to the database. The front-end App makes HTTP calls to the Block Explorer API to get blockchain data and to the ZuluPrime JSON-RPC API for reading contracts, performing transactions etc.

🚀 Features

  • ✅ View transactions, blocks, transfers and logs.
  • ✅ Inspect accounts, contracts, tokens and balances.
  • ✅ Verify smart contracts.
  • ✅ Interact with smart contracts.
  • ✅ Standalone HTTP API.
  • ✅ Local node support.

🛠 How to RUn

📋 Prerequisites

  • Ensure you have node >= 18.0.0 and npm >= 9.0.0 installed.

🛠 Installation

npm install

👨‍💻 Running locally

Before running the solution, make sure you have a database server up and running, you have created a database and set up all the required environment variables. To create a database run the following command:

npm run db:create

To run all the packages (Worker, Data Fetcher, API and front-end App) in development mode run the following command from the root directory.

npm run dev

For production mode run:

npm run build
npm run start

Each component can also be started individually. Follow individual packages README for details.

🐳 Running in Docker

make start_local

🕵️‍♂️ Testing

Run unit tests for all packages:

npm run test

Run e2e tests for all packages:

npm run test:e2e

Run tests for a specific package:

npm run test -w {package}

For more details on testing please check individual packages README.

Acknowledge

ZuluPrime Block Explorer leverages the power of zksync-block-explorer from Matter Labs.

About

ZuluPrime Block Explorer

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 83.9%
  • Vue 13.2%
  • Gherkin 2.1%
  • JavaScript 0.4%
  • MDX 0.2%
  • Dockerfile 0.1%
  • Other 0.1%