Code Monkey home page Code Monkey logo

microscope-v2's Introduction

MIT CITAHub

English | 简体中文

Overview

Microscope v2(Microscope provides an easy-to-use user interface to inspect CITA)

About Microscope

Microscope is a blockchain explorer built with React for inspecting CITA. It supports searching block, transaction, account and invoking call method of smart contract. It also can work with ReBirth to display a list of blocks and transactions on specified conditions, or even analyzes CITA‘s working status.

Features

extend v1 features

  • Chain Meta Info、RealTime Block and Transaction Info、Advance Search、Switch Network

  • Block List、Block Detail、ReBirth Advance Query

  • Transaction List、Transaction Detail、ReBirth Advance Query

  • Address Account Blance、Transactions under the Address

  • Contract Online Query and Call

  • Static Chart

  • Mobile Access

v2 Improvement

  • Simplify Development/Debug Environment

  • Add RPC API/ ReBirth API List(edit sending-request and check response)

  • Optimize real-time Block/Transaction Polling; Fixed Page Crash

  • Fix/Optimize Advanced Search Function

  • Optimize Block/Transaction List Pagination

  • Add ERC20 Transactions Query

  • Internationalization files from relying on online services to switch to local JSON files

Run

  • Prerequisite

    node ^8.10.0 || ^10.13.0 || >=11.10.1

    yarn >=1.13.0

  • clone the repo

git clone https://github.com/citahub/microscope-v2/
  • Install Dependencies
yarn install
  • modify config in "src/utils/config.ts"

    const api: API = {
      serverList: [
        {
          name: 'Re-Birth Server',
          url: 'https://rebirth.citahub.com'
        },
        {
          name: 'CITA Node Server',
          url: 'https://testnet.citahub.com'
        }
      ],
      jsonRpc: '/',
      url: '/api/info/url',
      status: '/api/status',
      statistics: '/api/statistics',
      blockList: '/api/blocks',
      blockListV2: '/api/v2/blocks',
      transactionList: '/api/transactions',
      ercTransactionList: '/api/erc20/transfers'
    }
    
    const config: Config = {
      api: api,
      apiTimeout: 15000,
      apiTimeoutMsg: 'api timeout,try it later',
      apiErrorMsg: 'network error!',
      icpRecordName: '',
      icpRecordUrl: ''
    }
    
  • Develop Environment

yarn start
  • Production Environment
yarn build // the output directory could be copied to nginx webServer

Have one microscope quickly

Having a microscope on docker

  1. docker build -t microscope . build docker image
  2. docker run --name microscope -d -p 80:80 microscope run microscope on port 80

Directory Structure

  • /public --------------------- html/font/images assets

  • /src/index.tsx -------------- entrance

  • /src/layouts/app.tsx -------- App root, Page layout,global modal,loading,toast etc

  • /src/routes ---------------- route of all pages

  • /src/locale ---------------- i18 JSON files

  • /src/layout/ --------------- Page

  • /src/layouts/home/ ---------- Home page

  • /src/layouts/block/ --------- Block List、Block Detail

  • /src/layouts/transaction/ --- Transaction List、Transaction Detail

  • /src/layouts/address/ ------- Address detail

  • /src/layouts/static/ -------- Static Page

  • /src/layouts/api/ ----------- API list and API call simulation

  • /src/layouts/error/ --------- 404 Error Page

  • /src/layouts/search/ -------- Search Failed Page

  • /src/layouts/common --------- Transaction Table、Transaction Search Modal、Block Search Modal

  • /src/components/ ------------ Basic Components,header/content/footer/loading/tab/toast/modal

  • /src/components/redux ------- redux reduce/action/state

  • /src/utils/ ----------------- utils

  • /src/utils/dataAPI ---------- all data API,currently mainly dependent on ReBirthAPI file

  • /src/utils/rebirthAPI ------- package ReBirth interaction and citaSDK direct rpc interaction

library

microscope-v2's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar dont-see-big-shark avatar keith-cy avatar rainchen avatar rink1969 avatar udld avatar wuyuyue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

microscope-v2's Issues

Remove locize integration

The locize told me they were receiving requests from our site, but I've checked it has been removed from our code.

@travis-joe could you please have a look? Thanks.

I can not install microscope v2 successfully

here are the outputs. I've tried on several new Centos7 systems and got the same issue, so I put the trouble here:

[5/5] Building fresh packages...
[-/10] ⠐ waiting...
[-/10] ⠐ waiting...
[7/10] ⠐ scrypt
[6/10] ⠐ websocket
error /home/noel/microscope-v2/node_modules/sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /home/noel/microscope-v2/node_modules/sha3
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 2.7.5 found at "/usr/bin/python"
gyp http GET https://nodejs.org/download/release/v14.16.0/node-v14.16.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v14.16.0/node-v14.16.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v14.16.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v14.16.0/SHASUMS256.txt
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/noel/microscope-v2/node_modules/sha3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/noel/.cache/node-gyp/14.16.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/noel/.cache/node-gyp/14.16.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/noel/.cache/node-gyp/14.16.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/noel/microscope-v2/node_modules/sha3',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    options.duplicate_basename_check)
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 139, in Load
    params['parallel'], params['root_targets'])
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2783, in Load
    variables, includes, depth, check, True)
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 392, in LoadTargetBuildFile
    includes, True, check)
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 264, in LoadOneBuildFile
    aux_data, includes, check)
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 301, in LoadBuildFileIncludesIntoDict
    LoadOneBuildFile(include, data, aux_data, None, False, check),
  File "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 244, in LoadOneBuildFile
    None)
  File "/home/noel/.cache/node-gyp/14.16.0/include/node/common.gypi", line 151
    'Optimi
          ^
SyntaxError: EOL while scanning string literal
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 3.10.0-862.el7.x86_64
gyp ERR! command "/usr/local/src/node-v14/bin/node" "/usr/local/src/node-v14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/noel/microscope-v2/node_modules/sha3

image

I install microscope v2 failed

I've tried on several new Centos7.8 systems and install failed, so I put the trouble here:

[3/5] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=12". Got "10.22.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

if i use node v12, i will get the error:

gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1

How can I solve this problem

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.