Search in sources :

Example 1 with BesuNodeConfigurationBuilder

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);
}
Also used : EnclaveKeyConfiguration(org.hyperledger.enclave.testutil.EnclaveKeyConfiguration) BesuNodeConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder) PrivacyNodeConfiguration(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.privacy.PrivacyNodeConfiguration) Before(org.junit.Before)

Example 2 with BesuNodeConfigurationBuilder

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();
}
Also used : OkHttpClient(okhttp3.OkHttpClient) BesuNodeConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder) Before(org.junit.Before)

Example 3 with BesuNodeConfigurationBuilder

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);
}
Also used : StreamObserver(io.grpc.stub.StreamObserver) Server(io.grpc.Server) MetricsConfiguration(org.hyperledger.besu.metrics.prometheus.MetricsConfiguration) BesuNodeConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder) Before(org.junit.Before)

Example 4 with BesuNodeConfigurationBuilder

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));
}
Also used : BesuNodeConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder) Before(org.junit.Before)

Example 5 with BesuNodeConfigurationBuilder

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);
    }
}
Also used : LocalPermissioningConfiguration(org.hyperledger.besu.ethereum.permissioning.LocalPermissioningConfiguration) BesuNodeConfigurationBuilder(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder) PermissioningConfiguration(org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration) SmartContractPermissioningConfiguration(org.hyperledger.besu.ethereum.permissioning.SmartContractPermissioningConfiguration) LocalPermissioningConfiguration(org.hyperledger.besu.ethereum.permissioning.LocalPermissioningConfiguration) BesuNodeFactory(org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeFactory) SmartContractPermissioningConfiguration(org.hyperledger.besu.ethereum.permissioning.SmartContractPermissioningConfiguration) IOException(java.io.IOException)

Aggregations

BesuNodeConfigurationBuilder (org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeConfigurationBuilder)6 Before (org.junit.Before)5 Server (io.grpc.Server)1 StreamObserver (io.grpc.stub.StreamObserver)1 IOException (java.io.IOException)1 OkHttpClient (okhttp3.OkHttpClient)1 LocalPermissioningConfiguration (org.hyperledger.besu.ethereum.permissioning.LocalPermissioningConfiguration)1 PermissioningConfiguration (org.hyperledger.besu.ethereum.permissioning.PermissioningConfiguration)1 SmartContractPermissioningConfiguration (org.hyperledger.besu.ethereum.permissioning.SmartContractPermissioningConfiguration)1 MetricsConfiguration (org.hyperledger.besu.metrics.prometheus.MetricsConfiguration)1 BesuNodeFactory (org.hyperledger.besu.tests.acceptance.dsl.node.configuration.BesuNodeFactory)1 PrivacyNodeConfiguration (org.hyperledger.besu.tests.acceptance.dsl.node.configuration.privacy.PrivacyNodeConfiguration)1 EnclaveKeyConfiguration (org.hyperledger.enclave.testutil.EnclaveKeyConfiguration)1