This document shows how to integrate the IBM hyperledger Java SDK with IBM bluemix blockchain. To use Bluemix IBM Blockchain Service, follow https://github.com/IBM-Blockchain/marbles/blob/v4.0/docs/use_bluemix_hyperledger.md to create a Blockchain Network in IBM Bluemix, peers (up to 3) and a channel.
Requires Hyperledger Fabric Java SDK 1.1.0-SNAPSHOT
git clone https://github.com/IBM-Blockchain/JSDKIntegrationSample
From your bluemix dashboard Overview, click on "Service Credentials", copy and paste all the information to a file named "bmxServiceCredentials.json". Save this file to the location where you download the repository
Two places need to be changed: NETWORK_CONFIG_PEERORG_CA: get network ca information from bmxServiceCredentials.json
TEST_CHANNEL: update with your own channel name.
Run command:
mvn install
Issue “mvn install” from your download folder, confirm with “BUILD SUCCESS” message
Run command:
mvn exec:java -Dexec.mainClass="org.cr22rc.BMXHyperledgerFabricJSDKIntegrationSample"
It will generate the cert for user "admin" at the first time run, the credential info will be saved to "bmxBlockChainSampleStore.properties".
Copy and paste CERTFICATE from java test case output to bluemix web GUI
Tip: if the submit button is disabled, just add CR to ------END CERTIFICATE-----
We should able to see invoke transaction and query runs are successful.
An introduction video is in Videos/bmxJSDKIntro.webm
Screen shots are in screenShots directory