@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>base</artifactId> | <artifactId>base</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>binary-proto</artifactId> | <artifactId>binary-proto</artifactId> | ||||
@@ -11,7 +11,6 @@ import com.jd.blockchain.utils.io.BytesSlice; | |||||
import com.jd.blockchain.utils.io.BytesUtils; | import com.jd.blockchain.utils.io.BytesUtils; | ||||
public class BinaryProtocol { | public class BinaryProtocol { | ||||
public static void encode(Object data, Class<?> contractType, OutputStream out) { | public static void encode(Object data, Class<?> contractType, OutputStream out) { | ||||
DataContractEncoder encoder = DataContractContext.resolve(contractType); | DataContractEncoder encoder = DataContractContext.resolve(contractType); | ||||
@@ -33,8 +32,6 @@ public class BinaryProtocol { | |||||
byte[] bytes = BytesUtils.copyToBytes(in); | byte[] bytes = BytesUtils.copyToBytes(in); | ||||
return decode(bytes); | return decode(bytes); | ||||
} | } | ||||
public static <T> T decode(byte[] dataSegment) { | public static <T> T decode(byte[] dataSegment) { | ||||
BytesSlice bytes = new BytesSlice(dataSegment, 0, dataSegment.length); | BytesSlice bytes = new BytesSlice(dataSegment, 0, dataSegment.length); | ||||
@@ -49,19 +46,32 @@ public class BinaryProtocol { | |||||
return encoder.decode(bytes.getInputStream()); | return encoder.decode(bytes.getInputStream()); | ||||
} | } | ||||
public static <T> T decodeAs(byte[] dataSegment, Class<T> contractType) { | |||||
public static <T> T decode(byte[] dataSegment, Class<T> contractType) { | |||||
return decode(dataSegment, contractType, true); | |||||
} | |||||
public static <T> T decode(byte[] dataSegment, Class<T> contractType, boolean autoRegister) { | |||||
DataContractEncoder encoder = DataContractContext.ENCODER_LOOKUP.lookup(contractType); | DataContractEncoder encoder = DataContractContext.ENCODER_LOOKUP.lookup(contractType); | ||||
if (encoder == null) { | if (encoder == null) { | ||||
throw new DataContractException("Contract type is not registered! --" + contractType.toString()); | |||||
if (autoRegister) { | |||||
encoder = DataContractContext.resolve(contractType); | |||||
} else { | |||||
throw new DataContractException("Contract type is not registered! --" + contractType.toString()); | |||||
} | |||||
} | } | ||||
BytesSlice bytes = new BytesSlice(dataSegment, 0, dataSegment.length); | BytesSlice bytes = new BytesSlice(dataSegment, 0, dataSegment.length); | ||||
return encoder.decode(bytes.getInputStream()); | return encoder.decode(bytes.getInputStream()); | ||||
} | } | ||||
@Deprecated | |||||
public static <T> T decodeAs(byte[] dataSegment, Class<T> contractType) { | |||||
return decode(dataSegment, contractType, true); | |||||
} | |||||
@Deprecated | |||||
public static <T> T decodeAs(byte[] dataSegment, Class<T> contractType, boolean autoRegister) { | |||||
return decode(dataSegment, contractType, autoRegister); | |||||
} | |||||
} | } |
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>consensus</artifactId> | <artifactId>consensus</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>consensus-bftsmart</artifactId> | <artifactId>consensus-bftsmart</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>consensus</artifactId> | <artifactId>consensus</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>consensus-framework</artifactId> | <artifactId>consensus-framework</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>consensus</artifactId> | <artifactId>consensus</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>consensus-mq</artifactId> | <artifactId>consensus-mq</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>consensus</artifactId> | <artifactId>consensus</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>contract</artifactId> | <artifactId>contract</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>contract-framework</artifactId> | <artifactId>contract-framework</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>contract</artifactId> | <artifactId>contract</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>contract-jvm</artifactId> | <artifactId>contract-jvm</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>contract</artifactId> | <artifactId>contract</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>contract-maven-plugin</artifactId> | <artifactId>contract-maven-plugin</artifactId> | ||||
<packaging>maven-plugin</packaging> | <packaging>maven-plugin</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<artifactId>contract</artifactId> | <artifactId>contract</artifactId> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>contract</artifactId> | <artifactId>contract</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>crypto</artifactId> | <artifactId>crypto</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>crypto-adv</artifactId> | <artifactId>crypto-adv</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>crypto</artifactId> | <artifactId>crypto</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>crypto-classic</artifactId> | <artifactId>crypto-classic</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>crypto</artifactId> | <artifactId>crypto</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>crypto-framework</artifactId> | <artifactId>crypto-framework</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<artifactId>crypto</artifactId> | <artifactId>crypto</artifactId> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>crypto</artifactId> | <artifactId>crypto</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>crypto-sm</artifactId> | <artifactId>crypto-sm</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>crypto</artifactId> | <artifactId>crypto</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>deployment</artifactId> | <artifactId>deployment</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>deployment-gateway</artifactId> | <artifactId>deployment-gateway</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>deployment</artifactId> | <artifactId>deployment</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>deployment-peer</artifactId> | <artifactId>deployment-peer</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>deployment</artifactId> | <artifactId>deployment</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>gateway</artifactId> | <artifactId>gateway</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>ledger</artifactId> | <artifactId>ledger</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ledger-core</artifactId> | <artifactId>ledger-core</artifactId> | ||||
@@ -6,7 +6,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>ledger</artifactId> | <artifactId>ledger</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ledger-model</artifactId> | <artifactId>ledger-model</artifactId> | ||||
@@ -1,16 +1,10 @@ | |||||
package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.util.Arrays; | |||||
import java.util.Collection; | |||||
import java.util.Comparator; | |||||
import org.springframework.cglib.proxy.UndeclaredThrowableException; | |||||
import com.jd.blockchain.crypto.AsymmetricKeypair; | import com.jd.blockchain.crypto.AsymmetricKeypair; | ||||
import com.jd.blockchain.crypto.HashDigest; | import com.jd.blockchain.crypto.HashDigest; | ||||
import com.jd.blockchain.ledger.DigitalSignature; | import com.jd.blockchain.ledger.DigitalSignature; | ||||
import com.jd.blockchain.ledger.OperationResult; | |||||
import com.jd.blockchain.ledger.PreparedTransaction; | import com.jd.blockchain.ledger.PreparedTransaction; | ||||
import com.jd.blockchain.ledger.TransactionContent; | import com.jd.blockchain.ledger.TransactionContent; | ||||
import com.jd.blockchain.ledger.TransactionRequest; | import com.jd.blockchain.ledger.TransactionRequest; | ||||
@@ -21,34 +15,17 @@ public class PreparedTx implements PreparedTransaction { | |||||
private TransactionRequestBuilder txReqBuilder; | private TransactionRequestBuilder txReqBuilder; | ||||
private TransactionService txProcessor; | |||||
private OperationResultHandle[] opReturnValueHandlers; | |||||
private TxStateManager stateManager; | |||||
private TransactionService txService; | |||||
/** | /** | ||||
* 创建一个“就绪交易”对象; | * 创建一个“就绪交易”对象; | ||||
* | * | ||||
* @param txReqBuilder 交易请求构建器; | |||||
* @param txProcessor 交易处理服务; | |||||
* @param opReturnValueHandlerList 操作返回值处理器列表; | |||||
* @param txReqBuilder 交易请求构建器; | |||||
* @param txService 交易处理服务; | |||||
*/ | */ | ||||
public PreparedTx(TxStateManager stateManager, TransactionRequestBuilder txReqBuilder, | |||||
TransactionService txProcessor, Collection<OperationResultHandle> opReturnValueHandlerList) { | |||||
this.stateManager = stateManager; | |||||
public PreparedTx(TransactionRequestBuilder txReqBuilder, TransactionService txService) { | |||||
this.txReqBuilder = txReqBuilder; | this.txReqBuilder = txReqBuilder; | ||||
this.txProcessor = txProcessor; | |||||
this.opReturnValueHandlers = opReturnValueHandlerList | |||||
.toArray(new OperationResultHandle[opReturnValueHandlerList.size()]); | |||||
// 按照操作索引升序排列; | |||||
Arrays.sort(opReturnValueHandlers, new Comparator<OperationResultHandle>() { | |||||
@Override | |||||
public int compare(OperationResultHandle o1, OperationResultHandle o2) { | |||||
return o1.getOperationIndex() - o2.getOperationIndex(); | |||||
} | |||||
}); | |||||
this.txService = txService; | |||||
} | } | ||||
@Override | @Override | ||||
@@ -75,60 +52,14 @@ public class PreparedTx implements PreparedTransaction { | |||||
@Override | @Override | ||||
public TransactionResponse commit() { | public TransactionResponse commit() { | ||||
stateManager.commit(); | |||||
TransactionResponse txResponse = null; | |||||
try { | |||||
TransactionRequest txReq = txReqBuilder.buildRequest(); | |||||
// 发起交易请求; | |||||
txResponse = txProcessor.process(txReq); | |||||
stateManager.complete(); | |||||
} catch (Exception ex) { | |||||
stateManager.close(); | |||||
handleError(ex); | |||||
throw new UndeclaredThrowableException(ex); | |||||
} | |||||
if (txResponse != null) { | |||||
handleResults(txResponse); | |||||
} | |||||
return txResponse; | |||||
// 生成请求; | |||||
TransactionRequest txReq = txReqBuilder.buildRequest(); | |||||
// 发起交易请求; | |||||
return txService.process(txReq); | |||||
} | } | ||||
@Override | @Override | ||||
public void close() throws IOException { | public void close() throws IOException { | ||||
if (!stateManager.close()) { | |||||
TransactionCancelledExeption error = new TransactionCancelledExeption( | |||||
"Prepared transaction has been cancelled!"); | |||||
handleError(error); | |||||
} | |||||
} | |||||
private void handleError(Throwable error) { | |||||
for (OperationResultHandle handle : opReturnValueHandlers) { | |||||
handle.complete(error); | |||||
} | |||||
} | |||||
private void handleResults(TransactionResponse txResponse) { | |||||
// 解析返回值;正常的情况下,返回结果列表与结果处理器列表中元素对应的操作索引是一致的; | |||||
OperationResult[] opResults = txResponse.getOperationResults(); | |||||
if (opResults != null && opResults.length > 0) { | |||||
if (opResults.length != opReturnValueHandlers.length) { | |||||
throw new IllegalStateException(String.format( | |||||
"The operation result list of tx doesn't match it's return value handler list! --[TX.Content.Hash=%s][NumOfResults=%s][NumOfHandlers=%s]", | |||||
txResponse.getContentHash(), opResults.length, opReturnValueHandlers.length)); | |||||
} | |||||
for (int i = 0; i < opResults.length; i++) { | |||||
if (opResults[i].getIndex() != opReturnValueHandlers[i].getOperationIndex()) { | |||||
throw new IllegalStateException( | |||||
"The operation indexes of the items in the result list and in the handler list don't match!"); | |||||
} | |||||
opReturnValueHandlers[i].complete(opResults[i].getResult()); | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -0,0 +1,108 @@ | |||||
package com.jd.blockchain.transaction; | |||||
import java.io.IOException; | |||||
import java.util.Arrays; | |||||
import java.util.Collection; | |||||
import java.util.Comparator; | |||||
import org.springframework.cglib.proxy.UndeclaredThrowableException; | |||||
import com.jd.blockchain.crypto.AsymmetricKeypair; | |||||
import com.jd.blockchain.ledger.DigitalSignature; | |||||
import com.jd.blockchain.ledger.OperationResult; | |||||
import com.jd.blockchain.ledger.TransactionRequestBuilder; | |||||
import com.jd.blockchain.ledger.TransactionResponse; | |||||
class StatefulPreparedTx extends PreparedTx { | |||||
private OperationResultHandle[] opReturnValueHandlers; | |||||
private TxStateManager stateManager; | |||||
/** | |||||
* 创建一个“就绪交易”对象; | |||||
* | |||||
* @param txReqBuilder 交易请求构建器; | |||||
* @param txProcessor 交易处理服务; | |||||
* @param opReturnValueHandlerList 操作返回值处理器列表; | |||||
*/ | |||||
StatefulPreparedTx(TxStateManager stateManager, TransactionRequestBuilder txReqBuilder, | |||||
TransactionService txProcessor, Collection<OperationResultHandle> opReturnValueHandlerList) { | |||||
super(txReqBuilder, txProcessor); | |||||
this.stateManager = stateManager; | |||||
this.opReturnValueHandlers = opReturnValueHandlerList | |||||
.toArray(new OperationResultHandle[opReturnValueHandlerList.size()]); | |||||
// 按照操作索引升序排列; | |||||
Arrays.sort(opReturnValueHandlers, new Comparator<OperationResultHandle>() { | |||||
@Override | |||||
public int compare(OperationResultHandle o1, OperationResultHandle o2) { | |||||
return o1.getOperationIndex() - o2.getOperationIndex(); | |||||
} | |||||
}); | |||||
} | |||||
@Override | |||||
public DigitalSignature sign(AsymmetricKeypair keyPair) { | |||||
DigitalSignature signature = SignatureUtils.sign(getTransactionContent(), keyPair); | |||||
addSignature(signature); | |||||
return signature; | |||||
} | |||||
@Override | |||||
public TransactionResponse commit() { | |||||
stateManager.commit(); | |||||
TransactionResponse txResponse = null; | |||||
try { | |||||
// 发起交易请求; | |||||
txResponse = super.commit(); | |||||
stateManager.complete(); | |||||
} catch (Exception ex) { | |||||
stateManager.close(); | |||||
handleError(ex); | |||||
throw new UndeclaredThrowableException(ex); | |||||
} | |||||
if (txResponse != null) { | |||||
handleResults(txResponse); | |||||
} | |||||
return txResponse; | |||||
} | |||||
@Override | |||||
public void close() throws IOException { | |||||
if (!stateManager.close()) { | |||||
TransactionCancelledExeption error = new TransactionCancelledExeption( | |||||
"Prepared transaction has been cancelled!"); | |||||
handleError(error); | |||||
} | |||||
} | |||||
private void handleError(Throwable error) { | |||||
for (OperationResultHandle handle : opReturnValueHandlers) { | |||||
handle.complete(error); | |||||
} | |||||
} | |||||
private void handleResults(TransactionResponse txResponse) { | |||||
// 解析返回值;正常的情况下,返回结果列表与结果处理器列表中元素对应的操作索引是一致的; | |||||
OperationResult[] opResults = txResponse.getOperationResults(); | |||||
if (opResults != null && opResults.length > 0) { | |||||
if (opResults.length != opReturnValueHandlers.length) { | |||||
throw new IllegalStateException(String.format( | |||||
"The operation result list of tx doesn't match it's return value handler list! --[TX.Content.Hash=%s][NumOfResults=%s][NumOfHandlers=%s]", | |||||
txResponse.getContentHash(), opResults.length, opReturnValueHandlers.length)); | |||||
} | |||||
for (int i = 0; i < opResults.length; i++) { | |||||
if (opResults[i].getIndex() != opReturnValueHandlers[i].getOperationIndex()) { | |||||
throw new IllegalStateException( | |||||
"The operation indexes of the items in the result list and in the handler list don't match!"); | |||||
} | |||||
opReturnValueHandlers[i].complete(opResults[i].getResult()); | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -32,7 +32,7 @@ public class TxTemplate implements TransactionTemplate { | |||||
public PreparedTransaction prepare() { | public PreparedTransaction prepare() { | ||||
stateManager.prepare(); | stateManager.prepare(); | ||||
TransactionRequestBuilder txReqBuilder = txBuilder.prepareRequest(); | TransactionRequestBuilder txReqBuilder = txBuilder.prepareRequest(); | ||||
return new PreparedTx(stateManager, txReqBuilder, txService, txBuilder.getReturnValuehandlers()); | |||||
return new StatefulPreparedTx(stateManager, txReqBuilder, txService, txBuilder.getReturnValuehandlers()); | |||||
} | } | ||||
@Override | @Override | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>ledger</artifactId> | <artifactId>ledger</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ledger-rpc</artifactId> | <artifactId>ledger-rpc</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>ledger</artifactId> | <artifactId>ledger</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<artifactId>manager</artifactId> | <artifactId>manager</artifactId> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<artifactId>manager</artifactId> | <artifactId>manager</artifactId> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<artifactId>manager</artifactId> | <artifactId>manager</artifactId> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<artifactId>manager</artifactId> | <artifactId>manager</artifactId> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
@@ -11,7 +11,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>manager</artifactId> | <artifactId>manager</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>peer</artifactId> | <artifactId>peer</artifactId> | ||||
@@ -11,7 +11,7 @@ | |||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
<description>jdchain</description> | <description>jdchain</description> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>runtime</artifactId> | <artifactId>runtime</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>runtime</artifactId> | <artifactId>runtime</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>runtime-context</artifactId> | <artifactId>runtime-context</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>runtime</artifactId> | <artifactId>runtime</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>runtime-modular-booter</artifactId> | <artifactId>runtime-modular-booter</artifactId> | ||||
</project> | </project> |
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>runtime</artifactId> | <artifactId>runtime</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>runtime-modular</artifactId> | <artifactId>runtime-modular</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>sdk</artifactId> | <artifactId>sdk</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>sdk</artifactId> | <artifactId>sdk</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>sdk-base</artifactId> | <artifactId>sdk-base</artifactId> | ||||
@@ -1,6 +1,8 @@ | |||||
package com.jd.blockchain.sdk; | package com.jd.blockchain.sdk; | ||||
import com.jd.blockchain.crypto.HashDigest; | import com.jd.blockchain.crypto.HashDigest; | ||||
import com.jd.blockchain.ledger.PreparedTransaction; | |||||
import com.jd.blockchain.ledger.TransactionContent; | |||||
import com.jd.blockchain.ledger.TransactionTemplate; | import com.jd.blockchain.ledger.TransactionTemplate; | ||||
public interface BlockchainTransactionService { | public interface BlockchainTransactionService { | ||||
@@ -12,6 +14,14 @@ public interface BlockchainTransactionService { | |||||
*/ | */ | ||||
TransactionTemplate newTransaction(HashDigest ledgerHash); | TransactionTemplate newTransaction(HashDigest ledgerHash); | ||||
/** | |||||
* 根据交易内容准备交易实例; | |||||
* | |||||
* @param content | |||||
* @return | |||||
*/ | |||||
PreparedTransaction prepareTransaction(TransactionContent content); | |||||
// /** | // /** | ||||
// * 以指定的科目和流水号发起新交易; | // * 以指定的科目和流水号发起新交易; | ||||
// * | // * | ||||
@@ -11,6 +11,8 @@ import com.jd.blockchain.ledger.LedgerInfo; | |||||
import com.jd.blockchain.ledger.LedgerMetadata; | import com.jd.blockchain.ledger.LedgerMetadata; | ||||
import com.jd.blockchain.ledger.LedgerTransaction; | import com.jd.blockchain.ledger.LedgerTransaction; | ||||
import com.jd.blockchain.ledger.ParticipantNode; | import com.jd.blockchain.ledger.ParticipantNode; | ||||
import com.jd.blockchain.ledger.PreparedTransaction; | |||||
import com.jd.blockchain.ledger.TransactionContent; | |||||
import com.jd.blockchain.ledger.TransactionState; | import com.jd.blockchain.ledger.TransactionState; | ||||
import com.jd.blockchain.ledger.TransactionTemplate; | import com.jd.blockchain.ledger.TransactionTemplate; | ||||
import com.jd.blockchain.ledger.UserInfo; | import com.jd.blockchain.ledger.UserInfo; | ||||
@@ -19,7 +21,9 @@ import com.jd.blockchain.sdk.BlockchainEventListener; | |||||
import com.jd.blockchain.sdk.BlockchainService; | import com.jd.blockchain.sdk.BlockchainService; | ||||
import com.jd.blockchain.sdk.converters.ClientResolveUtil; | import com.jd.blockchain.sdk.converters.ClientResolveUtil; | ||||
import com.jd.blockchain.transaction.BlockchainQueryService; | import com.jd.blockchain.transaction.BlockchainQueryService; | ||||
import com.jd.blockchain.transaction.PreparedTx; | |||||
import com.jd.blockchain.transaction.TransactionService; | import com.jd.blockchain.transaction.TransactionService; | ||||
import com.jd.blockchain.transaction.TxRequestBuilder; | |||||
import com.jd.blockchain.transaction.TxTemplate; | import com.jd.blockchain.transaction.TxTemplate; | ||||
public abstract class BlockchainServiceProxy implements BlockchainService { | public abstract class BlockchainServiceProxy implements BlockchainService { | ||||
@@ -33,6 +37,12 @@ public abstract class BlockchainServiceProxy implements BlockchainService { | |||||
public TransactionTemplate newTransaction(HashDigest ledgerHash) { | public TransactionTemplate newTransaction(HashDigest ledgerHash) { | ||||
return new TxTemplate(ledgerHash, getTransactionService(ledgerHash)); | return new TxTemplate(ledgerHash, getTransactionService(ledgerHash)); | ||||
} | } | ||||
@Override | |||||
public PreparedTransaction prepareTransaction(TransactionContent content) { | |||||
TxRequestBuilder txReqBuilder = new TxRequestBuilder(content); | |||||
return new PreparedTx(txReqBuilder, getTransactionService(content.getLedgerHash())); | |||||
} | |||||
@Override | @Override | ||||
public BlockchainEventHandle addBlockchainEventListener(int filteredEventTypes, String filteredTxHash, | public BlockchainEventHandle addBlockchainEventListener(int filteredEventTypes, String filteredTxHash, | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>sdk</artifactId> | <artifactId>sdk</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>sdk-client</artifactId> | <artifactId>sdk-client</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>sdk</artifactId> | <artifactId>sdk</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>sdk-samples</artifactId> | <artifactId>sdk-samples</artifactId> | ||||
@@ -0,0 +1,112 @@ | |||||
/** | |||||
* Copyright: Copyright 2016-2020 JD.COM All Right Reserved | |||||
* FileName: com.jd.blockchain.sdk.samples.SDKDemo_RegisterUser | |||||
* Author: shaozhuguang | |||||
* Department: 区块链研发部 | |||||
* Date: 2018/10/18 下午2:00 | |||||
* Description: 注册用户 | |||||
*/ | |||||
package com.jd.blockchain.sdk.samples; | |||||
import com.jd.blockchain.binaryproto.BinaryProtocol; | |||||
import com.jd.blockchain.binaryproto.DataContractRegistry; | |||||
import com.jd.blockchain.crypto.AsymmetricKeypair; | |||||
import com.jd.blockchain.crypto.HashDigest; | |||||
import com.jd.blockchain.crypto.PrivKey; | |||||
import com.jd.blockchain.crypto.PubKey; | |||||
import com.jd.blockchain.ledger.*; | |||||
import com.jd.blockchain.sdk.BlockchainService; | |||||
import com.jd.blockchain.sdk.client.GatewayServiceFactory; | |||||
import com.jd.blockchain.transaction.SignatureUtils; | |||||
import com.jd.blockchain.utils.ConsoleUtils; | |||||
/** | |||||
* 注册用户 | |||||
* | |||||
* @author shaozhuguang | |||||
* @create 2018/10/18 | |||||
* @since 1.0.0 | |||||
*/ | |||||
public class SDKDemo_Tx_Persistance { | |||||
public static void main(String[] args) { | |||||
String GATEWAY_IPADDR = "127.0.0.1"; | |||||
int GATEWAY_PORT = 8081; | |||||
if (args != null && args.length == 2) { | |||||
GATEWAY_IPADDR = args[0]; | |||||
GATEWAY_PORT = Integer.parseInt(args[1]); | |||||
} | |||||
// 注册相关class | |||||
DataContractRegistry.register(TransactionContent.class); | |||||
DataContractRegistry.register(TransactionContentBody.class); | |||||
DataContractRegistry.register(TransactionRequest.class); | |||||
DataContractRegistry.register(NodeRequest.class); | |||||
DataContractRegistry.register(EndpointRequest.class); | |||||
DataContractRegistry.register(TransactionResponse.class); | |||||
PrivKey privKey1 = SDKDemo_Params.privkey1; | |||||
PubKey pubKey1 = SDKDemo_Params.pubKey1; | |||||
PrivKey privKey2 = SDKDemo_Params.privkey1; | |||||
PubKey pubKey2 = SDKDemo_Params.pubKey1; | |||||
BlockchainKeypair CLIENT_CERT = new BlockchainKeypair(SDKDemo_Params.pubKey0, SDKDemo_Params.privkey0); | |||||
boolean SECURE = false; | |||||
GatewayServiceFactory gatewayServiceFactory = GatewayServiceFactory.connect(GATEWAY_IPADDR, GATEWAY_PORT, SECURE, | |||||
CLIENT_CERT); | |||||
BlockchainService blockchainService = gatewayServiceFactory.getBlockchainService(); | |||||
HashDigest[] ledgerHashs = blockchainService.getLedgerHashs(); | |||||
// 在本地定义注册账号的 TX; | |||||
TransactionTemplate txTemp = blockchainService.newTransaction(ledgerHashs[0]); | |||||
// existed signer | |||||
AsymmetricKeypair keyPair1 = new BlockchainKeypair(pubKey1, privKey1); | |||||
AsymmetricKeypair keyPair2 = new BlockchainKeypair(pubKey2, privKey2); | |||||
BlockchainKeypair user = BlockchainKeyGenerator.getInstance().generate(); | |||||
// 注册 | |||||
txTemp.users().register(user.getIdentity()); | |||||
// 定义角色权限; | |||||
txTemp.security().roles().configure("MANAGER") | |||||
.enable(LedgerPermission.REGISTER_USER, LedgerPermission.REGISTER_DATA_ACCOUNT) | |||||
.enable(TransactionPermission.CONTRACT_OPERATION); | |||||
txTemp.security().authorziations().forUser(user.getIdentity()).authorize("MANAGER"); | |||||
// TX 准备就绪; | |||||
PreparedTransaction prepTx = txTemp.prepare(); | |||||
// 序列化交易内容; | |||||
byte[] txContentBytes = BinaryProtocol.encode(prepTx.getTransactionContent(), TransactionContent.class); | |||||
// 反序列化交易内容; | |||||
TransactionContent txContent = BinaryProtocol.decode(txContentBytes, TransactionContent.class); | |||||
// 对交易内容签名; | |||||
DigitalSignature signature1 = SignatureUtils.sign(txContent, keyPair1); | |||||
// 根据交易内容重新准备交易; | |||||
PreparedTransaction decodedPrepTx = blockchainService.prepareTransaction(txContent); | |||||
// 使用私钥进行签名,或附加签名; | |||||
decodedPrepTx.addSignature(signature1); | |||||
decodedPrepTx.sign(keyPair2); | |||||
// 提交交易; | |||||
TransactionResponse transactionResponse = decodedPrepTx.commit(); | |||||
// 解析返回结果;如果是合约调用的操作,需要自行解析返回结果; | |||||
if (transactionResponse.isSuccess()) { | |||||
// 操作结果对应于交易中的操作顺序;无返回结果的操作对应结果为 null; | |||||
OperationResult opResult = transactionResponse.getOperationResults()[0];// | |||||
Class<?> dataClazz = null;//返回值的类型; | |||||
Object value = BytesValueEncoding.decode(opResult.getResult(), dataClazz); | |||||
} | |||||
ConsoleUtils.info("register user complete, result is [%s]", transactionResponse.isSuccess()); | |||||
} | |||||
} |
@@ -3,7 +3,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>storage</artifactId> | <artifactId>storage</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>storage</artifactId> | <artifactId>storage</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>storage-composite</artifactId> | <artifactId>storage-composite</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>storage</artifactId> | <artifactId>storage</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>storage-redis</artifactId> | <artifactId>storage-redis</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>storage</artifactId> | <artifactId>storage</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>storage-rocksdb</artifactId> | <artifactId>storage-rocksdb</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>storage</artifactId> | <artifactId>storage</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>storage-service</artifactId> | <artifactId>storage-service</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>test</artifactId> | <artifactId>test</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>test</artifactId> | <artifactId>test</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>test-consensus-client</artifactId> | <artifactId>test-consensus-client</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>test</artifactId> | <artifactId>test</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>test-consensus-node</artifactId> | <artifactId>test-consensus-node</artifactId> | ||||
<dependencies> | <dependencies> | ||||
@@ -38,7 +38,7 @@ | |||||
<dependency> | <dependency> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>consensus-bftsmart</artifactId> | <artifactId>consensus-bftsmart</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</dependency> | </dependency> | ||||
<dependency> | <dependency> | ||||
<groupId>org.springframework.boot</groupId> | <groupId>org.springframework.boot</groupId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>test</artifactId> | <artifactId>test</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>test-integration</artifactId> | <artifactId>test-integration</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>test</artifactId> | <artifactId>test</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>test-ledger</artifactId> | <artifactId>test-ledger</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>tools</artifactId> | <artifactId>tools</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>tools</artifactId> | <artifactId>tools</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>tools-initializer-booter</artifactId> | <artifactId>tools-initializer-booter</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>tools</artifactId> | <artifactId>tools</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>tools-initializer</artifactId> | <artifactId>tools-initializer</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>tools</artifactId> | <artifactId>tools</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>tools-keygen-booter</artifactId> | <artifactId>tools-keygen-booter</artifactId> | ||||
@@ -5,7 +5,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>tools</artifactId> | <artifactId>tools</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>tools-keygen</artifactId> | <artifactId>tools-keygen</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>jdchain-root</artifactId> | <artifactId>jdchain-root</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>utils-common</artifactId> | <artifactId>utils-common</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<properties> | <properties> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>utils-serialize</artifactId> | <artifactId>utils-serialize</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>utils-test</artifactId> | <artifactId>utils-test</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>utils-web-server</artifactId> | <artifactId>utils-web-server</artifactId> | ||||
@@ -4,7 +4,7 @@ | |||||
<parent> | <parent> | ||||
<groupId>com.jd.blockchain</groupId> | <groupId>com.jd.blockchain</groupId> | ||||
<artifactId>utils</artifactId> | <artifactId>utils</artifactId> | ||||
<version>1.1.3.RELEASE</version> | |||||
<version>1.1.4-SNAPSHOT</version> | |||||
</parent> | </parent> | ||||
<artifactId>utils-web</artifactId> | <artifactId>utils-web</artifactId> | ||||
<dependencies> | <dependencies> | ||||