Giter Club home page Giter Club logo

explorer2's Introduction

AMO Blockchain Explorer v2

For AMO blockchain explorer v1, see old repository.

Introduction

TBA

Test run

For development testing

Build

Install

For production use

Web server setup

Use static web server for client web app.

Support service setup

  • node.js server
    • server location
    • API endpoint
  • mysql server
    • DB location
    • DB api endpoint

Server API

The server API implements RESTful API with the following URIs. All URIs will give application/json type document. All list items will use descending order.

Networks

  • GET /networks
    • get available networks

Chain

  • GET /chain/{chain_id}
    • get summary of a chain

Genesis

  • GET /chain/{chain_id}/genesis
    • get genesis document (json)

Blocks

  • GET /chain/{chain_id}/blocks
    • get list of blocks
      • anchor: anchor height (default 0, which means latest block)
      • from: offset from anchor (default 0)
      • num: number of blocks to retrieve (default 20)
  • GET /chain/{chain_id}/blocks?stat
    • get stat of blocks
      • non_empty: exclude empty blocks (default false)
      • num_blks: stat range as a number of blocks (default all, CAUTION!)
  • GET /chain/{chain_id}/blocks/{height}
    • get one block
  • GET /chain/{chain_id}/blocks/{height}/txs
    • get lsit of txs included in a block
      • from: offset from anchor (default 0)
      • num: number of blocks to retrieve (default 20)
  • GET /chain/{chain_id}/blocks/{height}/txs/{index}
    • get one txs in a block with an {index}

Txs

NOTE: Each tx is identified by a block height and an index within the block.

  • GET /chain/{chain_id}/txs
    • get list of txs
      • top: anchor height
      • from: offset from anchor (default 0)
      • num: number of txs to retrieve (default 20)
  • GET /chain/{chain_id}/txs?stat
    • get stat of txs
      • num_txs: stat range as a number of txs (default all, CAUTION!)
  • GET /chain/{chain_id}/txs/{hash}
    • get one tx

Accounts

  • GET /chain/{chain_id}/accounts
    • SHOULD NOT BE USED
      • from
      • num
  • GET /chain/{chain_id}/accounts/{address}
    • get one account
  • GET /chain/{chain_id}/accounts/{address}/txs
    • get list of txs sent by an account
      • top: anchor height (default 0, which means latest block)
      • from: offset from anchor (default 0)
      • num: number of txs to retrieve (default 20)

Validators

  • GET /chain/{chain_id}/validators
    • get list of validators
      • from: offset (default 0)
      • num: number of validators to retrieve (default 20)
  • GET /chain/{chain_id}/validators?stat
    • get stat of validators
      • num_blks: stat range as a number of blocks (default all, CAUTION!)
  • GET /chain/{chain_id}/validators/{address}
    • get one validator
  • GET /chain/{chain_id}/validators/{address}/delegators
    • get list of delegators for this validator
      • from: offset (default 0)
      • num: number of delegators to retrieve (default 20)

Drafts

  • GET /chain/{chain_id}/drafts
    • get list of drafts
      • anchor: anchor id (default 0, which means latest draft id)
      • from: offset from anchor (default 0)
      • num: number of blocks to retrieve (default 20)
  • GET /chain/{chain_id}/drafts?stat (N/A)
    • get stat of drafts
      • num_blks: stat range as a number of blocks (default all, CAUTION!)
  • GET /chain/{chain_id}/drafts/{draft_id}
    • get one draft
  • GET /chain/{chain_id}/drafts/{draft_id}/votes
    • get list of votes for the draft
  • GET /chain/{chain_id}/drafts/{draft_id}/votes?absent
    • get list of absent votes for the draft

Config

  • GET /chain/{chain_id}/config (N/A)
    • get AMO config of the chain

Storages

  • GET /chain/{chain_id}/storages (N/A)
    • get lis tof storages
  • GET /chain/{chain_id}/storages/{storage_id}
    • get one storage

