Customized; add scripts for run this image in blockchain explorer's docker-compose
499
Hyperledger Explorer is a simple, powerful, easy-to-use, highly maintainable, open source browser for viewing activity on the underlying blockchain network. Users have the ability to configure & build Hyperledger Explorer natively on macOS and Ubuntu.
├── 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
Following are the software dependencies required to install and run hyperledger explorer
Hyperledger Explorer works with Hyperledger Fabric 1.2. Install the following software dependencies to manage fabric network.
Clone this repository to get the latest using the following command.
git clone https://github.com/hyperledger/blockchain-explorer.git.cd blockchain-explorer.cd blockchain-explorer/app
Modify explorerconfig.json to update postgresql properties
"postgreSQL": {
"host": "127.0.0.1",
"port": "5432",
"database": "fabricexplorer",
"username": "hppoc",
"passwd": "password"
}
Another alternative to configure database properties is to use environment variables, example of setting:
**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.
cd blockchain-explorer/app/persistence/fabric/postgreSQL/db./createdb.shRun db status commands. Connect to PostgreSQL database.
sudo -u postgres psqlpsql postgres
\l view created fabricexplorer database
\d view created tables
Setup your own network using Build your network tutorial from Fabric. Once you setup the network, please modify the values in /blockchain-explorer/app/platform/fabric/config.json accordingly.
On another terminal.
cd blockchain-explorer/app/platform/fabricor
Setup your own network using Composer Build your network from Hyperledger Composer. Once you setup the network, please modify the values in /blockchain-explorer/app/platform/fabric/config.json accordingly.
On another terminal.
cd blockchain-explorer/app/platform/fabricIf you are connecting to a non TLS fabric peer, please modify "network-id.clients.client-id.tlsEnable" (true->false) in config.json. Depending on this configuration, the application decides whether to go TLS or non TLS route.
or
Setup your fabric network using Cello Build your network from Hyperledger Cello. Once you setup the network, please modify the values in /blockchain-explorer/app/platform/fabric/config.json accordingly.
On another terminal.
cd blockchain-explorer/app/platform/fabricIf you are connecting to a non TLS fabric peer, please modify "network-id.clients.client-id.tlsEnable" (true->false) in config.json. Depending on this configuration, the application decides whether to go TLS or non TLS route.
**Important repeat after every git pull
On another terminal.
cd blockchain-explorernpm installcd blockchain-explorer/app/testnpm installnpm run testcd client/npm installnpm test -- -u --coveragenpm run buildcd blockchain-explorer/appSync Process Configuration
Host (Standalone)
"sync": {
"type": "host"
}
Local (Run with Explorer)
"sync": {
"type": "local"
}
From new terminal.
cd blockchain-explorer/./start.sh (it will have the backend up)../stop.sh (it will stop the node server).From new terminal(If Sync Process in Standalone).
cd blockchain-explorer/
./syncstart.sh (it will have the sync node up). [Note : pass network-id and client-id to start specific client sync process, else first network and client will be considered]
./syncstop.sh (it will stop the sync node).
If the Hyperledger Explorer was used previously in your browser be sure to clear the cache before relaunching.
There is also an automated deployment of the Hyperledger Explorer available via docker having next assumptions:
examples/$network/cryptoexamples/$network/config.jsonhttps://cloud.docker.com/repository/docker/dahoba/blockchain-explorerhttps://cloud.docker.com/repository/docker/dahoba/blockchain-explorer-dbFrom new terminal.
cd blockchain-explorer/dockerConfig) to store your hyperledger network configuration under examples (mkdir -p ./examples/dockerConfig)examples/dockerConfig/config.json.examples/dockerConfig/crypto.Notes:
config.json is the connection profile of the target blockchain network.crypto folder are as same as found under crypto-config of the hyperledger first-network samples.From new terminal.
cd blockchain-explorer/docker-compose up -d (it will automatically deploy both database and frontend apps using Hyperledger Fabric network configuration stored under examples/dockerConfig folder)Note: the example with additional information can be found at examples/net1 folder.
If the Blockchain network is deployed in the Docker, you may change the network name in docker-compose.yml as code below to join that network. i.e.: to join the hyperledger-composer multi-org examples change to net-byfn
...
default:
external:
name: net_byfn
docker-compose stopdocker-compose downSet the DOCKER_REGISTRY variable to the Container Registry you will use and login to that registry if you want to store your container there.
To build the container (auto-tagged as latest), run:
npm run docker_build
To tag the container with your registry and the NPM package version, run:
npm run docker_tag
To push the container to your registry, run:
npm run docker_push
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/.
Content type
Image
Digest
Size
385.9 MB
Last updated
almost 8 years ago
docker pull dahoba/blockchain-explorer