@@ -1 +1 @@ | |||||
Subproject commit 22a63e4fe85398a090f7e4abf99cd212549be70f | |||||
Subproject commit b5a9bd9155034260d8babebb6d8701c3627c226b |
@@ -58,6 +58,24 @@ | |||||
<version>${core.version}</version> | <version>${core.version}</version> | ||||
</dependency> | </dependency> | ||||
<dependency> | |||||
<groupId>com.jd.blockchain</groupId> | |||||
<artifactId>tools-regparti-booter</artifactId> | |||||
<version>${core.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>com.jd.blockchain</groupId> | |||||
<artifactId>tools-activeparti-booter</artifactId> | |||||
<version>${core.version}</version> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>com.jd.blockchain</groupId> | |||||
<artifactId>tools-deactiveparti-booter</artifactId> | |||||
<version>${core.version}</version> | |||||
</dependency> | |||||
</dependencies> | </dependencies> | ||||
<build> | <build> | ||||
@@ -0,0 +1,10 @@ | |||||
#!/bin/bash | |||||
OME=$(cd `dirname $0`;cd ../; pwd) | |||||
boot_file=$(ls ../libs | grep tools-activeparti-booter-) | |||||
if [ ! -n "$boot_file" ]; then | |||||
echo "tools-activeparti-booter is null" | |||||
else | |||||
echo "active participant" | |||||
java -jar $HOME/libs/$boot_file $* | |||||
fi |
@@ -0,0 +1,10 @@ | |||||
#!/bin/bash | |||||
OME=$(cd `dirname $0`;cd ../; pwd) | |||||
boot_file=$(ls ../libs | grep tools-deactiveparti-booter-) | |||||
if [ ! -n "$boot_file" ]; then | |||||
echo "tools-deactiveparti-booter is null" | |||||
else | |||||
echo "deactive participant" | |||||
java -jar $HOME/libs/$boot_file $* | |||||
fi |
@@ -0,0 +1,10 @@ | |||||
#!/bin/bash | |||||
HOME=$(cd `dirname $0`;cd ../; pwd) | |||||
boot_file=$(ls ../libs | grep tools-regparti-booter-) | |||||
if [ ! -n "$boot_file" ]; then | |||||
echo "tools-regparti-booter is null" | |||||
else | |||||
echo "register new participant" | |||||
java -jar $HOME/libs/$boot_file $* | |||||
fi |
@@ -0,0 +1,42 @@ | |||||
package com.jd.blockchain.sdk.samples; | |||||
import com.jd.blockchain.ledger.PreparedTransaction; | |||||
import com.jd.blockchain.ledger.TransactionResponse; | |||||
import com.jd.blockchain.ledger.TransactionTemplate; | |||||
import com.jd.blockchain.utils.Property; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
public class SDK_Update_ConsensusSettings_Demo extends SDK_Base_Demo { | |||||
public static void main(String[] args) { | |||||
new SDK_Update_ConsensusSettings_Demo().updateSettings(); | |||||
} | |||||
public void updateSettings() { | |||||
List<Property> properties = new ArrayList<Property>(); | |||||
// 修改bftsmart.conf配置文件中的选项; | |||||
properties.add(new Property("system.communication.useSenderThread", "false")); | |||||
Property[] propertiesArray = properties.toArray(new Property[properties.size()]); | |||||
TransactionTemplate txTpl = blockchainService.newTransaction(ledgerHash); | |||||
txTpl.settings().update(propertiesArray); | |||||
// TX 准备就绪; | |||||
PreparedTransaction prepTx = txTpl.prepare(); | |||||
// 使用私钥进行签名; | |||||
prepTx.sign(adminKey); | |||||
// 提交交易; | |||||
TransactionResponse transactionResponse = prepTx.commit(); | |||||
System.out.println(transactionResponse.isSuccess()); | |||||
} | |||||
} |