GithubHelp home page GithubHelp logo

isabella232 / indyscan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dedis/indyscan

0.0 0.0 0.0 3.68 MB

Hyperldger Indy Transaction Explorer

Home Page: https://indyscan.io

License: ISC License

Shell 28.90% JavaScript 68.25% CSS 0.38% HCL 1.27% Dockerfile 1.20%

indyscan's Introduction

Indyscan

Hyperledger Indy Transaction explorer

How it works

The daemon is periodically looking for new transactions. When new transaction is found, it's stored in MongoDB.

The WebApp queries MongoDB and displays the data. You can browse public Sovrin blockchain at https://indyscan.io.

Getting started

You have 2 main options:

  1. IndyPool + IndyScan locally

The easiest way to get started with Indy. Spins up Indy network locally with IndyScan explorer hooked up to the network out of the box.

  1. IndyPool + IndyScan in cloud

Good for development or sharing private browseable ledger with your coworkers.

DEV

Following is for those who want to contribute or tweak the code. Here's how to set up your native environment. So far only tested on Mac OS.

Structure

- start/               - automation to startup IndyScan (and optionally IndyPool)
- indyscan-api/        - http client to call indyscan api
- indyscan-webapp/     - nextjs web app
- indyscan-daemon/     - process looking for a new transactions
- indyscan-storage/    - shared library for app and daemon
- indyscan-txtype/     - shared library contaning information about indy tx types
- ubuntu-libindy/      - base docker image for daemon docker image
- build-all.sh         - script to build all the code into docker images
- docker-compose.yml   - for running indyscan locally in containers

Mongo

Startup your mongoDb instance. You can use Docker, and in such a case I recommend mount its data directory somewhere on your host, so you don't loose previously scanned transactions if you kill your mongo container. docker run --name local-indyscan-mongo -p 27017:27017 -v ~/indyscan/mainnet:/data/db -d mongo:3.4.18

Indyscan daemon

First ou need to make sure you've have compiled libindy for your system. Follow instructions on https://github.com/hyperledger/indy-sdk to do this. Startup transaction scanner daemon. In the daemon directory, run

npm install

Before you run daemon, the directory ~/.indy_client/pool in your machine should contain pool configurations. For example, in my case it contains these:

> ls ~/.indy_client/pool
SOVRIN_MAINNET SOVRIN_TESTNET

And each of these 2 directories contains genesis transactions for given network. If you don't have any pool configurations, you can quickly generate configurations for sovrin testnet and mainnet by running

npm run networks:add:sovrin

When we start indyscan daemon, we need to asur that variable INDY_NETWORKS is exported. It's value should be list of pool names separated by comma, matching pool names in your ~/.indy_client/pool directory. So for example, given content of my ~/.indy_client/pool shown in example above, I would start running daemon against these pool like this:

INDY_NETWORKS="SOVRIN_MAINNET,SOVRIN_TESTNET" npm run start

If everything falls in place, daemon will open connections to pools listed in INDY_NETWORKS environment variable based on their configuration inside ~/.indy_client/pool directory and start polling transactions from the 1st until the last. By default it fetches 2tx/per sec/per pool and slows down polling frequency once it discovers there's no more transactions left. Each transaction is saved to mongodb.

Webapp

Webapp reads tx data from mongo and presents it. You have to pass in the INDY_NETWORKS the same way like in case of the daemon so it knows which pools it should display. The first pool name specified in INDY_NETWORKS will be displayed on homepage by default.

cd app;
npm install
INDY_NETWORKS="SOVRIN_MAINNET,SOVRIN_TESTNET" npm run dev

indyscan's People

Contributors

blhagadorn avatar dependabot[bot] avatar patrik-stas 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.