Parcels

  • GET /chain/{chain_id}/parcels (N/A)
    • get list of parcels
  • GET /chain/{chain_id}/parcels/{parcel_id}
    • get one parcel
  • GET /chain/{chain_id}/parcels/{parcel_id}/requests
    • get list of requests on the parcel
      • from: offset (default 0)
      • num: number of items to retrieve (default 20)
  • GET /chain/{chain_id}/parcels/{parcel_id}/requests/{address} (N/A)
    • get list of request on the parcel from an account
  • GET /chain/{chain_id}/requests/{parcel_id} (N/A)
    • alias of GET /chains/{chain_id}/parcels/{parcel_id}/requests
  • GET /chain/{chain_id}/requests/{parcel_id}/{address} (N/A)
    • alias of GET /chains/{chain_id}/parcels/{parcel_id}/requests/{address}

explorer2's People

Contributors

lbird avatar h0n9 avatar sedyn avatar dependabot[bot] avatar hwangjungsik avatar

Stargazers

Minwoo Nam avatar

Watchers

James Cloos avatar  avatar

explorer2's Issues

Add support for DID and VC

Follow-up to amolabs/amoabci#303.

  • add tx_did_claim handler
  • add tx_did_dismiss handler
  • add tx_did_issue handler
  • add tx_did_revoke handler
  • add s_dids table
  • add s_vcs table
  • add r_did_tx table
  • add r_vc_tx table

Misc explorer api features

  • incentive history
  • validator work stat (produced blocks, signed blocks, etc...)
  • penalty history (along with amoabci v1.7)
  • parcel and storage stat
    • recently registered parcels
    • storage list
    • individual storage stat

Resolve db warning logs

Following db log appears consistently for some reason:

[Warning] Aborted connection 834639 to db: 'explorer' user: 'explorer' host: '192.168.x.x' (Got an error reading communication packets)

Find out the reason and resolve it!

[react] Display time with proper timezone

Use the following datetime format:
0000-00-00 00:00:00.000 +0900 (timezone abbrev)

timezone abbrev: e.g. KST, UTC, DST etc...

use the client(web browser)'s local timezone

[react] make the search box work

use the following search key types:

  • decimal number: block height
  • 40-character hexadecimal: account address
  • 64-character hexadecimal: transaction hash

Crawler speed

Although the crawling speed is improved for sparse txs cases by the commit 2d783d6. It is still expected to have a rather low speed for dense txs cases. Improve it.

Crawl TM events

sub-issue of #6 referring to amolabs/amoabci#251

Crawl the following events:

  • begin block events
    • protocol change "type": "protocol_upgrade"
  • end block events
    • draft status change "type": "draft"
    • config change "type": "config"
    • stake unlock "type": "stake_unlock"
    • balance change without explicit tx
      • incentive "type": "incentive"
      • penalty "type": "penalty"
      • disposition of draft deposit "type": "draft_deposit"
  • tx events
    • draft proposal with mediated config "type": "draft"

Dockerize explorer apps

Targets to dockerize are as follows:

  • crawler(collector + builder)
  • crawler(nodes)
  • api-server
  • web(react)

Purpose:

  • simplify deployment
  • ease app maintenance
  • get prepared for applying k8s 🐳

Account query bug

When an account has no records in s_accounts table associated with the given address, API would respond with 404 not found. But it is still possible this account has some activities related with, for example, parcel register or storage setup or whatever. API should give a empty response instead of not found.

Add relation tables

Add relation tables for rich inspection feature:

  • account address - block height (affected accounts by a block events)
  • account address - tx height and index (affected accounts by a tx payload or event)
  • parcel id - tx height and index (affected parcels by a tx payload or event)

검색창 개선

검색창을 이용해서 검색을 수행한 상태에서 다른 주소나 height 등을 다시 검색창에 넣으면 검색이 수행되지 않음.

Rich Account inspection page

Account page

  • Basic information
  • Multi-tab table
    • List of txs sent by this account
    • List of incentive records
    • List of penalty records
    • List of balance change records
      • tx fee
      • change by txs: transfer, stake, withdraw, delegate, retract, register, request, cancel, grant, propose
      • change by events: incentive, draft deposit (penalty is about stake, not balance)

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.