Search in sources :

Example 6 with BesuNode

use of tech.pegasys.teku.test.acceptance.dsl.BesuNode in project teku by ConsenSys.

the class AddValidatorsAcceptanceTest method shouldLoadAdditionalValidatorsWithoutRestart.

@Test
void shouldLoadAdditionalValidatorsWithoutRestart() throws Exception {
    final String networkName = "less-swift";
    final BesuNode eth1Node = createBesuNode();
    eth1Node.start();
    final ValidatorKeystores initialKeystores = createTekuDepositSender(networkName).sendValidatorDeposits(eth1Node, 2);
    final ValidatorKeystores additionalKeystores = createTekuDepositSender(networkName).sendValidatorDeposits(eth1Node, 2);
    final TekuNode node = createTekuNode(config -> config.withNetwork(networkName).withDepositsFrom(eth1Node).withValidatorKeystores(initialKeystores));
    node.start();
    node.waitForOwnedValidatorCount(2);
    node.waitForGenesis();
    node.addValidators(additionalKeystores);
    node.waitForOwnedValidatorCount(4);
    // If the added validators perform their duties properly, the network will finalize.
    node.waitForNewFinalization();
    // Check loading new validators a second time still works and that they don't have to be active
    final ValidatorKeystores evenMoreKeystores = createTekuDepositSender(networkName).sendValidatorDeposits(eth1Node, 1);
    node.addValidators(evenMoreKeystores);
    node.waitForOwnedValidatorCount(5);
}
Also used : BesuNode(tech.pegasys.teku.test.acceptance.dsl.BesuNode) TekuNode(tech.pegasys.teku.test.acceptance.dsl.TekuNode) ValidatorKeystores(tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores) Test(org.junit.jupiter.api.Test)

Example 7 with BesuNode

use of tech.pegasys.teku.test.acceptance.dsl.BesuNode in project teku by ConsenSys.

the class StartupAcceptanceTest method shouldStartChainFromDepositContract.

@Test
public void shouldStartChainFromDepositContract() throws Exception {
    final BesuNode eth1Node = createBesuNode();
    eth1Node.start();
    final TekuNode tekuNode = createTekuNode(config -> config.withDepositsFrom(eth1Node));
    tekuNode.start();
    createTekuDepositSender(Config.DEFAULT_NETWORK_NAME).sendValidatorDeposits(eth1Node, 4);
    tekuNode.waitForGenesis();
}
Also used : BesuNode(tech.pegasys.teku.test.acceptance.dsl.BesuNode) TekuNode(tech.pegasys.teku.test.acceptance.dsl.TekuNode) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)7 BesuNode (tech.pegasys.teku.test.acceptance.dsl.BesuNode)7 TekuNode (tech.pegasys.teku.test.acceptance.dsl.TekuNode)7 ValidatorKeystores (tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores)4 TekuValidatorNode (tech.pegasys.teku.test.acceptance.dsl.TekuValidatorNode)3 BLSPublicKey (tech.pegasys.teku.bls.BLSPublicKey)2 ValidatorKeysApi (tech.pegasys.teku.test.acceptance.dsl.tools.ValidatorKeysApi)2 IOException (java.io.IOException)1 URL (java.net.URL)1 AssertionsForClassTypes.assertThat (org.assertj.core.api.AssertionsForClassTypes.assertThat)1 AcceptanceTestBase (tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase)1 TekuDepositSender (tech.pegasys.teku.test.acceptance.dsl.TekuDepositSender)1 TekuVoluntaryExit (tech.pegasys.teku.test.acceptance.dsl.TekuVoluntaryExit)1 Web3SignerNode (tech.pegasys.teku.test.acceptance.dsl.Web3SignerNode)1 ValidatorKeys (tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeys)1