Search in sources :

Example 1 with DepositGenerator

use of tech.pegasys.teku.test.acceptance.dsl.tools.deposits.DepositGenerator in project teku by ConsenSys.

the class TekuDepositSender method sendValidatorDeposits.

public ValidatorKeystores sendValidatorDeposits(final BesuNode eth1Node, final int numberOfValidators, UInt64 amount) throws InterruptedException, ExecutionException, TimeoutException {
    final Eth1Address eth1Address = Eth1Address.fromHexString(eth1Node.getDepositContractAddress());
    final Credentials eth1Credentials = Credentials.create(eth1Node.getRichBenefactorKey());
    try (final DepositGenerator depositGenerator = new DepositGenerator(spec, eth1Node.getExternalJsonRpcUrl(), eth1Address, eth1Credentials, numberOfValidators, amount)) {
        final SafeFuture<Void> future = depositGenerator.generate();
        Waiter.waitFor(future, Duration.ofMinutes(2));
        return new ValidatorKeystores(depositGenerator.getKeys());
    }
}
Also used : DepositGenerator(tech.pegasys.teku.test.acceptance.dsl.tools.deposits.DepositGenerator) ValidatorKeystores(tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores) Eth1Address(tech.pegasys.teku.spec.datastructures.eth1.Eth1Address) Credentials(org.web3j.crypto.Credentials)

Aggregations

Credentials (org.web3j.crypto.Credentials)1 Eth1Address (tech.pegasys.teku.spec.datastructures.eth1.Eth1Address)1 DepositGenerator (tech.pegasys.teku.test.acceptance.dsl.tools.deposits.DepositGenerator)1 ValidatorKeystores (tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores)1