use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeFactory in project besu by hyperledger.
the class PermissionedNodeBuilder method build.
public BesuNode build() {
if (name == null) {
name = "perm_node_" + UUID.randomUUID().toString().substring(0, 8);
}
Optional<LocalPermissioningConfiguration> localPermConfig = Optional.empty();
if (localConfigNodesPermissioningEnabled || localConfigAccountsPermissioningEnabled) {
localPermConfig = Optional.of(localConfigPermissioningConfiguration());
}
Optional<SmartContractPermissioningConfiguration> smartContractPermConfig = Optional.empty();
if (nodeSmartContractPermissioningEnabled || accountSmartContractPermissioningEnabled) {
smartContractPermConfig = Optional.of(smartContractPermissioningConfiguration());
}
final PermissioningConfiguration permissioningConfiguration = new PermissioningConfiguration(localPermConfig, smartContractPermConfig, Optional.empty());
final BesuNodeConfigurationBuilder builder = new BesuNodeConfigurationBuilder();
builder.name(name).jsonRpcConfiguration(jsonRpcConfigWithPermApiEnabled()).permissioningConfiguration(permissioningConfiguration).bootnodeEligible(false);
if (mining) {
builder.miningEnabled();
}
if (!staticNodes.isEmpty()) {
builder.staticNodes(staticNodes);
}
builder.dnsEnabled(isDnsEnabled);
if (genesisFile != null) {
builder.genesisConfigProvider((a) -> Optional.of(genesisFile));
builder.devMode(false);
}
try {
return new BesuNodeFactory().create(builder.build());
} catch (IOException e) {
throw new RuntimeException("Error creating BesuNode", e);
}
}
use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeFactory in project besu by hyperledger.
the class ExecutionEngineAcceptanceTest method init.
@BeforeClass
public static void init() throws IOException {
cluster = new Cluster(new NetConditions(new NetTransactions()));
executionEngine = new BesuNodeFactory().createExecutionEngineGenesisNode("executionEngine", GENESIS_FILE);
cluster.start(executionEngine);
consensusClient = new OkHttpClient();
mapper = new ObjectMapper();
}
Aggregations