| @@ -1,11 +1,10 @@ | |||||
| package com.jd.blockchain.ledger.core.handles; | package com.jd.blockchain.ledger.core.handles; | ||||
| import com.jd.blockchain.consensus.ConsensusProvider; | |||||
| import com.jd.blockchain.consensus.ConsensusProviders; | |||||
| import com.jd.blockchain.crypto.AddressEncoding; | import com.jd.blockchain.crypto.AddressEncoding; | ||||
| 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.ledger.core.*; | import com.jd.blockchain.ledger.core.*; | ||||
| import com.jd.blockchain.transaction.UserRegisterOpTemplate; | |||||
| import com.jd.blockchain.utils.Bytes; | import com.jd.blockchain.utils.Bytes; | ||||
| @@ -27,22 +26,15 @@ public class ParticipantRegisterOperationHandle extends AbstractLedgerOperationH | |||||
| LedgerAdminDataset adminAccountDataSet = newBlockDataset.getAdminDataset(); | LedgerAdminDataset adminAccountDataSet = newBlockDataset.getAdminDataset(); | ||||
| ParticipantInfo participantInfo = participantRegOp.getParticipantInfo(); | |||||
| ParticipantInfo participantInfo = new ParticipantInfoData(participantRegOp.getParticipantName(), participantRegOp.getParticipantIdentity().getPubKey(), participantRegOp.getNetworkAddress()); | |||||
| ParticipantNode participantNode = new PartNode((int)(adminAccountDataSet.getParticipantCount()), participantInfo.getName(), participantInfo.getPubKey(), ParticipantNodeState.REGISTED); | ParticipantNode participantNode = new PartNode((int)(adminAccountDataSet.getParticipantCount()), participantInfo.getName(), participantInfo.getPubKey(), ParticipantNodeState.REGISTED); | ||||
| PubKey pubKey = participantNode.getPubKey(); | |||||
| BlockchainIdentityData identityData = new BlockchainIdentityData(pubKey); | |||||
| // //reg participant as user | |||||
| // dataset.getUserAccountSet().register(identityData.getAddress(), pubKey); | |||||
| //add new participant as consensus node | //add new participant as consensus node | ||||
| adminAccountDataSet.addParticipant(participantNode); | adminAccountDataSet.addParticipant(participantNode); | ||||
| // Build UserRegisterOperation; | |||||
| UserRegisterOperation userRegOp = null;// | |||||
| // Build UserRegisterOperation, reg participant as user | |||||
| UserRegisterOperation userRegOp = new UserRegisterOpTemplate(participantRegOp.getParticipantIdentity()); | |||||
| handleContext.handle(userRegOp); | handleContext.handle(userRegOp); | ||||
| } | } | ||||
| @@ -34,14 +34,14 @@ public class ParticipantStateUpdateOperationHandle extends AbstractLedgerOperati | |||||
| ParticipantNode participantNode = null; | ParticipantNode participantNode = null; | ||||
| for(int i = 0; i < participants.length; i++) { | for(int i = 0; i < participants.length; i++) { | ||||
| if (stateUpdateOperation.getStateUpdateInfo().getPubKey().equals(participants[i].getPubKey())) { | |||||
| if (stateUpdateOperation.getParticipantIdentity().getPubKey().equals(participants[i].getPubKey())) { | |||||
| participantNode = new PartNode(participants[i].getId(), participants[i].getName(), participants[i].getPubKey(), ParticipantNodeState.CONSENSUSED); | participantNode = new PartNode(participants[i].getId(), participants[i].getName(), participants[i].getPubKey(), ParticipantNodeState.CONSENSUSED); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| //update consensus setting | //update consensus setting | ||||
| ParticipantInfo participantInfo = new ParticipantInfoData(participantNode.getName(), participantNode.getPubKey(), stateUpdateOperation.getStateUpdateInfo().getNetworkAddress()); | |||||
| ParticipantInfo participantInfo = new ParticipantInfoData(participantNode.getName(), participantNode.getPubKey(), stateUpdateOperation.getNetworkAddress()); | |||||
| Bytes newConsensusSettings = provider.getSettingsFactory().getConsensusSettingsBuilder().updateSettings(adminAccountDataSet.getSettings().getConsensusSetting(), participantInfo); | Bytes newConsensusSettings = provider.getSettingsFactory().getConsensusSettingsBuilder().updateSettings(adminAccountDataSet.getSettings().getConsensusSetting(), participantInfo); | ||||
| @@ -2,6 +2,7 @@ package com.jd.blockchain.ledger; | |||||
| import com.jd.blockchain.crypto.PubKey; | import com.jd.blockchain.crypto.PubKey; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | import com.jd.blockchain.utils.net.NetworkAddress; | ||||
| import org.omg.CORBA.PUBLIC_MEMBER; | |||||
| /** | /** | ||||
| * 即将要注册的参与方的信息 | * 即将要注册的参与方的信息 | ||||
| @@ -2,12 +2,19 @@ package com.jd.blockchain.ledger; | |||||
| import com.jd.blockchain.binaryproto.DataContract; | import com.jd.blockchain.binaryproto.DataContract; | ||||
| import com.jd.blockchain.binaryproto.DataField; | import com.jd.blockchain.binaryproto.DataField; | ||||
| import com.jd.blockchain.binaryproto.PrimitiveType; | |||||
| import com.jd.blockchain.consts.DataCodes; | import com.jd.blockchain.consts.DataCodes; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| @DataContract(code= DataCodes.TX_OP_PARTICIPANT_REG) | @DataContract(code= DataCodes.TX_OP_PARTICIPANT_REG) | ||||
| public interface ParticipantRegisterOperation extends Operation { | public interface ParticipantRegisterOperation extends Operation { | ||||
| @DataField(order=1, refContract = true) | |||||
| ParticipantInfo getParticipantInfo(); | |||||
| @DataField(order = 0, primitiveType=PrimitiveType.TEXT) | |||||
| String getParticipantName(); | |||||
| @DataField(order = 1, refContract = true) | |||||
| BlockchainIdentity getParticipantIdentity(); | |||||
| @DataField(order = 2, primitiveType = PrimitiveType.BYTES) | |||||
| NetworkAddress getNetworkAddress(); | |||||
| } | } | ||||
| @@ -2,10 +2,20 @@ package com.jd.blockchain.ledger; | |||||
| import com.jd.blockchain.binaryproto.DataContract; | import com.jd.blockchain.binaryproto.DataContract; | ||||
| import com.jd.blockchain.binaryproto.DataField; | import com.jd.blockchain.binaryproto.DataField; | ||||
| import com.jd.blockchain.binaryproto.PrimitiveType; | |||||
| import com.jd.blockchain.consts.DataCodes; | import com.jd.blockchain.consts.DataCodes; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| @DataContract(code= DataCodes.TX_OP_PARTICIPANT_STATE_UPDATE) | @DataContract(code= DataCodes.TX_OP_PARTICIPANT_STATE_UPDATE) | ||||
| public interface ParticipantStateUpdateOperation extends Operation { | public interface ParticipantStateUpdateOperation extends Operation { | ||||
| @DataField(order=1, refContract = true) | |||||
| ParticipantStateUpdateInfo getStateUpdateInfo(); | |||||
| @DataField(order = 0, refContract = true) | |||||
| BlockchainIdentity getParticipantIdentity(); | |||||
| @DataField(order = 1, primitiveType = PrimitiveType.BYTES) | |||||
| NetworkAddress getNetworkAddress(); | |||||
| @DataField(order = 2, refEnum = true) | |||||
| ParticipantNodeState getState(); | |||||
| } | } | ||||
| @@ -4,8 +4,10 @@ import java.util.ArrayList; | |||||
| import java.util.Collection; | import java.util.Collection; | ||||
| import java.util.List; | import java.util.List; | ||||
| import com.jd.blockchain.crypto.PubKey; | |||||
| import com.jd.blockchain.ledger.*; | import com.jd.blockchain.ledger.*; | ||||
| import com.jd.blockchain.utils.Bytes; | import com.jd.blockchain.utils.Bytes; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| /** | /** | ||||
| * @author huanghaiquan | * @author huanghaiquan | ||||
| @@ -288,8 +290,8 @@ public class BlockchainOperationFactory implements ClientOperator, LedgerInitOpe | |||||
| private class ParticipantRegisterOperationBuilderFilter implements ParticipantRegisterOperationBuilder { | private class ParticipantRegisterOperationBuilderFilter implements ParticipantRegisterOperationBuilder { | ||||
| @Override | @Override | ||||
| public ParticipantRegisterOperation register(ParticipantInfo participantInfo) { | |||||
| ParticipantRegisterOperation op = PARTICIPANT_REG_OP_BUILDER.register(participantInfo); | |||||
| public ParticipantRegisterOperation register(String participantName, BlockchainIdentity participantIdentity, NetworkAddress networkAddress) { | |||||
| ParticipantRegisterOperation op = PARTICIPANT_REG_OP_BUILDER.register(participantName, participantIdentity, networkAddress); | |||||
| operationList.add(op); | operationList.add(op); | ||||
| return op; | return op; | ||||
| } | } | ||||
| @@ -297,8 +299,8 @@ public class BlockchainOperationFactory implements ClientOperator, LedgerInitOpe | |||||
| private class ParticipantStateUpdateOperationBuilderFilter implements ParticipantStateUpdateOperationBuilder { | private class ParticipantStateUpdateOperationBuilderFilter implements ParticipantStateUpdateOperationBuilder { | ||||
| @Override | @Override | ||||
| public ParticipantStateUpdateOperation update(ParticipantStateUpdateInfo stateUpdateInfo) { | |||||
| ParticipantStateUpdateOperation op = PARTICIPANT_STATE_UPDATE_OP_BUILDER.update(stateUpdateInfo); | |||||
| public ParticipantStateUpdateOperation update(BlockchainIdentity blockchainIdentity, NetworkAddress networkAddress, ParticipantNodeState participantNodeState) { | |||||
| ParticipantStateUpdateOperation op = PARTICIPANT_STATE_UPDATE_OP_BUILDER.update(blockchainIdentity, networkAddress, participantNodeState); | |||||
| operationList.add(op); | operationList.add(op); | ||||
| return op; | return op; | ||||
| } | } | ||||
| @@ -7,6 +7,6 @@ package com.jd.blockchain.transaction; | |||||
| * | * | ||||
| */ | */ | ||||
| public interface ClientOperator | public interface ClientOperator | ||||
| extends SecurityOperator, UserOperator, DataAccountOperator, ContractOperator, EventOperator, ParticipantOperator, ParticipantStateOperator { | |||||
| extends SecurityOperator, UserOperator, DataAccountOperator, ContractOperator, EventOperator, ParticipantOperator { | |||||
| } | } | ||||
| @@ -8,4 +8,11 @@ public interface ParticipantOperator { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| ParticipantRegisterOperationBuilder participants(); | ParticipantRegisterOperationBuilder participants(); | ||||
| /** | |||||
| * 参与方状态更新操作; | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| ParticipantStateUpdateOperationBuilder states(); | |||||
| } | } | ||||
| @@ -1,8 +1,11 @@ | |||||
| package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
| import com.jd.blockchain.binaryproto.DataContractRegistry; | import com.jd.blockchain.binaryproto.DataContractRegistry; | ||||
| import com.jd.blockchain.crypto.PubKey; | |||||
| import com.jd.blockchain.ledger.BlockchainIdentity; | |||||
| import com.jd.blockchain.ledger.ParticipantInfo; | import com.jd.blockchain.ledger.ParticipantInfo; | ||||
| import com.jd.blockchain.ledger.ParticipantRegisterOperation; | import com.jd.blockchain.ledger.ParticipantRegisterOperation; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| public class ParticipantRegisterOpTemplate implements ParticipantRegisterOperation { | public class ParticipantRegisterOpTemplate implements ParticipantRegisterOperation { | ||||
| @@ -10,15 +13,29 @@ public class ParticipantRegisterOpTemplate implements ParticipantRegisterOperati | |||||
| DataContractRegistry.register(ParticipantRegisterOperation.class); | DataContractRegistry.register(ParticipantRegisterOperation.class); | ||||
| } | } | ||||
| private ParticipantInfo participantInfo; | |||||
| private String participantName; | |||||
| private BlockchainIdentity participantPubKey; | |||||
| private NetworkAddress networkAddress; | |||||
| public ParticipantRegisterOpTemplate(ParticipantInfo participantInfo) { | |||||
| public ParticipantRegisterOpTemplate(String participantName, BlockchainIdentity participantPubKey, NetworkAddress networkAddress) { | |||||
| this.participantName = participantName; | |||||
| this.participantPubKey = participantPubKey; | |||||
| this.networkAddress = networkAddress; | |||||
| this.participantInfo = participantInfo; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ParticipantInfo getParticipantInfo() { | |||||
| return participantInfo; | |||||
| public String getParticipantName() { | |||||
| return participantName; | |||||
| } | |||||
| @Override | |||||
| public BlockchainIdentity getParticipantIdentity() { | |||||
| return participantPubKey; | |||||
| } | |||||
| @Override | |||||
| public NetworkAddress getNetworkAddress() { | |||||
| return networkAddress; | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,7 +1,10 @@ | |||||
| package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
| import com.jd.blockchain.crypto.PubKey; | |||||
| import com.jd.blockchain.ledger.BlockchainIdentity; | |||||
| import com.jd.blockchain.ledger.ParticipantInfo; | import com.jd.blockchain.ledger.ParticipantInfo; | ||||
| import com.jd.blockchain.ledger.ParticipantRegisterOperation; | import com.jd.blockchain.ledger.ParticipantRegisterOperation; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| public interface ParticipantRegisterOperationBuilder { | public interface ParticipantRegisterOperationBuilder { | ||||
| @@ -14,7 +17,7 @@ public interface ParticipantRegisterOperationBuilder { | |||||
| * | * | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| ParticipantRegisterOperation register(ParticipantInfo participantInfo); | |||||
| ParticipantRegisterOperation register(String participantName, BlockchainIdentity participantPubKey, NetworkAddress networkAddress); | |||||
| } | } | ||||
| @@ -1,11 +1,14 @@ | |||||
| package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
| import com.jd.blockchain.crypto.PubKey; | |||||
| import com.jd.blockchain.ledger.BlockchainIdentity; | |||||
| import com.jd.blockchain.ledger.ParticipantInfo; | import com.jd.blockchain.ledger.ParticipantInfo; | ||||
| import com.jd.blockchain.ledger.ParticipantRegisterOperation; | import com.jd.blockchain.ledger.ParticipantRegisterOperation; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| public class ParticipantRegisterOperationBuilderImpl implements ParticipantRegisterOperationBuilder { | public class ParticipantRegisterOperationBuilderImpl implements ParticipantRegisterOperationBuilder { | ||||
| @Override | @Override | ||||
| public ParticipantRegisterOperation register(ParticipantInfo participantNode) { | |||||
| return new ParticipantRegisterOpTemplate(participantNode); | |||||
| public ParticipantRegisterOperation register(String participantName, BlockchainIdentity participantPubKey, NetworkAddress networkAddress) { | |||||
| return new ParticipantRegisterOpTemplate(participantName, participantPubKey, networkAddress); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,8 +1,10 @@ | |||||
| package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
| import com.jd.blockchain.binaryproto.DataContractRegistry; | import com.jd.blockchain.binaryproto.DataContractRegistry; | ||||
| import com.jd.blockchain.ledger.ParticipantStateUpdateInfo; | |||||
| import com.jd.blockchain.ledger.BlockchainIdentity; | |||||
| import com.jd.blockchain.ledger.ParticipantNodeState; | |||||
| import com.jd.blockchain.ledger.ParticipantStateUpdateOperation; | import com.jd.blockchain.ledger.ParticipantStateUpdateOperation; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| public class ParticipantStateUpdateOpTemplate implements ParticipantStateUpdateOperation { | public class ParticipantStateUpdateOpTemplate implements ParticipantStateUpdateOperation { | ||||
| @@ -10,14 +12,30 @@ public class ParticipantStateUpdateOpTemplate implements ParticipantStateUpdateO | |||||
| DataContractRegistry.register(ParticipantStateUpdateOperation.class); | DataContractRegistry.register(ParticipantStateUpdateOperation.class); | ||||
| } | } | ||||
| private ParticipantStateUpdateInfo stateUpdateInfo; | |||||
| private BlockchainIdentity blockchainIdentity; | |||||
| private NetworkAddress networkAddress; | |||||
| private ParticipantNodeState participantNodeState; | |||||
| public ParticipantStateUpdateOpTemplate(ParticipantStateUpdateInfo stateUpdateInfo) { | |||||
| this.stateUpdateInfo = stateUpdateInfo; | |||||
| public ParticipantStateUpdateOpTemplate(BlockchainIdentity blockchainIdentity, NetworkAddress networkAddress, ParticipantNodeState participantNodeState) { | |||||
| this.blockchainIdentity = blockchainIdentity; | |||||
| this.networkAddress = networkAddress; | |||||
| this.participantNodeState = participantNodeState; | |||||
| } | |||||
| @Override | |||||
| public BlockchainIdentity getParticipantIdentity() { | |||||
| return blockchainIdentity; | |||||
| } | |||||
| @Override | |||||
| public NetworkAddress getNetworkAddress() { | |||||
| return networkAddress; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ParticipantStateUpdateInfo getStateUpdateInfo() { | |||||
| return stateUpdateInfo; | |||||
| public ParticipantNodeState getState() { | |||||
| return participantNodeState; | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,7 +1,10 @@ | |||||
| package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
| import com.jd.blockchain.ledger.BlockchainIdentity; | |||||
| import com.jd.blockchain.ledger.ParticipantNodeState; | |||||
| import com.jd.blockchain.ledger.ParticipantStateUpdateInfo; | import com.jd.blockchain.ledger.ParticipantStateUpdateInfo; | ||||
| import com.jd.blockchain.ledger.ParticipantStateUpdateOperation; | import com.jd.blockchain.ledger.ParticipantStateUpdateOperation; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| public interface ParticipantStateUpdateOperationBuilder { | public interface ParticipantStateUpdateOperationBuilder { | ||||
| @@ -14,5 +17,5 @@ public interface ParticipantStateUpdateOperationBuilder { | |||||
| * | * | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| ParticipantStateUpdateOperation update(ParticipantStateUpdateInfo stateUpdateInfo); | |||||
| ParticipantStateUpdateOperation update(BlockchainIdentity blockchainIdentity, NetworkAddress networkAddress, ParticipantNodeState participantNodeState); | |||||
| } | } | ||||
| @@ -1,12 +1,15 @@ | |||||
| package com.jd.blockchain.transaction; | package com.jd.blockchain.transaction; | ||||
| import com.jd.blockchain.ledger.BlockchainIdentity; | |||||
| import com.jd.blockchain.ledger.ParticipantNodeState; | |||||
| import com.jd.blockchain.ledger.ParticipantStateUpdateInfo; | import com.jd.blockchain.ledger.ParticipantStateUpdateInfo; | ||||
| import com.jd.blockchain.ledger.ParticipantStateUpdateOperation; | import com.jd.blockchain.ledger.ParticipantStateUpdateOperation; | ||||
| import com.jd.blockchain.utils.net.NetworkAddress; | |||||
| public class ParticipantStateUpdateOperationBuilderImpl implements ParticipantStateUpdateOperationBuilder { | public class ParticipantStateUpdateOperationBuilderImpl implements ParticipantStateUpdateOperationBuilder { | ||||
| @Override | @Override | ||||
| public ParticipantStateUpdateOperation update(ParticipantStateUpdateInfo stateUpdateInfo) { | |||||
| return new ParticipantStateUpdateOpTemplate(stateUpdateInfo); | |||||
| public ParticipantStateUpdateOperation update(BlockchainIdentity blockchainIdentity, NetworkAddress networkAddress, ParticipantNodeState participantNodeState) { | |||||
| return new ParticipantStateUpdateOpTemplate(blockchainIdentity, networkAddress, participantNodeState); | |||||
| } | } | ||||
| } | } | ||||
| @@ -82,10 +82,8 @@ public class SDK_GateWay_Participant_Regist_Test_ { | |||||
| NetworkAddress networkAddress = new NetworkAddress("127.0.0.1", 20000); | NetworkAddress networkAddress = new NetworkAddress("127.0.0.1", 20000); | ||||
| ParticipantInfo participantInfo = new ParticipantInfoData("Peer4", user.getPubKey(), networkAddress); | |||||
| // 注册参与方 | // 注册参与方 | ||||
| txTemp.participants().register(participantInfo); | |||||
| txTemp.participants().register("Peer4", user.getIdentity(), networkAddress); | |||||
| // TX 准备就绪; | // TX 准备就绪; | ||||
| PreparedTransaction prepTx = txTemp.prepare(); | PreparedTransaction prepTx = txTemp.prepare(); | ||||
| @@ -77,10 +77,11 @@ public class SDK_GateWay_Participant_State_Update_Test_ { | |||||
| System.out.println("Address = "+AddressEncoding.generateAddress(pubKey)); | System.out.println("Address = "+AddressEncoding.generateAddress(pubKey)); | ||||
| BlockchainKeypair user = new BlockchainKeypair(pubKey, privKey); | |||||
| NetworkAddress networkAddress = new NetworkAddress("127.0.0.1", 20000); | NetworkAddress networkAddress = new NetworkAddress("127.0.0.1", 20000); | ||||
| ParticipantStateUpdateInfo stateUpdateInfo = new ParticipantStateUpdateInfoData(pubKey, ParticipantNodeState.CONSENSUSED, networkAddress); | |||||
| txTemp.states().update(stateUpdateInfo); | |||||
| txTemp.states().update(user.getIdentity(),networkAddress, ParticipantNodeState.CONSENSUSED); | |||||
| // TX 准备就绪; | // TX 准备就绪; | ||||
| PreparedTransaction prepTx = txTemp.prepare(); | PreparedTransaction prepTx = txTemp.prepare(); | ||||
| @@ -175,9 +175,7 @@ public class IntegrationBase { | |||||
| // 定义交易; | // 定义交易; | ||||
| TransactionTemplate txTpl = blockchainService.newTransaction(ledgerHash); | TransactionTemplate txTpl = blockchainService.newTransaction(ledgerHash); | ||||
| ParticipantInfoData participantInfoData = new ParticipantInfoData("peer4", participant.getPubKey(), new NetworkAddress("127.0.0.1", 20000)); | |||||
| txTpl.participants().register(participantInfoData); | |||||
| txTpl.participants().register("peer4", new BlockchainIdentityData(participant.getPubKey()), new NetworkAddress("127.0.0.1", 20000)); | |||||
| // 签名; | // 签名; | ||||
| PreparedTransaction ptx = txTpl.prepare(); | PreparedTransaction ptx = txTpl.prepare(); | ||||
| @@ -203,9 +201,7 @@ public class IntegrationBase { | |||||
| ParticipantInfoData participantInfoData = new ParticipantInfoData("peer4", participantKeyPair.getPubKey(), new NetworkAddress("127.0.0.1", 20000)); | ParticipantInfoData participantInfoData = new ParticipantInfoData("peer4", participantKeyPair.getPubKey(), new NetworkAddress("127.0.0.1", 20000)); | ||||
| ParticipantStateUpdateInfo stateUpdateInfo = new ParticipantStateUpdateInfoData(participantKeyPair.getPubKey(), ParticipantNodeState.CONSENSUSED, participantInfoData.getNetworkAddress()); | |||||
| txTpl.states().update(stateUpdateInfo); | |||||
| txTpl.states().update(new BlockchainIdentityData(participantInfoData.getPubKey()), participantInfoData.getNetworkAddress(), ParticipantNodeState.CONSENSUSED); | |||||
| // 签名; | // 签名; | ||||
| PreparedTransaction ptx = txTpl.prepare(); | PreparedTransaction ptx = txTpl.prepare(); | ||||