# blockchain-explorer **Repository Path**: vansoftware/blockchain-explorer ## Basic Information - **Project Name**: blockchain-explorer - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-11 - **Last Updated**: 2024-01-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hyperledger Explorer [![join the chat][rocketchat-image]][rocketchat-url] [rocketchat-url]:https://chat.hyperledger.org/channel/hyperledger-explorer [rocketchat-image]:https://open.rocket.chat/images/join-chat.svg [](https://dev.azure.com/Hyperledger/blockchain-explorer/_build/latest?definitionId=41&branchName=master) [](https://bestpractices.coreinfrastructure.org/projects/2710) [](https://blockchain-explorer.readthedocs.io/en/master/?badge=master) [](https://lgtm.com/projects/g/hyperledger/blockchain-explorer/context:javascript) Hyperledger Explorer is a simple, powerful, easy-to-use, well maintained, open source utility to browse activity on the underlying blockchain network. Users have the ability to configure and build Hyperledger Explorer on MacOS and Ubuntu. # Table of Contents - [1.0 Release Notes ](#Release-Notes) - [2.0 Directory Structure ](#Directory-Structure) - [3.0 Dependencies ](#Dependencies) - [4.0 Clone GIT Repository ](#Clone-GIT-Repository) - [5.0 Database Setup ](#Database-Setup) - [5.1 Authorization Configuration ](#Authorization-Configuration) - [6.0 Fabric Network Setup ](#Fabric-Network-Setup) - [7.0 Configure Hyperledger Fabric ](#Configure-Hyperledger-Fabric) - [7.1 Optional: Configure Fabcar Sample ](#Configure-Fabcar-Sample) - [7.2 Optional: Configure Balance Transfer Sample ](#Configure-Balance-Transfer-Sample) - [8.0 Hyperledger Composer Setup ](#Hyperledger-Composer-Setup) - [8.1 Configure Hyperledger Explorer for Composer ](#Configure-Hyperledger-Explorer-for-Composer) - [9.0 Optional: Hyperledger Cello Setup ](#Hyperledger-Cello-Setup) - [9.1 Optional: Configure Hyperledger Explorer for Cello ](#Configure-Hyperledger-Explorer-for-Cello) - [10.0 Build Hyperledger Explorer ](#Build-Hyperledger-Explorer) - [10.1 Optional: Configure Hyperledger Explorer for HTTPS ](#Configure-Hyperledger-Explorer-for-HTTPS) - [11.0 Run Hyperledger Explorer ](#Run-Hyperledger-Explorer) - [12.0 Optional: Run Hyperledger Explorer Using Docker ](#Run-Hyperledger-Explorer-using-Docker) - [12.1 Docker Repository ](#Docker-Repository) - [12.2 Run Hyperledger Explorer Using Docker Compose ](#Run-Hyperledger-Explorer-using-Docker-Compose) - [12.3 Docker Troubleshooting ](#Run-Hyperledger-Explorer-using-Docker-Compose-Troubleshooting) - [13.0 NPM Utility Scripts to Dockerize Application ](#NPM-Utility-Scripts-to-Dockerize-Application) - [14.0 Hyperledger Explorer Swagger ](#Hyperledger-Explorer-Swagger) - [15.0 Logs ](#Logs) - [16.0 Troubleshooting ](#Troubleshooting) - [17.0 Testing ](#Testing) - [18.0 License ](#License) # 1.0 Release Notes | Hyperledger Explorer Version | Fabric Version Supported | NodeJS Version Supported | | -- | -- | -- | | [v1.0.0-rc2](release_notes/v1.0.0-rc2.md) (Dec 10, 2019) | [v1.4.0 to v1.4.4](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v1.0.0-rc1](release_notes/v1.0.0-rc1.md) (Nov 18, 2019) | [v1.4.2](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.9.5](release_notes/v0.3.9.5.md) (Sep 8, 2019) | [v1.4.2](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.9.4](release_notes/v0.3.9.4.md) (June 18, 2019) | [v1.4.1](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.9.3](release_notes/v0.3.9.3.md) (May 24, 2019) | [v1.4](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.9.2](release_notes/v0.3.9.2.md) (May 16, 2019) | [v1.4](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.9.1](release_notes/v0.3.9.1.md) (Feb 28, 2019) | [v1.4](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.9](release_notes/v0.3.9.md) (Feb 7, 2019) | [v1.4](https://hyperledger-fabric.readthedocs.io/en/release-1.4) | [8.11.x](https://nodejs.org/en/download/releases) | | [v0.3.8](release_notes/v0.3.8.md) (Dec 13, 2018) | [v1.3](https://hyperledger-fabric.readthedocs.io/en/release-1.3) | [8.x.x](https://nodejs.org/en/download/releases) | | [v0.3.7](release_notes/v0.3.7.md) (Sep 21, 2018) | [v1.2](https://hyperledger-fabric.readthedocs.io/en/release-1.2) | [8.x.x](https://nodejs.org/en/download/releases) | | [v0.3.6.1](release_notes/v0.3.6.1.md) (Sep 21, 2018) | [v1.2](https://hyperledger-fabric.readthedocs.io/en/release-1.2) | [8.x.x](https://nodejs.org/en/download/releases) | | [v0.3.6](release_notes/v0.3.6.md) (Sep 6, 2018) | [v1.2](https://hyperledger-fabric.readthedocs.io/en/release-1.2) | [8.x.x](https://nodejs.org/en/download/releases) | | [v0.3.5.1](release_notes/v0.3.5.1.md) (Sep 21, 2018) | [v1.1](https://hyperledger-fabric.readthedocs.io/en/release-1.1) | [8.x.x](https://nodejs.org/en/download/releases) | | [v0.3.5](release_notes/v0.3.5.md) (Aug 24, 2018) | [v1.1](https://hyperledger-fabric.readthedocs.io/en/release-1.1) | [8.x.x](https://nodejs.org/en/download/releases) | | [v0.3.4](release_notes/v0.3.4.md) (Jul 13, 2018) | [v1.1](https://hyperledger-fabric.readthedocs.io/en/release-1.1) | [8.x.x](https://nodejs.org/en/download/releases) | # 2.0 Directory Structure
blockchain-explorer
|
├── app Application backend root, Explorer configuration
| ├── rest REST API
| ├── persistence Persistence layer
| ├── fabric Persistence API (Hyperledger Fabric)
| └── platform Platforms
| | └── fabric Explorer API (Hyperledger Fabric)
| └── test Application backend test
|
└── client Web UI
├── public Assets
└── src Front end source code
├── components React framework
├── services Request library for API calls
├── state Redux framework
└── static Custom and Assets
# 3.0 Dependencies
Following are the software dependencies required to install and run hyperledger explorer:
* Nodejs 8.11.x (Note that v9.x is not yet supported)
* PostgreSQL 9.5 or greater
* [jq](https://stedolan.github.io/jq)
* Linux-based operating system, such as Ubuntu or MacOS
Verified Docker versions supported:
* [Docker CE 18.09.2 or later](https://hub.docker.com/search/?type=edition&offering=community&operating_system=linux)
* [Docker Compose 1.14.0](https://docs.docker.com/compose)
# 4.0 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`
# 5.0 Database Setup
- `cd blockchain-explorer/app`
- Modify explorerconfig.json to update PostgreSQL database settings.
"postgreSQL": {
"host": "127.0.0.1",
"port": "5432",
"database": "fabricexplorer",
"username": "hppoc",
"passwd": "password"
}
Another alternative to configure database settings is to use environment variables, example of settings:
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 case you may need to apply permission to db/ directory, from blockchain-explorer/app/persistence/fabric/postgreSQL run: `chmod -R 775 db/` 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` Connect to the PostgreSQL database and run DB status commands: - `\l` View created fabricexplorer database. - `\d` View created tables. If your Postgresql configured with TLS, read link [how to configure connection to Postgresql with TLS](./app/persistence/postgreSQL/CONFIGURE-TLS-CONNECTION-TO-POSTGRESQL.md) # 5.1 Authorization Configuration - `cd blockchain-explorer/app` - Modify explorerconfig.json to update Authorization (JWT) settings.
"jwt": {
"secret" : "a secret phrase!!",
"expiresIn": "2 days"
}
`jwt`:
* `secret`: secret string to sign the payload.
* `expiresIn`: expressed in seconds or a string describing a time span [zeit/ms](https://github.com/zeit/ms).
> Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default (`"120"` is equal to `"120ms"`).
# 6.0 Fabric Network Setup
- Note: This section will take some time to complete.
- Setup your own network using the [Building Your First Network](http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html) tutorial from Hyperledger. Once you setup the network, please modify the values in `/blockchain-explorer/app/platform/fabric/config.json` accordingly.
- Hyperledger Explorer defaults to utilize [fabric-samples/first-network](https://github.com/hyperledger/fabric-samples).
- Make sure to set the environment variables `CORE_PEER_GOSSIP_BOOTSTRAP` and `CORE_PEER_GOSSIP_EXTERNALENDPOINT` for each peer in the docker-compose.yaml file. These settings enable the Fabric discovery service, which is used by Hyperledger Explorer to discover the network topology.
# 6.1 Configure operations service Config-Operations-Service-Hyperledger-Explorer
- Please visit the [CONFIG-OPERATIONS-SERVICE-HLEXPLORER.md](CONFIG-OPERATIONS-SERVICE-HLEXPLORER.md) to configure operations service
# 7.0 Configure Hyperledger Fabric
On another terminal:
- `cd blockchain-explorer/app/platform/fabric`
- Modify config.json to define your fabric network connection profile:
{
"network-configs": {
"first-network": {
"name": "firstnetwork",
"profile": "./connection-profile/first-network.json",
"enableAuthentication": false
}
},
"license": "Apache-2.0"
}
- "first-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 only value of the key "name".
- "profile" is the location of your connection profile, you can change only value of the key "profile"
- Modify connection profile in the JSON file first-network.json:
- Change "fabric-path" to your fabric network disk path in the first-network.json file: