| @@ -185,13 +185,13 @@ public class BftsmartConsensusSettingsBuilder implements ConsensusSettingsBuilde | |||||
| BftsmartConsensusConfig bftsmartConsensusConfig = new BftsmartConsensusConfig(nodeSettings, systemConfigs); | BftsmartConsensusConfig bftsmartConsensusConfig = new BftsmartConsensusConfig(nodeSettings, systemConfigs); | ||||
| for(int i = 0 ;i < bftsmartConsensusConfig.getNodes().length; i++) { | |||||
| System.out.printf("id = %d, host = %s, port = %d\r\n", bftsmartConsensusConfig.getNodes()[i].getId(), bftsmartConsensusConfig.getNodes()[i].getNetworkAddress().getHost(), bftsmartConsensusConfig.getNodes()[i].getNetworkAddress().getPort()); | |||||
| } | |||||
| for(int i = 0 ;i < bftsmartConsensusConfig.getSystemConfigs().length; i++) { | |||||
| System.out.printf("property name = %s, property value = %s\r\n",bftsmartConsensusConfig.getSystemConfigs()[i].getName(), bftsmartConsensusConfig.getSystemConfigs()[i].getValue()); | |||||
| } | |||||
| // for(int i = 0 ;i < bftsmartConsensusConfig.getNodes().length; i++) { | |||||
| // System.out.printf("id = %d, host = %s, port = %d\r\n", bftsmartConsensusConfig.getNodes()[i].getId(), bftsmartConsensusConfig.getNodes()[i].getNetworkAddress().getHost(), bftsmartConsensusConfig.getNodes()[i].getNetworkAddress().getPort()); | |||||
| // } | |||||
| // | |||||
| // for(int i = 0 ;i < bftsmartConsensusConfig.getSystemConfigs().length; i++) { | |||||
| // System.out.printf("property name = %s, property value = %s\r\n",bftsmartConsensusConfig.getSystemConfigs()[i].getName(), bftsmartConsensusConfig.getSystemConfigs()[i].getValue()); | |||||
| // } | |||||
| return new Bytes(ConsensusProviders.getProvider(BFTSMART_PROVIDER).getSettingsFactory().getConsensusSettingsEncoder().encode(bftsmartConsensusConfig)); | return new Bytes(ConsensusProviders.getProvider(BFTSMART_PROVIDER).getSettingsFactory().getConsensusSettingsEncoder().encode(bftsmartConsensusConfig)); | ||||
| @@ -184,9 +184,9 @@ public class MsgQueueConsensusSettingsBuilder implements ConsensusSettingsBuilde | |||||
| msgQueueConsensusConfig.setNetworkSettings(consensusSettings.getNetworkSettings()); | msgQueueConsensusConfig.setNetworkSettings(consensusSettings.getNetworkSettings()); | ||||
| for(int i = 0 ;i < msgQueueConsensusConfig.getNodes().length; i++) { | |||||
| System.out.printf("node addr = %s\r\n", msgQueueConsensusConfig.getNodes()[i].getAddress()); | |||||
| } | |||||
| // for(int i = 0 ;i < msgQueueConsensusConfig.getNodes().length; i++) { | |||||
| // System.out.printf("node addr = %s\r\n", msgQueueConsensusConfig.getNodes()[i].getAddress()); | |||||
| // } | |||||
| return new Bytes(consensusEncoder.encode(msgQueueConsensusConfig)); | return new Bytes(consensusEncoder.encode(msgQueueConsensusConfig)); | ||||
| @@ -16,8 +16,6 @@ public class ParticipantRegisterOperationHandle implements OperationHandle { | |||||
| ParticipantRegisterOperation participantRegOp = (ParticipantRegisterOperation) op; | ParticipantRegisterOperation participantRegOp = (ParticipantRegisterOperation) op; | ||||
| System.out.println("ParticipantRegisterOperationHandle start\r\n"); | |||||
| LedgerAdminAccount adminAccount = dataset.getAdminAccount(); | LedgerAdminAccount adminAccount = dataset.getAdminAccount(); | ||||
| ParticipantInfo participantInfo = participantRegOp.getParticipantInfo(); | ParticipantInfo participantInfo = participantRegOp.getParticipantInfo(); | ||||
| @@ -30,6 +30,8 @@ public class IntegrationTest4Bftsmart { | |||||
| private static final boolean isRegisterDataAccount = true; | private static final boolean isRegisterDataAccount = true; | ||||
| private static final boolean isRegisterParticipant = true; | |||||
| private static final boolean isWriteKv = true; | private static final boolean isWriteKv = true; | ||||
| private static final String DB_TYPE_MEM = "mem"; | private static final String DB_TYPE_MEM = "mem"; | ||||
| @@ -140,6 +142,23 @@ public class IntegrationTest4Bftsmart { | |||||
| } | } | ||||
| } | } | ||||
| long participantCount = ledgerRepository.getAdminAccount(ledgerRepository.retrieveLatestBlock()).getParticipantCount(); | |||||
| long userCount = ledgerRepository.getUserAccountSet(ledgerRepository.retrieveLatestBlock()).getTotalCount(); | |||||
| System.out.printf("before add participant: participantCount = %d, userCount = %d\r\n", (int)participantCount, (int)userCount); | |||||
| if (isRegisterParticipant) { | |||||
| IntegrationBase.KeyPairResponse participantResponse = IntegrationBase.testSDK_RegisterParticipant(adminKey, ledgerHash, blockchainService); | |||||
| } | |||||
| participantCount = ledgerRepository.getAdminAccount(ledgerRepository.retrieveLatestBlock()).getParticipantCount(); | |||||
| userCount = ledgerRepository.getUserAccountSet(ledgerRepository.retrieveLatestBlock()).getTotalCount(); | |||||
| System.out.printf("after add participant: participantCount = %d, userCount = %d\r\n", (int)participantCount, (int)userCount); | |||||
| try { | try { | ||||
| System.out.println("----------------- Init Completed -----------------"); | System.out.println("----------------- Init Completed -----------------"); | ||||
| Thread.sleep(Integer.MAX_VALUE); | Thread.sleep(Integer.MAX_VALUE); | ||||
| @@ -30,6 +30,8 @@ public class IntegrationTest4MQ { | |||||
| private static final boolean isRegisterDataAccount = true; | private static final boolean isRegisterDataAccount = true; | ||||
| private static final boolean isRegisterParticipant = true; | |||||
| private static final boolean isWriteKv = true; | private static final boolean isWriteKv = true; | ||||
| private static final boolean isContract = false; | private static final boolean isContract = false; | ||||
| @@ -138,6 +140,22 @@ public class IntegrationTest4MQ { | |||||
| integrationBase.testSDK_Contract(adminKey, ledgerHash, blockchainService,ledgerRepository); | integrationBase.testSDK_Contract(adminKey, ledgerHash, blockchainService,ledgerRepository); | ||||
| } | } | ||||
| long participantCount = ledgerRepository.getAdminAccount(ledgerRepository.retrieveLatestBlock()).getParticipantCount(); | |||||
| long userCount = ledgerRepository.getUserAccountSet(ledgerRepository.retrieveLatestBlock()).getTotalCount(); | |||||
| System.out.printf("before add participant: participantCount = %d, userCount = %d\r\n", (int)participantCount, (int)userCount); | |||||
| if (isRegisterParticipant) { | |||||
| IntegrationBase.KeyPairResponse participantResponse = IntegrationBase.testSDK_RegisterParticipant(adminKey, ledgerHash, blockchainService); | |||||
| } | |||||
| participantCount = ledgerRepository.getAdminAccount(ledgerRepository.retrieveLatestBlock()).getParticipantCount(); | |||||
| userCount = ledgerRepository.getUserAccountSet(ledgerRepository.retrieveLatestBlock()).getTotalCount(); | |||||
| System.out.printf("after add participant: participantCount = %d, userCount = %d\r\n", (int)participantCount, (int)userCount); | |||||
| IntegrationBase.testConsistencyAmongNodes(ledgers); | IntegrationBase.testConsistencyAmongNodes(ledgers); | ||||
| if(isOnline){ | if(isOnline){ | ||||
| @@ -242,7 +242,7 @@ public class LedgerInitProperties { | |||||
| .parseBoolean(PropertiesUtils.getRequiredProperty(props, initializerSecureKey)); | .parseBoolean(PropertiesUtils.getRequiredProperty(props, initializerSecureKey)); | ||||
| NetworkAddress initializerAddress = new NetworkAddress(initializerHost, initializerPort, initializerSecure); | NetworkAddress initializerAddress = new NetworkAddress(initializerHost, initializerPort, initializerSecure); | ||||
| parti.setInitializerAddress(initializerAddress); | parti.setInitializerAddress(initializerAddress); | ||||
| parti.setParticipantNodeState(ParticipantNodeState.CONSENSUSED); | |||||
| initProps.addConsensusParticipant(parti); | initProps.addConsensusParticipant(parti); | ||||
| } | } | ||||