Giter VIP home page Giter VIP logo

tlip / ethereum-block-explorer Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 1.0 3.7 MB

A basic Ethereum block explorer written in TypeScript that updates in real-time using websockets

Home Page: http://explorer.thom.li

Dockerfile 0.72% JavaScript 4.70% TypeScript 75.77% CSS 5.51% Shell 0.09% SCSS 13.21%
ethereum blockchain block-explorer web3 crypto cryptocurrency cryptocurrency-price-ticker javascript typescript socketio

ethereum-block-explorer's Introduction

Ethereum Block Explorer

███████╗████████╗██╗  ██╗███████╗██████╗ ███████╗██╗   ██╗███╗   ███╗
██╔════╝╚══██╔══╝██║  ██║██╔════╝██╔══██╗██╔════╝██║   ██║████╗ ████║
█████╗     ██║   ███████║█████╗  ██████╔╝█████╗  ██║   ██║██╔████╔██║
██╔══╝     ██║   ██╔══██║██╔══╝  ██╔══██╗██╔══╝  ██║   ██║██║╚██╔╝██║
███████╗   ██║   ██║  ██║███████╗██║  ██║███████╗╚██████╔╝██║ ╚═╝ ██║
╚══════╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚══════╝ ╚═════╝ ╚═╝     ╚═╝
                                                                     
            ██████╗ ██╗      ██████╗  ██████╗██╗  ██╗                
            ██╔══██╗██║     ██╔═══██╗██╔════╝██║ ██╔╝                
            ██████╔╝██║     ██║   ██║██║     █████╔╝                 
            ██╔══██╗██║     ██║   ██║██║     ██╔═██╗                 
            ██████╔╝███████╗╚██████╔╝╚██████╗██║  ██╗                
            ╚═════╝ ╚══════╝ ╚═════╝  ╚═════╝╚═╝  ╚═╝                
                                                                     
███████╗██╗  ██╗██████╗ ██╗      ██████╗ ██████╗ ███████╗██████╗     
██╔════╝╚██╗██╔╝██╔══██╗██║     ██╔═══██╗██╔══██╗██╔════╝██╔══██╗    
█████╗   ╚███╔╝ ██████╔╝██║     ██║   ██║██████╔╝█████╗  ██████╔╝    
██╔══╝   ██╔██╗ ██╔═══╝ ██║     ██║   ██║██╔══██╗██╔══╝  ██╔══██╗    
███████╗██╔╝ ██╗██║     ███████╗╚██████╔╝██║  ██║███████╗██║  ██║    
╚══════╝╚═╝  ╚═╝╚═╝     ╚══════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝                                                            

...is obviously an Ethereum block explorer that updates in real-time by hooking into Infura's websocket API. It is rendered on the server side, is written in Typescript, and built with React v16.18. It manages Web3 data in the App state by using React's useReducer hooks wrapped in Context higher-order components to bless any component with direct access to anything it needs.

Demo

Want to check out a live action demo?

Getting started

  1. Make sure you have:
    • node v10.13.0+
    • npm | yarn
    • a computer
  2. Clone this repository
  3. cd <CLONED_DIRECTORY>
  4. yarn if you're of the persuarion, else npm i

Building and running

$ npm run build && npm run start:prod

Running dev mode

$ npm start

Notes

  • Operates one block behind current block
    • Temporary fix because sometimes calling web3.eth.getBlock(BLOCK_NUMER) for the newest block would return null.
  • Doesn't reconnect to websocket if it closes after inactivity (Infura disconnects after 1 hour unless pinged).

TO-DO

  • Add # MORE TXs at the bottom of the block cards when over TX count is >100.
  • Add ability to expand card to view overflow transactions.
  • Add transaction USD price data from CoinMarketCap or CryptoCompare.
  • Add more tests (only 1 right now, sorry).

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.