Fabric 开发手册

Spring Fabric Explorer

Spring Fabric Explorer 是基于 Spring Fabric Gateway开发的简化版的Fabric区块链浏览器。

一、预览

首页

区块信息

交易信息

历史记录

二、实现方法

第一步:加载fabric-explorer-spring-boot-starter

Maven Central

<dependency>
	<groupId>io.github.ecsoya</groupId>
	<artifactId>fabric-explorer-spring-boot-starter</artifactId>
	<version>${latest_version}</version>
</dependency>

第二步:配置application.yml

# Fabric Network Configure      
spring:         
   fabric:
      chaincode: 
         identify: your chaincode id
         name: Common chaincode
         version: 1.0
      channel: your channel name
      organizations:
      - org1
      - org2
      name: your fabric network name
      gateway:
         wallet:
            identify: admin
      network:
         file: network/connection.yml //your fabric network config file.
         name: fabric network name
# Fabric explorer
      explorer: 
         title: Fabric Explorer
         logo: img/logo.png
         copyright: Ecsoya (jin.liu@soyatec.com)
         hyperledger-explorer-url: http://www.hyperleder.org
         path: /explorer

三、参数配置

参数 说明 是否必需 默认值
spring.fabric.explorer.title 大标题 Spring Fabric Explorer
spring.fabric.explorer.logo 图标 图标
spring.fabric.explorer.copyright 版权信息文章 Ecsoya (jin.liu@soyatec.com)
spring.fabric.explorer.hyperledger-explorer-url 标准的Hyperledger Explorer地址
spring.fabric.explorer.path 浏览器的根目录 /explorer

四、支持语言

现在支持英文中文两种,使用了SpringBoot默认的语言处理方式。

如需切换语言,请在application.yml中配置:

spring:
   mvc:
      locale: zh_CN
      locale-resolver: fixed

五、依赖

注意:从Spring Fabric Explorer 1.0.4 开始,所有的静态资源都移动到了 explorer 目录中。如果想要重写,请记得使用正确的路径。

六、参考

  1. Fabric 网络部署
  2. Spring Fabric Gateway
  3. Fabric Network Config
  4. Hyperledger Explorer

首页