Skip to content

Commit

Permalink
FAB-4025 Rename chain to channel
Browse files Browse the repository at this point in the history
PS 4 rename chaincode

Change-Id: I14e3b2972ad2b2758f3b6ecc633f2f3a2cacf1fd
Signed-off-by: rickr <cr22rc@gmail.com>
  • Loading branch information
cr22rc committed May 20, 2017
1 parent 6b470ed commit 40bbb9d
Show file tree
Hide file tree
Showing 38 changed files with 678 additions and 748 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Java SDK for Hyperledger Fabric 1.0
Welcome to Java SDK for Hyperledger project. The SDK helps facilitate Java applications to manage the lifecycle of
Hyperledger channels (*often referred to as chains*) and user chaincode. The SDK also provides a means to execute
Hyperledger channels and user chaincode. The SDK also provides a means to execute
user chaincode, query blocks
and transactions on the chain, and monitor events on the chain.
and transactions on the channel, and monitor events on the channel.

THe SDK acts on behave of a particular User which is defined by the embedding application through the implementation
of the SDK's `User` interface.
Expand Down Expand Up @@ -187,7 +187,7 @@ Use this `maven` command to run the integration tests:

### End to end test scenario
The _src/test/java/org/hyperledger/fabric/sdkintegration/End2endIT.java_ integration test is an example of installing, instantiating, invoking and querying a chaincode.
It constructs the Hyperledger channel, deploys the `GO` chain code, invokes the chaincode to do a transfer amount operation and queries the resulting blockchain world state.
It constructs the Hyperledger channel, deploys the `GO` chaincode, invokes the chaincode to do a transfer amount operation and queries the resulting blockchain world state.

This test is a reworked version of the Fabric [e2e_cli example](https://github.com/hyperledger/fabric/tree/master/examples/e2e_cli) to demonstrate the features of the SDK.
To better understand blockchain and Fabric concepts, we recommend you install and run the _e2e_cli_ example.
Expand Down Expand Up @@ -256,7 +256,7 @@ and one file in th _src/test/fixture/sdkintegration/e2e-2Orgs/channel_ directory
The policy section is comprised of `n-of` and `signed-by` elements. Then n-of (`1-of` `2-of`) require that many (`n`) in that
section to be true. The `signed-by` references an identity in the identities section.

### Chain creation artifacts
### Channel creation artifacts
Channel configuration files and orderer bootstrap files ( see directory _src/test/fixture/sdkintegration/e2e-2Orgs/channel_ ) are needed when creating a new channel.
This is created with the Hyperledger Fabric `configtxgen` tool.

Expand Down
2 changes: 1 addition & 1 deletion config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.hyperledger.fabric.sdk.cacerts = /genesisblock/peercacert.pem
org.hyperledger.fabric.sdk.proposal.wait.time = 20000

# Time in milliseconds to wait for genesis block
org.hyperledger.fabric.sdk.chain.genesisblock_wait_time = 5000
org.hyperledger.fabric.sdk.channel.genesisblock_wait_time=5000

# System wide defaults for CryptoPrimitives objects. You can customize further by using the
# CryptoPrimitives.setProperties() method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
public interface BlockListener {
/**
* Receive a block event from the Chain
* Receive a block event from the Channel
*
* @param blockEvent The block being received.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,47 @@

package org.hyperledger.fabric.sdk;


import org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID;

/**
* ChainCodeID identifies chaincode.
* ChaincodeID identifies chaincode.
*/
public class ChainCodeID {
public class ChaincodeID {

private final ChaincodeID fabricChainCodeID;
private final org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID fabricChaincodeID;

private ChainCodeID() {
private ChaincodeID() {

fabricChainCodeID = null;
fabricChaincodeID = null;

}


public ChaincodeID getFabricChainCodeID() {
return fabricChainCodeID;
public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID getFabricChaincodeID() {
return fabricChaincodeID;
}


ChainCodeID(ChaincodeID chaincodeID) {
this.fabricChainCodeID = chaincodeID;
ChaincodeID(org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID chaincodeID) {
this.fabricChaincodeID = chaincodeID;
}

public String getName() {
return fabricChainCodeID.getName();
return fabricChaincodeID.getName();
}

public String getPath() {
return fabricChainCodeID.getPath();
return fabricChaincodeID.getPath();

}

public String getVersion() {
return fabricChainCodeID.getVersion();
return fabricChaincodeID.getVersion();

}

/**
* Build a new ChainCodeID
* Build a new ChaincodeID
*/

public static class Builder {
private final ChaincodeID.Builder protoBuilder = ChaincodeID.newBuilder();
private final org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.Builder protoBuilder = org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID.newBuilder();

private Builder() {
}
Expand All @@ -75,7 +70,7 @@ public Builder setName(String name) {
}

/**
* Set the version of the ChainCode
* Set the version of the Chaincode
*
* @param version of the chaincode
* @return Builder
Expand All @@ -99,8 +94,8 @@ public Builder setPath(String path) {
return this;
}

public ChainCodeID build() {
return new ChainCodeID(this.protoBuilder.build());
public ChaincodeID build() {
return new ChaincodeID(this.protoBuilder.build());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package org.hyperledger.fabric.sdk;

public class ChainCodeResponse {
public class ChaincodeResponse {
public enum Status {
UNDEFINED(0),
SUCCESS(200),
Expand All @@ -34,16 +34,16 @@ public int getStatus() {
private Status status = Status.UNDEFINED;
private String message = null;
private String transactionID = null;
private String chainCodeID = null;
private String chaincodeID = null;

public ChainCodeResponse(String transactionID, String chainCodeID, Status status, String message) {
public ChaincodeResponse(String transactionID, String chaincodeID, Status status, String message) {
this.status = status;
this.message = message;
this.transactionID = transactionID;
this.chainCodeID = chainCodeID;
this.chaincodeID = chaincodeID;
}

public ChainCodeResponse(String transactionID, String chainCodeID, int istatus, String message) {
public ChaincodeResponse(String transactionID, String chaincodeID, int istatus, String message) {

switch (istatus) {
case 200:
Expand All @@ -57,7 +57,7 @@ public ChainCodeResponse(String transactionID, String chainCodeID, int istatus,
}
this.message = message;
this.transactionID = transactionID;
this.chainCodeID = chainCodeID;
this.chaincodeID = chaincodeID;
}

/**
Expand All @@ -82,10 +82,10 @@ public String getTransactionID() {
}

// /**
// * @return the chainCodeID
// * @return the chaincodeID
// */
// public ChainCodeID getChainCodeID() {
// return new ChainCodeID()
// public ChaincodeID getChaincodeID() {
// return new ChaincodeID()
// }

}
Loading

0 comments on commit 40bbb9d

Please sign in to comment.