Skip to content

Commit ab9c0df

Browse files
committed
Update readme
Combine contributing guide with readme and ensure information is up-to-date Signed-off-by: James Taylor <jamest@uk.ibm.com> # Conflicts: # README.md
1 parent 5ce56df commit ab9c0df

File tree

3 files changed

+66
-431
lines changed

3 files changed

+66
-431
lines changed

CONTRIBUTING.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -40,57 +40,6 @@ We use our own forks and [Github Flow](https://guides.github.com/introduction/fl
4040

4141
Please to try to be consistent with the rest of the code and conform to checkstyle rules where they are provided.
4242

43-
## Folder structure
44-
45-
The "fabric-chaincode-protos" folder contains the protobuf definition files used by
46-
Java shim to communicate with Fabric peer.
47-
48-
The "fabric-chaincode-shim" folder contains the java shim classes that define Java
49-
chaincode API and way to communicate with Fabric peer.
50-
51-
The "fabric-chaincode-docker" folder contains instructions to the build
52-
`hyperledger/fabric-javaenv` docker image.
53-
54-
The "fabric-chaincode-example-gradle" contains an example java chaincode gradle
55-
project that includes sample chaincode and basic gradle build instructions.
56-
57-
#### Install prerequisites
58-
59-
Make sure you installed all [fabric prerequisites](https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html)
60-
61-
Install java shim specific prerequisites:
62-
* Java 8
63-
* gradle 4.4
64-
65-
#### Build shim
66-
67-
Clone the fabric shim for java chaincode repo.
68-
69-
```
70-
git clone https://github.com/hyperledger/fabric-chaincode-java.git
71-
```
72-
73-
Build java shim jars (proto and shim jars) and install them to local maven repository.
74-
```
75-
cd fabric-chaincode-java
76-
gradle clean build install
77-
```
78-
79-
Build javaenv docker image, to have it locally.
80-
```
81-
gradle buildImage
82-
```
83-
84-
#### Update your chaincode dependencies
85-
86-
Make your chanincode depend on java shim master version and not on version from maven central
87-
88-
```
89-
dependencies {
90-
compile group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '1.4.2-SNAPSHOT'
91-
}
92-
```
93-
9443
## Code of Conduct Guidelines <a name="conduct"></a>
9544

9645
See our [Code of Conduct Guidelines](../blob/master/CODE_OF_CONDUCT.md).

README.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,75 @@
1-
# Hyperledger Fabric - Java Contract and Chaincode
1+
# Hyperledger Fabric Chaincode Java
22

3-
This is a Java implementation of Hyperledger Fabric chaincode shim APIs and contract programming model. This enables development of using Java language or other JVM based languages
3+
[![Build Status](https://dev.azure.com/Hyperledger/Fabric-Chaincode-Java/_apis/build/status/Fabric-Chaincode-Java?branchName=release-1.4)](https://dev.azure.com/Hyperledger/Fabric-Chaincode-Java/_build/latest?definitionId=39&branchName=release-1.4)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.hyperledger.fabric-chaincode-java/fabric-chaincode-shim/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.hyperledger.fabric-chaincode-java/fabric-chaincode-shim)
5+
[![Rocket.Chat](https://chat.hyperledger.org/images/join-chat.svg)](https://chat.hyperledger.org/channel/fabric-java-chaincode)
46

5-
## Developers
7+
This is a Java based implementation of Hyprledger Fabric chaincode shim APIs, which enables development of smart contracts using the Java language.
68

7-
Application developers interested in developing smart contracts should read the [introductory tutorial](CONTRACT_TUTORIAL.md) and for a full scenario visit the
8-
[Commercial Paper](https://hyperledger-fabric.readthedocs.io/en/latest/tutorial/commercial_paper.html) tutorial.
9+
This project creates `fabric-chaincode-protos` and `fabric-chaincode-shim` jar
10+
files for developers' consumption and the `hyperledger/fabric-javaenv` docker image
11+
to run Java chaincode.
912

10-
We recommend using the IBM Blockchain Platform [VSCode extension](https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform) to assist you in developing smart contracts. The extension is able to create sample contracts for you, an example of such a contract is in the [fabric-contract-example](./fabric-contract-example) directory; there are folders for using both gradle and maven.
13+
## Getting Started
1114

12-
In addition, this has reference to other tutorials to get you started
15+
Application developers interested in developing Java smart contracts for Hyperledger Fabric should read the [JavaDoc](https://fabric-chaincode-java.github.io/) which inludes download information, and links to documentation and samples.
1316

14-
## Contributors
17+
## Project structure
1518

16-
Contributors or early adopters who need to be able to build and test recent builds, should reference the [contributing](CONTRIBUTING.md) guide.
19+
### fabric-chaincode-protos
1720

18-
This project creates `fabric-chaincode-protos` and `fabric-chaincode-shim` jar files for developers consumption and the `hyperledger/fabric-javaenv` docker image to run the Java chaincode and contracts.
21+
Contains the protobuf definition files used by Java shim to communicate with Fabric peers.
1922

23+
### fabric-chaincode-shim
24+
25+
Contains the java shim classes that define Java chaincode API and way to communicate with Fabric peers.
26+
27+
### fabric-chaincode-docker
28+
29+
Contains instructions to build the `hyperledger/fabric-javaenv` docker image.
30+
31+
### fabric-chaincode-integration-test
32+
33+
Contains higher level tests for Java chaincode.
34+
35+
> **Note:** in the future these should be replaced with a separate suite of [Cucumber](https://cucumber.io) tests which run against all chaincode implementations.
36+
37+
### fabric-chaincode-example-gradle
38+
39+
Contains an example java chaincode gradle project that includes sample chaincode and basic gradle build instructions.
40+
41+
## Building and testing
42+
43+
Make sure you have the following prereqs installed:
44+
45+
- [Docker](https://www.docker.com/get-docker)
46+
- [Docker Compose](https://docs.docker.com/compose/install/)
47+
- [Java 8](https://www.java.com)
48+
49+
> **Note:** Java can be installed using [sdkman](https://sdkman.io/).
50+
51+
Clone the repository if you haven't already.
52+
53+
```
54+
git clone https://github.com/hyperledger/fabric-chaincode-java.git
55+
```
56+
57+
Build java shim jars (proto and shim jars) and install them to local maven repository.
58+
59+
```
60+
cd fabric-chaincode-java
61+
./gradlew clean build install
62+
```
63+
64+
> **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.
65+
66+
Build javaenv docker image, to have it locally.
67+
68+
```
69+
./gradlew buildImage
70+
```
71+
72+
---
73+
74+
[![Creative Commons License](https://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/)
75+
This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/)

0 commit comments

Comments
 (0)