use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder in project besu by hyperledger.
the class PluginPrivacySigningAcceptanceTest method setup.
@Before
public void setup() throws IOException {
minerNode = privacyBesu.create(new PrivacyNodeConfiguration(false, false, true, new BesuNodeConfigurationBuilder().name("miner").miningEnabled().jsonRpcEnabled().webSocketEnabled().enablePrivateTransactions().keyFilePath(BOB.getPrivateKeyPath()).plugins(Collections.singletonList("testPlugins")).extraCLIOptions(List.of("--plugin-privacy-service-encryption-prefix=0xAA", "--plugin-privacy-service-signing-enabled=true", "--plugin-privacy-service-signing-key=8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63")).build(), new EnclaveKeyConfiguration(BOB.getEnclaveKeyPaths(), BOB.getEnclavePrivateKeyPaths())), EnclaveType.NOOP, Optional.empty());
privacyCluster.start(minerNode);
}
use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder in project besu by hyperledger.
the class MetricsAcceptanceTest method setUp.
@Before
public void setUp() throws Exception {
metricsNode = besu.create(new BesuNodeConfigurationBuilder().name("metrics-node").metricsEnabled().build());
cluster.start(metricsNode);
client = new OkHttpClient();
}
use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder in project besu by hyperledger.
the class OpenTelemetryAcceptanceTest method setUp.
@Before
public void setUp() throws Exception {
Server server = NettyServerBuilder.forPort(4317).addService(fakeTracesCollector).addService(fakeMetricsCollector).build().start();
closer.register(server::shutdownNow);
MetricsConfiguration configuration = MetricsConfiguration.builder().protocol(MetricsProtocol.OPENTELEMETRY).enabled(true).port(0).hostsAllowlist(singletonList("*")).build();
metricsNode = besu.create(new BesuNodeConfigurationBuilder().name("metrics-node").jsonRpcEnabled().metricsConfiguration(configuration).build());
cluster.start(metricsNode);
}
use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder in project besu by hyperledger.
the class PermissioningPluginTest method setUp.
@Before
public void setUp() throws Exception {
final BesuNodeConfigurationBuilder builder = new BesuNodeConfigurationBuilder().miningEnabled(false).plugins(List.of("testPlugins")).extraCLIOptions(List.of("--plugin-permissioning-test-enabled=true")).jsonRpcEnabled().jsonRpcTxPool().jsonRpcAdmin();
minerNode = besu.create(builder.name("miner").build());
aliceNode = besu.create(builder.name("alice").keyFilePath("key").build());
bobNode = besu.create(builder.name("bob").keyFilePath("key1").build());
charlieNode = besu.create(builder.name("charlie").keyFilePath("key2").build());
cluster.start(minerNode, charlieNode);
cluster.startNode(aliceNode);
aliceNode.awaitPeerDiscovery(net.awaitPeerCount(2));
cluster.startNode(bobNode);
bobNode.awaitPeerDiscovery(net.awaitPeerCount(2));
}
use of org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder 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);
}
}
Aggregations