Search in sources :

Example 1 with GenesisStateConfig

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

the class TekuNode method create.

public static TekuNode create(final Network network, final DockerVersion version, final Consumer<Config> configOptions, final GenesisStateGenerator genesisStateGenerator) throws TimeoutException, IOException {
    final Config config = new Config();
    configOptions.accept(config);
    final TekuNode node = new TekuNode(network, version, config);
    if (config.getGenesisStateConfig().isPresent()) {
        final GenesisStateConfig genesisConfig = config.getGenesisStateConfig().get();
        File genesisFile = genesisStateGenerator.generateState(genesisConfig);
        node.copyFileToContainer(genesisFile, genesisConfig.getPath());
    }
    return node;
}
Also used : GenesisStateConfig(tech.pegasys.teku.test.acceptance.dsl.tools.GenesisStateConfig) GenesisStateConfig(tech.pegasys.teku.test.acceptance.dsl.tools.GenesisStateConfig) MountableFile(org.testcontainers.utility.MountableFile) File(java.io.File)

Aggregations

File (java.io.File)1 MountableFile (org.testcontainers.utility.MountableFile)1 GenesisStateConfig (tech.pegasys.teku.test.acceptance.dsl.tools.GenesisStateConfig)1