GithubHelp home page GithubHelp logo

0xerick / explorer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trxplorer/explorer

0.0 1.0 0.0 1.25 MB

TRON blockchain explorer

Shell 0.13% CSS 1.50% HTML 30.26% Java 67.98% SQLPL 0.13%

explorer's Introduction

Build Status

trxplorer

TRXPlorer.io - TRON blockchain explorer

TRXPlorer.io is a blockchain explorer for TRON

It is composed of 6 independent modules bundled together to form the explorer

  • tron-cli: is a simple client to query TRON fullnode / solidity node via GRPC
  • model: is a generated jooq based model that represents the whole blockchain schema into java classes. This model is generated from the database sql schema. This project is also using flyway in order to operate migrations between differents database patch
  • sync-node: is a standalone blockchain scanner it uses the previous model to fetch the data from the blockchain and put it into a database
  • search-engine: is an indexer that puts TX HASH/BLOCK HASH/TOKEN NAME etc ... into a redis instance in order to retrieve these informations easily and quickly from the explorer
  • api-server: is the api layer that queries the database and provide response into a json format, the api is deployed here: api.trxplorer.io
  • webapp: the explorer web application that uses the previous module to show the blockchain informations to the users, the application is deployed here: https://www.trxplorer.io

Build requirements

  • maven 3
  • jdk 8
  • docker (optional see below to skip)

Build process

A running instance of docker is required to build the project: the model requires a database in order to generate the java reprensentation of the sql schema.

When building the model: a maven plugin starts a docker container, runs flyway on all the database migrations files (see model/src/main/resources) and outputs the java / jooq sources into model/target/generated-sources

Building the project

git checkout [email protected]:trxplorer/explorer.git

$ cd explorer
$ mvn install

Running the explorer

In order to run the explorer, you will have to retrieve some data from TRON blockchain explorer first:

1. Synchronizing the database

The synchronization node (syncnode module) was built so that it can keep up with TRON high TPS. Multiple instance of the node can be run simultaneously in order to operate and sychronize quickly if necessary.

Start a mysql instance for example with docker

$ docker run --name mysql -e MYSQL_ROOT_PASSWORD=toto -p 3306:3306 -d mysql:5.7

Then create a schema with the name: trxplorer_dev. You don't have to do anything else, when you will run any of the server modules, flyway will take care of creating/migrate the database schema

To start a single synchronization node run:

$ cd sync-node
$ mvn jooby:run

To start multiple nodes simultaneously

Firs build the project

$ cd sync-node
$ mvn install

Then, you will have to assign a node id to each node while running it, by default the node has the id=1. A different port must be set too

For example, this will run two synchronization nodes, that will share the synchronization load

$ java -jar ./target/syncnode-<CurrenVersion>.jar dev application.port=8282 node.id=1 
$ java -jar ./target/syncnode-<CurrenVersion>.jar dev application.port=8383 node.id=2

2. Running the api server

$ cd api-server
$ mvn jooby:run

The api server is running on http://localhost:8383

3. Running the search engine (optional, if not present the webapp explorer will fallback on its default basic search engine)

The search engine is based on redisearch, you can start it as follow:

$ docker run --name redisearch -p 6379:6379 redislabs/redisearch:latest redis-server /data/redis.conf --loadmodule "/usr/lib/redis/modules/redisearch.so"

Then run the search engine:

$ mvn jooby:run

The search engine will start indexing the data and wil also server the search requests from the explorer

4. Running the webapp (the explorer)

$ cd webapp
$ mvn jooby:run

It will start the explorer on http://localhost:8080

explorer's People

Contributors

nfleury avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.