java chaincode_端木藤丸/fabric-chaincode-java

Hyperledger Fabric Chaincode Java

Fabric-Chaincode-Java?branchName=master

badge.svg

join-chat.svg

This is a Java based implementation of Hyperledger Fabric chaincode shim APIs, which enables development of smart contracts using the Java language.

This project creates fabric-chaincode-protos and fabric-chaincode-shim jar

files for developers' consumption and the hyperledger/fabric-javaenv docker image

to run Java chaincode.

Getting Started

Application developers interested in developing Java smart contracts for Hyperledger Fabric should read the JavaDoc which includes download information, and links to documentation and samples.

Project structure

fabric-chaincode-protos

Contains the protobuf definition files used by Java shim to communicate with Fabric peers.

fabric-chaincode-shim

Contains the java shim classes that define Java chaincode API and way to communicate with Fabric peers.

fabric-chaincode-docker

Contains instructions to build the hyperledger/fabric-javaenv docker image.

fabric-chaincode-integration-test

Contains higher level tests for Java chaincode.

Note: in the future these should be replaced with a separate suite of Cucumber tests which run against all chaincode implementations.

examples

The following technical examples are in this repository. Please see the tutorials in the documentation

fabric-contract-example-gradle - Contains an example Java contract built using gradle

fabric-contract-example-maven - Contains an example Java contract built using maven

fabric-contract-example-gradle-kotlin - Contains an example Kotlin contract build using gradle (Kotlin gradle files)

fabric-chaincode-example-sacc - Contains an example java chaincode gradle project that includes sample chaincode and basic gradle build instructions.

fabric-chaincode-example-sbe - Contains an example java chaincode gradle project that includes state based endorsement

Building and testing

Make sure you have the following prereqs installed:

Note: Java can be installed using sdkman.

Clone the repository if you haven't already.

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

Build java shim jars (proto and shim jars) and install them to local maven repository.

cd fabric-chaincode-java

./gradlew clean build install

Note: ./gradlew clean build classes can be used instead to reduce the binaries that are built. This should be sufficient for using the local repository.

Build javaenv docker image, to have it locally.

./gradlew buildImage

Compatibility

For details on what Java runtime and versions of Hyperledger Fabric can be used please see the compatibility document.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值