Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ dependencies {
implementation 'org.apache.logging.log4j:log4j-core'


implementation 'org.hyperledger.besu.internal:pipeline'
implementation 'org.hyperledger.besu.internal:rlp'
implementation 'org.hyperledger.besu:plugin-api'
implementation 'org.hyperledger.besu.internal:besu-services-pipeline'
implementation 'org.hyperledger.besu.internal:besu-ethereum-rlp'
implementation 'org.hyperledger.besu:besu-plugin-api'
implementation 'org.hyperledger.besu:besu-datatypes'
implementation 'info.picocli:picocli'

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
releaseVersion=0.3.9-SNAPSHOT
besuVersion=25.5.0
besuVersion=25.9.0
6 changes: 3 additions & 3 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ dependencyManagement {
dependency 'tech.pegasys.tools.epchecks:errorprone-checks:1.1.1'

// Besu dependencies
dependency "org.hyperledger.besu:plugin-api:${besuVersion}"
dependency "org.hyperledger.besu:besu-plugin-api:${besuVersion}"
dependency "org.hyperledger.besu:besu-datatypes:${besuVersion}"
dependency "org.hyperledger.besu.internal:pipeline:${besuVersion}"
dependency "org.hyperledger.besu.internal:rlp:${besuVersion}"
dependency "org.hyperledger.besu.internal:besu-services-pipeline:${besuVersion}"
dependency "org.hyperledger.besu.internal:besu-ethereum-rlp:${besuVersion}"


// Logging dependencies
Expand Down
19 changes: 17 additions & 2 deletions src/main/java/net/consensys/fleet/common/plugin/FleetPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.google.auto.service.AutoService;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.BesuConfiguration;
import org.hyperledger.besu.plugin.services.BesuEvents;
import org.hyperledger.besu.plugin.services.BlockchainService;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;
Expand Down Expand Up @@ -90,9 +91,22 @@ public void register(final ServiceManager serviceManager) {
}
cmdlineOptions.get().addPicoCLIOptions(NAME, CLI_OPTIONS);

LOG.debug("Loading BesuConfiguration service");
final BesuConfiguration besuConfigurationService =
serviceManager
.getService(BesuConfiguration.class)
.orElseThrow(
() ->
new IllegalStateException(
"Expecting a BesuConfiguration service, but none found."));

LOG.info("Creating peer manager");
peerManagers = new PeerNodesManager();
this.webClient = new WebClientWrapper(convertMapperProvider, peerManagers);
this.peerManagers = new PeerNodesManager();
this.webClient =
new WebClientWrapper(
convertMapperProvider,
peerManagers,
besuConfigurationService.getConfiguredRpcHttpTimeoutSec());

LOG.info("Setting up RPC endpoints");
final List<PluginRpcMethod> pluginRpcMethods = createServerMethods();
Expand Down Expand Up @@ -179,6 +193,7 @@ public void stop() {
private void createPeerNetworkMaintainer() {
LOG.info("Setting up connection parameters");
final PeerNetworkMaintainer peerNetworkMaintainer;

switch (CLI_OPTIONS.getNodeRole()) {
case LEADER -> {
/* ********** LEADER ************* */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

import com.fasterxml.jackson.core.JsonProcessingException;
import io.vertx.core.Vertx;
Expand All @@ -39,11 +40,15 @@ public class WebClientWrapper {
private final WebClient webClient;
private final ConvertMapperProvider convertMapperProvider;
private final PeerNodesManager peerManagers;
private final long timeoutInMillisecond;

public WebClientWrapper(
final ConvertMapperProvider convertMapperProvider, final PeerNodesManager peerManagers) {
final ConvertMapperProvider convertMapperProvider,
final PeerNodesManager peerManagers,
final long timeoutInMillisecond) {
this.peerManagers = peerManagers;
this.convertMapperProvider = convertMapperProvider;
this.timeoutInMillisecond = TimeUnit.SECONDS.toMillis(timeoutInMillisecond);
this.webClient = WebClient.create(Vertx.vertx(), new WebClientOptions());
}

Expand All @@ -64,7 +69,7 @@ public CompletableFuture<HttpResponse<Buffer>> sendToLeader(

webClient
.post(leader.port(), leader.host(), endpoint)
.timeout(100)
.timeout(timeoutInMillisecond)
.putHeader("Content-Type", CONTENT_TYPE)
.sendJsonObject(
jsonObject,
Expand Down Expand Up @@ -99,7 +104,7 @@ public void sendToFollowers(final String endpoint, final String methodName, fina
peerNode -> {
webClient
.post(peerNode.port(), peerNode.host(), endpoint)
.timeout(100)
.timeout(timeoutInMillisecond)
.putHeader("Content-Type", CONTENT_TYPE)
.sendJsonObject(
jsonObject,
Expand Down
Loading