Hyperledger Fabric fabric-java-sdk 测试环境集成

版权声明:博客中的文章版权归博主所有,未经授权,禁止转载,转载请注明出处

安装环境

安装JDK

下载网址: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

下载 jdk-8u151-macosx-x64.dmg 安装到电脑

安装 maven

下载网址:https://maven.apache.org/download.cgi

解压到 /Users/fujinliang/Documents/environment

打开终端,修改.bashrc

vi ~/.bashrc

加入如下代码

export M2_HOME=/Users/fujinliang/Documents/environment/apache-maven-3.5.2
export PATH=$PATH:$M2_HOME/bin

输入命令,使配置生效

source ~/.bashrc

输入mvn -v查看Maven是否安装成功

$ mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: /Users/fujinliang/Documents/environment/apache-maven-3.5.2
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

下载 fabric-java-sdk

$ git clone https://github.com/hyperledger/fabric-sdk-java.git

$ cd fabric-sdk-java
$ git checkout v1.0.1

编译

$ mvn install -DskipTests

启动网络

$ cd src/test/fixture/sdkintegration
$ ./fabric.sh up

运行测试方法

mvn failsafe:integration-test -DskipITs=false

关注公众号

你可能感兴趣的:(Hyperledger,Fabric)