• Stars
    star
    1,394
  • Rank 33,705 (Top 0.7 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Blockchain Explorer

GitHub release (latest SemVer) Docker Pulls node-current
Build Status CII Best Practice Documentation Status Language grade: JavaScript Total alerts Quality Gate Status

Explorer is a simple, powerful, easy-to-use, well-maintained, open-source utility to browse activity on the underlying blockchain network. Users can configure and build Hyperledger Explorer on macOS and Ubuntu.

Update! Explorer now can be used with Hyperledger Iroha. For Iroha support, please switch to iroha-integration branch and read this README for instructions on how to use it.

Release Notes

Explorer Version Fabric Version Supported NodeJS Version Supported
v1.1.8 (Aug 14, 2021) v1.4 to v2.3 ^12.13.1, ^14.13.1, ^16.14.1
v1.1.7 (Jul 04, 2021) v1.4 to v2.3 ^12.13.1, ^14.13.1
v1.1.6 (Jun 06, 2021) v1.4 to v2.3 ^12.13.1, ^14.13.1
v1.1.5 (Apr 20, 2021) v1.4 to v2.3 ^12.13.1, ^14.13.1
v1.1.4 (Jan 29, 2021) v1.4 to v2.2 ^12.13.1, ^14.13.1
v1.1.3 (Sep 28, 2020) v1.4.0 to v2.2.0 12.16.x
v1.1.2 (Aug 12, 2020) v1.4.0 to v2.2.0 12.16.x

There are 2 options to get Explorer started. Following are the software dependencies required for each option. And if you want to know more about each configuration, please refer README-CONFIG.md.

Quick start (using Docker)

Prerequisites

Start Hyperledger Fabric network

This guide assumes that you've already started the test network by following Hyperledger Fabric official tutorial.

Configure

  • Create a new directory (e.g. explorer)

    mkdir explorer
    cd explorer
  • Copy the following files from the repository

    wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/examples/net1/config.json
    wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/examples/net1/connection-profile/test-network.json -P connection-profile
    wget https://raw.githubusercontent.com/hyperledger/blockchain-explorer/main/docker-compose.yaml
  • Copy entire crypto artifact directory (organizations/) from your fabric network (e.g /fabric-samples/test-network)

    cp -r ../fabric-samples/test-network/organizations/ .
  • Now, you should have the following files and directory structure.

    docker-compose.yaml
    config.json
    connection-profile/test-network.json
    organizations/ordererOrganizations/
    organizations/peerOrganizations/
    
  • Edit environmental variables in docker-compose.yaml to align with your environment

        networks:
        mynetwork.com:
            external:
                name: net_test
    
        ...
    
        services:
          explorer.mynetwork.com:
    
            ...
    
            volumes:
              - ./config.json:/opt/explorer/app/platform/fabric/config.json
              - ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile
              - ./organizations:/tmp/crypto
              - walletstore:/opt/explorer/wallet

    An alternative option is to export environment variables in your shell.

    export EXPLORER_CONFIG_FILE_PATH=./config.json
    export EXPLORER_PROFILE_DIR_PATH=./connection-profile
    export FABRIC_CRYPTO_PATH=./organizations
  • When you connect Explorer to your fabric network through the bridge network, you need to set DISCOVERY_AS_LOCALHOST to false for disabling hostname mapping into localhost.

    services:
    
      ...
    
      explorer.mynetwork.com:
    
        ...
    
        environment:
          - DISCOVERY_AS_LOCALHOST=false
  • Replace the user's certificate with an admin certificate and a secret (private) key in the connection profile (test-network.json). You need to specify the absolute path on the Explorer container.

    Before:

    "adminPrivateKey": {
        "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk"
    }

    After:

    "adminPrivateKey": {
        "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk"
    }

    Make sure you replace all paths.

Start container services

  • Run the following to start up explore and explorer-db services after starting your fabric network:

    $ docker-compose up -d

Clean up

  • To stop services without removing persistent data, run the following:

    $ docker-compose down
  • In the docker-compose.yaml, two named volumes are allocated for persistent data (for Postgres data and user wallet). If you would like to clear these named volumes up, run the following:

    $ docker-compose down -v

Quick start (using codebase)

Prerequisites

  • Nodejs 10 and 12 (10.19 and 12.16 tested)
  • PostgreSQL 9.5 or greater
  • jq
  • Linux-based operating system, such as Ubuntu or MacOS
  • golang (optional)
    • For e2e testing

Start Hyperledger Fabric network

This guide assumes that you've already started the test network by following Hyperledger Fabric official tutorial.

Clone GIT Repository

Clone this repository to get the latest using the following command.

$ git clone https://github.com/hyperledger/blockchain-explorer.git
$ cd blockchain-explorer

Database Setup

$ cd blockchain-explorer/app
  • Modify app/explorerconfig.json to update PostgreSQL database settings.

    "postgreSQL": {
        "host": "127.0.0.1",
        "port": "5432",
        "database": "fabricexplorer",
        "username": "hppoc",
        "passwd": "password"
    }
    • Another alternative to configuring database settings is to use environment variables:

      export DATABASE_HOST=127.0.0.1
      export DATABASE_PORT=5432
      export DATABASE_DATABASE=fabricexplorer
      export DATABASE_USERNAME=hppoc
      export DATABASE_PASSWD=pass12345

    Important repeat after every git pull (in some cases, you may need to apply permission to db/ directory, from blockchain-explorer/app/persistence/fabric/postgreSQL run: chmod -R 775 db/

Update configuration

  • Modify app/platform/fabric/config.json to define your fabric network connection profile:

    {
        "network-configs": {
            "test-network": {
                "name": "Test Network",
                "profile": "./connection-profile/test-network.json",
                "enableAuthentication": false
            }
        },
        "license": "Apache-2.0"
    }
    • test-network is the name of your connection profile and can be changed to any name
    • name is a name you want to give to your fabric network. You can change the only value of the key name
    • profile is the location of your connection profile. You can change the only value of the key profile
  • Modify connection profile in the JSON file app/platform/fabric/connection-profile/test-network.json:

    • Change fabric-path to your fabric network disk path in the test-network.json file:
    • Provide the full disk path to the adminPrivateKey config option. It usually ends with _sk, for example: /fabric-path/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk
    • adminUser and adminPassword is the credential for the user of Explorer to log in to the dashboard
    • enableAuthentication is a flag to enable authentication using a login page. Setting to false will skip authentication.

Run create database script:

  • Ubuntu

    $ cd blockchain-explorer/app/persistence/fabric/postgreSQL/db
    $ sudo -u postgres ./createdb.sh
    
  • MacOS

    $ cd blockchain-explorer/app/persistence/fabric/postgreSQL/db
    $ ./createdb.sh
    $ createdb `whoami`
    

Connect to the PostgreSQL database and run DB status commands. To export the settings from app/explorerconfig.json to the environment, run source app/exportConfig.sh; this will set $DATABASE_DATABASE and related envvars.

  • Ubuntu

    sudo -u postgres psql -c '\l'
    sudo -u postgres psql $DATABASE_DATABASE -c '\d'
  • MacOS

    psql -c '\l'
    psql $DATABASE_DATABASE -c '\d'

Expected output

$ sudo -u postgres psql -c '\l'
                                     List of databases
      Name      |        Owner        | Encoding | Collate |  Ctype  |   Access privileges
----------------+---------------------+----------+---------+---------+-----------------------
 fabricexplorer | $DATABASE_USERNAME  | UTF8     | C.UTF-8 | C.UTF-8 |
 postgres       | postgres            | UTF8     | C.UTF-8 | C.UTF-8 |
 template0      | postgres            | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
                |                     |          |         |         | postgres=CTc/postgres
 template1      | postgres            | UTF8     | C.UTF-8 | C.UTF-8 | =c/postgres          +
                |                     |          |         |         | postgres=CTc/postgres
(4 rows)

$ sudo -u postgres psql $DATABASE_DATABASE -c '\d'
                   List of relations
 Schema |           Name            |   Type   |       Owner
--------+---------------------------+----------+-------------------
 public | blocks                    | table    | $DATABASE_USERNAME
 public | blocks_id_seq             | sequence | $DATABASE_USERNAME
 public | chaincodes                | table    | $DATABASE_USERNAME
 public | chaincodes_id_seq         | sequence | $DATABASE_USERNAME
 public | channel                   | table    | $DATABASE_USERNAME
 public | channel_id_seq            | sequence | $DATABASE_USERNAME
 public | orderer                   | table    | $DATABASE_USERNAME
 public | orderer_id_seq            | sequence | $DATABASE_USERNAME
 public | peer                      | table    | $DATABASE_USERNAME
 public | peer_id_seq               | sequence | $DATABASE_USERNAME
 public | peer_ref_chaincode        | table    | $DATABASE_USERNAME
 public | peer_ref_chaincode_id_seq | sequence | $DATABASE_USERNAME
 public | peer_ref_channel          | table    | $DATABASE_USERNAME
 public | peer_ref_channel_id_seq   | sequence | $DATABASE_USERNAME
 public | transactions              | table    | $DATABASE_USERNAME
 public | transactions_id_seq       | sequence | $DATABASE_USERNAME
 public | write_lock                | table    | $DATABASE_USERNAME
 public | write_lock_write_lock_seq | sequence | $DATABASE_USERNAME
(18 rows)

(On MacOS, expect to see your `whoami` rather than postgres. Entries with $DATABASE_USERNAME will have the valuei of that parameter, whether set as an environment variable or as a JSON keyval; it will not show the literal string.)

Build Hyperledger Explorer

Important: repeat the below steps after every git pull

From the root of the repository:

  • ./main.sh clean
    • To clean the /node_modules, client/node_modules client/build, client/coverage, app/test/node_modules directories
  • ./main.sh install
    • To install, run tests, and build project

Or

$ cd blockchain-explorer
$ npm install
$ cd client/
$ npm install
$ npm run build

Run Hyperledger Explorer

Run Locally in the Same Location

  • Modify app/explorerconfig.json to update sync settings.

    "sync": {
      "type": "local"
    }
  • npm start

    • It will have the backend and GUI service up, for as long as the process runs
  • npm run app-stop

    • It will stop the node server

Note: If the Hyperledger Fabric network is deployed on other machines, please define the following environment variable

$ DISCOVERY_AS_LOCALHOST=false npm start

Run Standalone in Different Location

  • Modify app/explorerconfig.json to update sync settings.

    "sync": {
      "type": "host"
    }
  • If the Hyperledger Explorer was used previously in your browser, be sure to clear the cache before relaunching

  • ./syncstart.sh

    • It will have the sync node up
  • ./syncstop.sh

    • It will stop the sync node

Note: If the Hyperledger Fabric network is deployed on other machines, please define the following environment variable

$ DISCOVERY_AS_LOCALHOST=false ./syncstart.sh

Updating Docker image

To build a new version of the Docker image, use npm run-script docker_build. This creates a new image, which will become hyperledger-explorer:latest (distinct from the canonical images, which are hyperledger/explorer, with a /). This is a distinct build from the local version used in the Quick Start process. Run this image with docker-compose down && docker-compose up -d; both commands are needed.

Configuration

Please refer README-CONFIG.md for more detail on each configuration.

Logs

  • Please visit the ./logs/console folder to view the logs relating to the console and ./logs/app to view the application logs, and visit the ./logs/db to view the database logs.

Troubleshooting

Please visit the TROUBLESHOOT.md to view the Troubleshooting TechNotes for Hyperledger Explorer.

License

Hyperledger Explorer Project source code is released under the Apache 2.0 license. The README.md, CONTRIBUTING.md files, and files in the "images", "snapshots" folders are licensed under the Creative Commons Attribution 4.0 International License. You may obtain a copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.

More Repositories

1

Scorex

Scorex 2.0 Core
Scala
545
star
2

minifabric

Do fabric network the right and easy way.
Jinja
299
star
3

blockchain-carbon-accounting

This project implements blockchain applications for climate action and accounting, including emissions calculations, carbon trading, and validation of climate claims. It is part of the Linux Foundation's Hyperledger Climate Action and Accounting SIG.
TypeScript
181
star
4

university-course

A Hyperledger Lab focused developing materials for a university course.
TeX
179
star
5

fablo

Fablo is a simple tool to generate the Hyperledger Fabric blockchain network and run it on Docker. It supports RAFT and solo consensus protocols, multiple organizations and channels, chaincode installation and upgrade.
Shell
179
star
6

mirbft

MirBFT is a consensus library implementing the Mir consensus protocol.
Go
157
star
7

convector

Smart Contract Systems the easy way. Open source development framework.
TypeScript
145
star
8

yui-ibc-solidity

IBC in Solidity
Solidity
132
star
9

private-data-objects

The Private Data Objects lab provides technology for confidentiality-preserving, off-chain smart contracts.
C++
112
star
10

fabric-operations-console

A UI for managing Fabric peers, orderers, and CAs
JavaScript
103
star
11

hyperledger-labs.github.io

Hyperledger Labs
100
star
12

SmartBFT

Implementation of the SmartBFT consensus library (https://arxiv.org/abs/2107.06922)
Go
88
star
13

fabric-token-sdk

The Fabric Token SDK is a set of API and services that lets developers create token-based distributed application on Hyperledger Fabric.
Go
80
star
14

microfab

Microfab is a containerized Hyperledger Fabric runtime for use in development environments
Go
73
star
15

fabric-docs-cn

This lab has graduated to the overall Fabric project.
71
star
16

TrustID

Decentralized Identity solution compatible with different Hyperledger platforms.
TypeScript
67
star
17

open-enterprise-agent

Open Enterprise Cloud Agent
Scala
62
star
18

minbft

Implementation of MinBFT consensus protocol.
Go
60
star
19

fabric-operator

Hyperledger Fabric Kubernetes Operator
Go
57
star
20

business-partner-agent

The Business Partner Agent is a SSI wallet and controller based on aries cloud agent python.
Java
55
star
21

weaver-dlt-interoperability

A platform, a protocol suite, and a set of tools, to enable interoperation for data sharing and asset movements between independent networks built on heterogeneous blockchain, or more generally, distributed ledger, technologies, in a manner that preserves the core blockchain tenets of decentralization and security.
Go
52
star
22

fabric-smart-client

The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.
Go
51
star
23

go-perun

πŸŒ” Perun's Blockchain-Agnostic State Channels Framework in Go.
Go
47
star
24

hyperledger-fabric-based-access-control

A Hyperledger Fabric Based Access Control system to mediate access control flow from centralized applications.
HTML
41
star
25

nephos

Python library and Helm charts for deployment of Hyperledger Fabric to Kubernetes.
Python
37
star
26

nft-auction

NFT Auction application lets user to create NFTs and auction them off to other users in a marketplace model using Hyperledger Fabric
JavaScript
37
star
27

yui-fabric-ibc

IBC implementation in Hyperledger Fabric
Go
36
star
28

eThaler

Model a sample CBDC in TTF and implement in Besu
Java
34
star
29

cc-tools

The cc-tools package provides a relational-like framework for programming Hyperledger Fabric chaincodes.
Go
33
star
30

cordentity

The Cordentity app integrates Indy capabilities into the Corda platform.
Kotlin
32
star
31

yui-relayer

IBC Relayer implementations for heterogeneous blockchains
Go
32
star
32

orion-server

Go
30
star
33

yui-docs

Solidity
29
star
34

fabex

Block explorer for Hyperledger Fabric
Go
28
star
35

fabric-chaincode-wasm

Hyperledger Fabric Chaincode using WebAssembly
Go
28
star
36

fabric-chrome-extension

Hyperledger Fabric Chrome Extension
JavaScript
28
star
37

fabric-builder-k8s

Kubernetes chaincode builder for Hyperledger Fabric
Go
27
star
38

pubsub-interop

A blockchain interoperability solution for permissioned blockchain networks based on a publish/subscribe pattern.
HTML
26
star
39

cc-tools-demo

Basic example of how to use cc-tools to easily program a Hyperledger Fabric chaincode.
Shell
25
star
40

zeto

Privacy-preserving implementations of fungible and non-fungible tokens, using UTXO as the underlying transaction model
Solidity
24
star
41

fabric-opssc

Operations Smart Contract (OpsSC) for Hyperledger Fabric v2.x
Go
23
star
42

blockchain-analyzer

Analyze ledger data stored within a Hyperledger Fabric peer (key updates and operational data such as number of blocks and transactions).
Go
23
star
43

fabric-chaincode-haskell

Haskell support for smart contracts in Hyperledger Fabric
Haskell
23
star
44

pluggable-hcs

Go
20
star
45

yui-corda-ibc

IBC implementation in Corda
Kotlin
20
star
46

sawtooth-healthcare

This project focuses on interaction between Insurer, Insured Person (Patient), and Medical Facility
Python
20
star
47

harmonia

Regulated Network Interoperability
Java
20
star
48

acapy-java-client

Aries Cloud Agent Python Java Client Library
Java
18
star
49

agora-glass_pumpkin

agora-glass_pumpkin
Rust
18
star
50

perun-node

State channel node of the blockchain-agnostic state channels framework Perun.
Go
18
star
51

umbra

This lab is to make running Hyperledger distributed ledgers under the Mininet platform.
Python
18
star
52

fabric-debugger

A Hyperledger Fabric chaincode debugging plugin for VS code.
JavaScript
18
star
53

blockchain-verifier

bcverifier: Blockchain verification tool
TypeScript
16
star
54

fabric-machine

Xilinx Blockchain Machine for Hyperledger Fabric.
Go
14
star
55

crypto-lib

A lab for experimentation on creating shared cryptography modules for cross-project collaboration
Rust
14
star
56

aifaq

AI FAQ Proof-of-Concept project: it provides a chatbot that replies to the questions on Hyperledger Ecosystem
Jupyter Notebook
14
star
57

z-mix

z-mix will offer a generic way to create Zero-Knowledge proofs, proving statements about multiple cryptographic building blocks, containing signatures, commitments, and verifiable encryption.
Rust
14
star
58

private-transaction-families

Provides a mechanism for privacy over Hyperledger Sawtooth by enforcing a policy of access control to the ledger.
C
13
star
59

cckit

Programming toolkit for developing and testing Hyperledger Fabric applications, started as https://github.com/s7techlab/cckit
Go
13
star
60

agora-unknown_order

agora-unknown_order
Rust
12
star
61

hlf-connector

Integrate with Hyperledger Fabric using REST and Kafka with Block and Chaincode Event emitter.
Java
12
star
62

SParts

The Software Parts (SParts) lab delivers a Sawtooth-based ledger that provides both accountability and access to the open source components used in the construction of a software part. A software part is any software component (e.g., library, application, container or an entire operating system runtime) that is comprised of between 0% and 100% open source.
Go
12
star
63

fabric-block-archiving

Go
11
star
64

fabric-multi-channel-network-samples

This lab provides samples for multi channel network using Hyperledger Fabric.
Shell
11
star
65

keyhole-fabric-api-gateway

Client Access to Hyperledger Fabric Blockchain Network through Restful API's
JavaScript
11
star
66

PerformanceSandBox

Sandbox for Hyperledger Projects Performance research usage
Shell
11
star
67

orion-sdk-go

Go
10
star
68

cardea-mobile-agent

JavaScript
9
star
69

bdls-lab

BDLS
Go
9
star
70

perun-eth-contracts

πŸŒ” Perun's Ethereum State Channel Contracts
TypeScript
9
star
71

hyperledger-community-management-tools

Tools used to manage and evaluate the Hyperledger Community
JavaScript
9
star
72

solidity2chaincode

This tool converts Solidity contract into Javascript chaincode through source-to-source translation for running them onto Hyperledger Fabric.
JavaScript
9
star
73

solang-vscode

A VSCode plugin for a Solidity to WASM compiler written in Rust
Rust
8
star
74

learning-tokens

Uses the composable Interwork Alliance Token Taxonomy Framework (IWA TTF) to produce a Learning Token
TypeScript
8
star
75

perun-doc

Blockchain-agnostic state channels framework
Python
8
star
76

cardea

8
star
77

modern-pharmacy-management

This Lab will focus on leveraging blockchain to transform and modernize prescriptions management by enabling flexibility and managing fraud
Shell
8
star
78

fabric-chaincode-ocaml

OCaml support for smart contracts in Hyperledger Fabric
OCaml
8
star
79

fabric-ansible-collection

Ansible collection for building Hyperledger Fabric networks
Python
8
star
80

chaincode-analyzer

Go
8
star
81

karma-charity-platform

Blockchain-based charity foundation platform
TypeScript
7
star
82

patient-consent

Python
7
star
83

aries-fabric-wrapper

TypeScript
7
star
84

weft

CLI tool to work with Hyperledger Fabric identities and connection profiles; enables conversion between the various forms used by different codebase.
TypeScript
7
star
85

besu-operator

Kubernetes operator to provide an easier way of packaging, deploying, and managing Hyperledger Besu network.
Go
7
star
86

did-webs-resolver

A reference implementation for the did:webs DID method specified here https://github.com/trustoverip/tswg-did-method-webs-specification. The original work for the reference impl started here https://github.com/WebOfTrust/did-keri-resolver
Python
7
star
87

fabric-consortium-management

Go
5
star
88

byzantine-config

GUI Utility that simplifies creating configuration blocks and generating user keys
JavaScript
5
star
89

perun-cosmwasm-backend

Go-Perun CosmWasm Backend
Go
5
star
90

dancap

A lab for exploring attestation portability
C++
5
star
91

cardea-mobile-secondary-verifier-agent

JavaScript
5
star
92

HL-Starterkit

Hyperledger CLI Starter Kit
Shell
5
star
93

documentation-template

Template for creating documentation for Hyperledger projects
HTML
5
star
94

fabric-topologies

Scripts and configurations to easily setup various Hyperledger Fabric topologies that exercise advanced Hyperledger Fabric capabilities.
Shell
4
star
95

perun-credential-payment

Trustless payment for verifiable credentials using go-perun.
Go
4
star
96

fabric-vms-provision

This entry will provide an example on how to provision, using Ansible, Hyperledger Fabric native binaries on multiple Softlayer vms. A build your second network example.
Python
4
star
97

aries-sdk-mendix

Aries SDK for Mendix low-code platform
SCSS
4
star
98

milk-donor

Donor Milk Transparency and Traceability
JavaScript
3
star
99

pdo-contracts

C++
3
star
100

business-partner-agent-chart

Smarty
2
star