Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Hyperledger Explorer

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to understand Hyperledger Explorer, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can gain something.

We introduce the Cello project for operation and maintenance, which can help operation and maintenance quickly deploy and monitor each block chain node. Today we will introduce another similar project-Hyperledger Explorer.

1 Project introduction

Hyperledger Explorer is a graphical explorer of block chain, which has the characteristics of easy to use, powerful function, easy maintenance and so on. It is also a sub-project under many projects of Hyperledger, which is still in incubation.

If Cello is a graphical tool for operation and maintenance, then Hyperledger Explorer is a graphical tool for developers and ordinary users. It provides a web interface so that users can easily see the activities on the block chain, similar to https://etherscan.io/ in the Ethernet Square project.

2 Environmental dependence

Due to the need for a series of dependencies such as fabric and docker, we still choose Ubuntu 16.04 system, which mainly depends on the following:

Software operation depends on:

Nodejs 8.11.x (not supported by Node 9.x)

PostgreSQL 9.5 or greater

To work on a network above Hyperledger Fabric 1.1, you need to run the following dependent management fabric network:

Docker 17.06.2-ce [https://www.docker.com/community-edition]

Docker-compose 1.14.0 [https://docs.docker.com/compose/]

3 deployment process

Clone warehouse

Clone the repository using the following command:

Git clone https://github.com/hyperledger/blockchain-explorer.gitcd blockchain-explorer

The directory structure is as follows:

├── app Application backend root ├── explorer Explorer configuration REST API ├── persistence Persistence layer ├── 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

Connect to the database

The Ubuntu system uses the following command to connect to the database:

Sudo-u postgres psql

Run the script that creates the database:

\ I app/persistence/postgreSQL/db/explorerpg.sql

\ I app/persistence/postgreSQL/db/updatepg.sql

Set up the Fabric network

Follow the Fabric tutorial Build your network or composer tutorial Build your network can quickly start a Fabric network, the related introduction in the previous article Linux environment to build Hyperledger Fabric 1.1 development environment and Linux environment to install and use Hyperledger Composer have been introduced.

After starting the fabric network, you need to adapt to the app/platform/fabric/config.json and change it to the corresponding blockchain network configuration.

Modify the app/persistence/postgreSQL/db/pgconfig.json to the corresponding database configuration.

If you connect to a non-TLS fabric node, you need to modify the protocol grpcs-> grpc and port 9051-> 9050 in the peer url configuration and remove the option tls_cacerts. With this critical configuration, the program decides whether to take a TLS route or a non-TLS route.

4. Build Hyperledger Explorer

After each git pull, you need to rebuild:

Cd blockchain-explorernpm installcd blockchain-explorer/app/testnpm installnpm run testcd client/npm installnpm test-u-- coveragenpm run build5 running the Hyperledger Explorercd blockchain-explorer./start.sh # program will run in the background. / stop.sh # stops running

After running, open localhost:8080, and you should see an interface similar to the following

So Hyperledger Explorer's web interface is up and running.

Run Hyperledger Explorer using Docker

Hyperledger Explorer also supports automated deployment using Docker. The default configuration for non-interactive deployment is as follows:

By default, the deployment script uses the 192.168.10.0 docker 24 virtual network, and there is no overlapping ip (meaning you can't have other physical hosts or docker containers running on this network). If the ip overlaps, you must edit the script to change the target network and container target ip.

By default, two service (foreground and database) run on the same machine, but the script also allows changes to be run on separate machines, as long as the target DB IP is edited in the front-end container.

Crypto material is correctly configured in examples/$network/crypto

The Fabric network is configured in examples/$network/config.json

To deploy using Docker:

Cd blockchain-explorer/

Create a new directory under examples (such as dockerConfig) to store your ypberledger network configuration (mkdir-p. / examples/dockerConfig)

Save your hyperledger network configuration under examples/dockerConfig/config.json.

Save your certificate configuration under examples/dockerConfig/crypto.

Run explorer in the directory one level up.

Open a new terminal

Cd blockchain-explorer/

. / deploy_explorer.sh dockerConfig (the script automatically deploys the database and front-end app using the configuration stored in the examples/dockerConfig directory)

Hyperledger Explorer Swagger

After running Hyperledger Explorer, you can see the Rust API description in http://localhost:8080/api-docs

Logs

. / logs/console can view terminal log,. / logs/app can view application log,. / logs/db can view database log.

All logs are scrolled for seven days

The Hyperledger Explorer project is currently in the process of incubation, and deployment does not seem to be on the right track (there is no standardized package management deployment). However, we can still see the powerful function of Hyperledger, all aspects are almost neck and neck, there is no deficiency, and in the rapid development. In addition to the lack of current applications, the infrastructure is actually quite perfect, from development to operation and maintenance, and then to end users almost have corresponding projects to solve the corresponding problems, we can see that the goal of Hyperledger is quite ambitious.

The above content is how to understand Hyperledger Explorer. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report