Giter Club home page Giter Club logo

theta-infrastructure-ledger-explorer's Introduction

Theta Ledger Explorer

The Theta Ledger Explorer project contains a frontend web application for the Theta explorer, a backend api application to provide data to the frontend, and a blockchain data crawler to download data from the blockchain.

Please click here to see the Theta Ledger Explorer in action.

Blockchain Data Crawler

Setup

The job of blockchain data crawler is to download and convert the blockchain data to a format more friendly for blockchain data exploration. In our current implementation, it uses a NoSQL database MongoDB to store the converted data. Thus we need to install MongoDB first. Below is the instruction to install MongoDB on Ubuntu Linux. For more information on installing MongoDB on different systems, please check here.

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt-get update

sudo apt-get install -y mongodb-org

To start MongoDB, use following command.

sudo systemctl start mongod

After starting MongoDB, we can setup the config for crawler with the following commands.

cd backend/crawler
npm install
mv config.cfg.template config.cfg

Now the config.cfg file is created, change blockchain.startHeight in config file to the snapshot height on the theta node. After setting the config file and start height, we can run crawler using this command.

node run.js

Now the crawler starts to read the data from blockchain, perform necessary transformation, and stores the converted data in the database. Next we can launch the backend API microservice, and the frontend application microservice following the procedure below.

Backend API Application

Setup

cd backend/explorer-api
npm install
mv config.cfg.template config.cfg
node run

Now the explorer API application is running at https://localhost:8443

Frontend Web Application

Setup

cd frontend
npm install
mv src/config.js.template src/config.js

Development

npm run dev
gulp (in a new console window)

Gulp will tell you where to view the webpage for Live Reloading and automatically open a browser pointing there. (It proxies the original server in order to enable the live reloading) It should be https://localhost:3000. Any changes you make to scss or js files should be automatically refreshed in the browser.

To skip Live reloading:

gulp nosync

Then browse to the node server directly at: https://localhost:4000

Other Gulp tasks:

gulp build-js
gulp build-sass
gulp clean
gulp watch

License

The Theta Ledger Explorer reference implementation is licensed under the MIT License.

theta-infrastructure-ledger-explorer's People

Contributors

zhenyang-sliver avatar qinwei-gong avatar ryannichols avatar sim-sliver avatar jieyilong avatar adrienvinches avatar jaydp17 avatar weiribao 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.