Git Product home page Git Product logo

eosmonitor.info's Introduction

eosmonitor.info

A Simple Explorer tool for EOS.IO (Testnet)

Intro

Functions:

  1. get_info to check latest Chain status
  2. List last 10 Accounts, Blocks, Transactions, Messages
  3. Query Account info by _id or Account Name
  4. List last 10 Transactions & Messages for Account
  5. Query Block, Transaction & Message by _id or block_id, transaction_id

For each testnet, it need a host to run eosd for replay chain data and push to mongodb.

eosmonitor.info connect to Testnet1.eos.io. If you like to include your testnet into it, you can setup the backend API and raise a Issue or PR to add the Endpoint into frontend page.

Data flow:

EOS Testnet -> local eosd -> mongodb -> nodejs api -> frontend page

This system relay on local eosd and the mongodb it connect to. If the eosd process crashed, mongodb will not refreshing. When you restart eosd, it take a while to sync from tesetnet and replay. During sync process, the explorer/monitor only display the latest data in mongodb.

As of today (2018/01/22), testnet1.eos.io chain have 5.951GB data in mongodb database.

11,482    Accounts
1,993,315 Blocks
1,311,566 Transactions
1,317,227 Messages

Background

EOS.IO

Block.One

EOS on CoinMarketCap

EOS Go - Blockchain Launch Community

EOS.IO Github

Document

Register for Testnet1.eos.io

Build eosd, enable mongodb support in db_plugin

Getting EOS code

Install MongoDB support

This is the part that missing in official wiki document.

Make a full build to compile db_plugin with mongodb

Check the build log to see anything mentions MongoDB or DB Schema.

Test eosd with MongoDB

Run eosd test with mongodb

$EOS_HOME\tests\eosd_run_mongodb_test.sh

Check stderr.txt for error messages

Run mongodb client to explorer the Database "EOStest" generated by test script. If you find Collections "Accounts", "Blocks", "Messages", "Transactions", we are ready to go.

$ mongo

> show dbs
EOStest  0.078GB
admin    (empty)
local    0.078GB

> use EOStest
switched to db EOStest

> show collections
Accounts
Blocks
Messages
Transactions
system.indexes

Modify config.ini to enable db_plugin and mongodb-url, run eosd and connect to a testnet (testnet1.eos.io) endpoint.

There is a script & config.ini for testnet connection in $EOS_HOME/script/ dir.

access-control-allow-origin = *
access-control-allow-headers = *

http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9877
p2p-server-address = <server public ip address>:9877
allowed-connection = any
p2p-peer-address = p2p-testnet1.eos.io:9876

plugin = eosio::db_plugin
mongodb-uri = mongodb://localhost:27017/EOSmain

!!! IMPORTANT !!! Mongodb open 27017 port without password by default. Please make sure you are only allow traffic from localhost and not listen to 0.0.0.0.

I run eosd, mongodb and NodeJs API on the same EC2 instance and use AWS Security Group inbound rules to cover this issue.

Install and launch Backend API

After eosd start it began to sync and push data into mongoDB.

Install express and moongodb dependency

npm install -S express mongodb

Single file app.js for the API part.

$ node api.js

To running on production environment, you should put more bells and whistles like

  1. pm2 or supervisor for process management;

  2. Nginx reverse proxy;

  3. Load balancer for mulitple instances.

Front end page

Change the Testnet Endpoint URL in "index.html" and place it to anywhere that can host static web page. eosmonitor.info use AWS S3 bucket with Static website hosting.

Summary

This is simple tool for eos developer, not follow engineering best practices.

Welcome to contribute and deploy your own node.

Cheers!

To support: ETH: 0x6603a0f83BfaFdA520694e23daA9aDd8d794ba10

eosmonitor.info's People

Contributors

perebor3 avatar

Watchers

Howard Carollo 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.