modify sdk test example See merge request jd-blockchain/jdchain!6tags/1.3.0^2
@@ -15,7 +15,7 @@ | |||||
<packaging>pom</packaging> | <packaging>pom</packaging> | ||||
<properties> | <properties> | ||||
<framework.version>1.2.0.RELEASE</framework.version> | |||||
<framework.version>1.3.0.RELEASE</framework.version> | |||||
</properties> | </properties> | ||||
<modules> | <modules> | ||||
@@ -38,7 +38,13 @@ public class SDKDemo_ActiveParticipant { | |||||
// 账本值根据具体情况进行修改 | // 账本值根据具体情况进行修改 | ||||
BasicNameValuePair base58LedgerHash = new BasicNameValuePair("ledgerHash", "j5n3SmYT3rS5aDgwQbDUxBYUMEP9GvVfMiQK3Tcr3vxz3M"); | BasicNameValuePair base58LedgerHash = new BasicNameValuePair("ledgerHash", "j5n3SmYT3rS5aDgwQbDUxBYUMEP9GvVfMiQK3Tcr3vxz3M"); | ||||
// 激活的新参与方的共识网络地址 | |||||
BasicNameValuePair host = new BasicNameValuePair("consensusHost", "127.0.0.1"); | |||||
BasicNameValuePair port = new BasicNameValuePair("consensusPort", "20000"); | |||||
para.add(base58LedgerHash); | para.add(base58LedgerHash); | ||||
para.add(host); | |||||
para.add(port); | |||||
try { | try { | ||||
httpPost.setEntity(new UrlEncodedFormEntity(para,"UTF-8")); | httpPost.setEntity(new UrlEncodedFormEntity(para,"UTF-8")); | ||||
@@ -67,11 +67,8 @@ public class SDKDemo_RegistParticipant { | |||||
BlockchainKeypair user = new BlockchainKeypair(pubKey, privKey); | BlockchainKeypair user = new BlockchainKeypair(pubKey, privKey); | ||||
// 新参与方的共识网络地址 | |||||
NetworkAddress networkAddress = new NetworkAddress("127.0.0.1", 20000); | |||||
// 注册参与方 | // 注册参与方 | ||||
txTemp.participants().register("Peer4", user.getIdentity(), networkAddress); | |||||
txTemp.participants().register("Peer4", user.getIdentity()); | |||||
// TX 准备就绪; | // TX 准备就绪; | ||||
PreparedTransaction prepTx = txTemp.prepare(); | PreparedTransaction prepTx = txTemp.prepare(); | ||||
@@ -5,7 +5,6 @@ import com.jd.blockchain.crypto.KeyGenUtils; | |||||
import com.jd.blockchain.crypto.PrivKey; | import com.jd.blockchain.crypto.PrivKey; | ||||
import com.jd.blockchain.crypto.PubKey; | import com.jd.blockchain.crypto.PubKey; | ||||
import com.jd.blockchain.ledger.*; | import com.jd.blockchain.ledger.*; | ||||
import com.jd.blockchain.utils.net.NetworkAddress; | |||||
public class SDK_RegistParticipant_Demo extends SDK_Base_Demo { | public class SDK_RegistParticipant_Demo extends SDK_Base_Demo { | ||||
@@ -27,14 +26,11 @@ public class SDK_RegistParticipant_Demo extends SDK_Base_Demo { | |||||
BlockchainKeypair user = new BlockchainKeypair(pubKey, privKey); | BlockchainKeypair user = new BlockchainKeypair(pubKey, privKey); | ||||
// 新参与方的共识网络地址 | |||||
NetworkAddress networkAddress = new NetworkAddress("127.0.0.1", 20000); | |||||
// 定义交易模板 | // 定义交易模板 | ||||
TransactionTemplate txTpl = blockchainService.newTransaction(ledgerHash); | TransactionTemplate txTpl = blockchainService.newTransaction(ledgerHash); | ||||
// 注册参与方 | // 注册参与方 | ||||
txTpl.participants().register("Peer4", user.getIdentity(), networkAddress); | |||||
txTpl.participants().register("Peer4", user.getIdentity()); | |||||
// TX 准备就绪; | // TX 准备就绪; | ||||
PreparedTransaction prepTx = txTpl.prepare(); | PreparedTransaction prepTx = txTpl.prepare(); | ||||