full sync for dev network (#1128)

Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
pull/1135/head
Ratan (Rai) Sur 4 years ago committed by GitHub
parent 0a01ddb785
commit 2c9c9127a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  2. 12
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

@ -1383,7 +1383,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private BesuCommand configure() throws Exception {
syncMode =
Optional.ofNullable(syncMode)
.orElse(genesisFile == null && !isPrivacyEnabled ? SyncMode.FAST : SyncMode.FULL);
.orElse(
genesisFile == null && !isPrivacyEnabled && network != NetworkName.DEV
? SyncMode.FAST
: SyncMode.FULL);
ethNetworkConfig = updateNetworkConfig(getNetwork());
jsonRpcConfiguration = jsonRpcConfiguration();
graphQLConfiguration = graphQLConfiguration();

@ -1246,6 +1246,18 @@ public class BesuCommandTest extends CommandTestAbstract {
assertThat(commandErrorOutput.toString()).isEmpty();
}
@Test
public void syncMode_full_by_default_for_dev() {
parseCommand("--network", "dev");
verify(mockControllerBuilder).synchronizerConfiguration(syncConfigurationCaptor.capture());
final SynchronizerConfiguration syncConfig = syncConfigurationCaptor.getValue();
assertThat(syncConfig.getSyncMode()).isEqualTo(SyncMode.FULL);
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
}
@Test
public void helpShouldDisplayFastSyncOptions() {
parseCommand("--help");

Loading…
Cancel
Save