GithubHelp home page GithubHelp logo

johnsonchenchina / etherscan-explorer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bing-chou/etherscan-explorer

0.0 1.0 0.0 19.59 MB

Yet another implementation of etherscan.io

License: GNU General Public License v3.0

JavaScript 1.93% Vue 5.46% CSS 0.10% HTML 0.08% Java 90.80% Shell 0.15% Makefile 0.46% Batchfile 0.42% Python 0.59%

etherscan-explorer's Introduction

etherscan-explorer

Yet another implementation of etherscan.io

A preview is here ==> http://47.105.121.164/#/

web3j-app

It is a java project using spring boot and web3j. Jdk8, Gradle and Mysql should be pre-installed.

The folder web3j-app/app is the core module doing sync job and providing rest api for frontend.

The project should be started after geth, because it will use geth ipc file to sync blockchain data to mysql.

Custom configurations are made in files:

  1. web3j-app/app/src/main/resources/application.properties

  2. web3j-app/app/src/main/java/me/bing/web3j/app/common/Constant.java

  3. web3j-app/app/src/main/resources/logback.xml

By default:

//web3j-app/app/src/main/java/me/bing/web3j/app/common/Constant.java

public static String IpcAddress = "/Users/bing/test/data/geth.ipc";
public static String CapAddress = "https://api.coinmarketcap.com/v1/ticker/ethereum/";
#web3j-app/app/src/main/resources/application.properties

spring.datasource.url = jdbc:mysql://localhost:3306/eth_test?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username = root
<!--/data/applogs should be accessable-->

<property name="log_path" value="/data/applogs/web3j-app"/>

frontend

It is a project copied from https://github.com/nebulasio/explorer/tree/develop/explorer-front with little modification.

npm run dev # start in development
npm run build # build html&js which are in dist folder

Depoly on server

  1. Pre-installation

    Nginx, Mysql, Java8, Geth

  2. build frontend, target directory is dist

cp dist/* /var/www/html
  1. build web3j-app, target jar is app/build/web3j-app-1.0.0.jar

  2. configure mysql, if you donot want to set your root password

use mysql;
update user set authentication_string=PASSWORD("") where User='root';
update user set plugin="mysql_native_password" where User='root';

create tables with these schemes

  1. It is recommanded to run geth via systemd
#/etc/systemd/system/geth.service

[Unit]
Description=geth

[Service]
Type=simple
User=root
Restart=always
WorkingDirectory=/root/webapp
ExecStart=/usr/bin/geth --datadir /Users/bing/test/data > geth.log

[Install]
WantedBy=default.target
#/etc/systemd/system/web3japp.service

[Unit]
Description=web3japp
After=geth.service

[Service]
Type=simple
User=root
Restart=always
WorkingDirectory=/root/webapp
ExecStart=/usr/bin/java -jar web3j-app-1.0.0.jar > app.log

[Install]
WantedBy=default.target
systemctl daemon-reload
systemctl enable geth && systemctl enable web3japp
systemctl start geth && systemctl start web3japp && systemctl restart nginx

Your contributions are welcome

The author is a newbie of gradle and vue, so there must be contributions you are willing to contribute.

etherscan-explorer's People

Contributors

bing-chou 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.