|
|
@ -587,9 +587,10 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
@Option( |
|
|
|
names = {"--pruning-enabled"}, |
|
|
|
names = {"--pruning-enabled"}, |
|
|
|
|
|
|
|
hidden = true, |
|
|
|
description = |
|
|
|
description = |
|
|
|
"Enable pruning of world state of blocks older than the retention period (default: true if fast sync is enabled, false otherwise)") |
|
|
|
"Enable pruning of world state of blocks older than the retention period (default: ${DEFAULT-VALUE})") |
|
|
|
private Boolean pruningOverride; |
|
|
|
private final Boolean isPruningEnabled = false; |
|
|
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
@Option( |
|
|
|
names = {"--pruning-blocks-retained"}, |
|
|
|
names = {"--pruning-blocks-retained"}, |
|
|
@ -1011,7 +1012,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
logger, |
|
|
|
logger, |
|
|
|
commandLine, |
|
|
|
commandLine, |
|
|
|
"--pruning-enabled", |
|
|
|
"--pruning-enabled", |
|
|
|
!isPruningEnabled(), |
|
|
|
!isPruningEnabled, |
|
|
|
asList("--pruning-block-confirmations", "--pruning-blocks-retained")); |
|
|
|
asList("--pruning-block-confirmations", "--pruning-blocks-retained")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1087,7 +1088,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
.clock(Clock.systemUTC()) |
|
|
|
.clock(Clock.systemUTC()) |
|
|
|
.isRevertReasonEnabled(isRevertReasonEnabled) |
|
|
|
.isRevertReasonEnabled(isRevertReasonEnabled) |
|
|
|
.storageProvider(keyStorageProvider(keyValueStorageName)) |
|
|
|
.storageProvider(keyStorageProvider(keyValueStorageName)) |
|
|
|
.isPruningEnabled(isPruningEnabled()) |
|
|
|
.isPruningEnabled(isPruningEnabled) |
|
|
|
.pruningConfiguration(buildPruningConfiguration()) |
|
|
|
.pruningConfiguration(buildPruningConfiguration()) |
|
|
|
.genesisConfigOverrides(genesisConfigOverrides) |
|
|
|
.genesisConfigOverrides(genesisConfigOverrides) |
|
|
|
.targetGasLimit(targetGasLimit == null ? Optional.empty() : Optional.of(targetGasLimit)) |
|
|
|
.targetGasLimit(targetGasLimit == null ? Optional.empty() : Optional.of(targetGasLimit)) |
|
|
@ -1374,10 +1375,6 @@ public class BesuCommand implements DefaultCommandValues, Runnable { |
|
|
|
return new PruningConfiguration(pruningBlockConfirmations, pruningBlocksRetained); |
|
|
|
return new PruningConfiguration(pruningBlockConfirmations, pruningBlocksRetained); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isPruningEnabled() { |
|
|
|
|
|
|
|
return Optional.ofNullable(pruningOverride).orElse(syncMode == SyncMode.FAST); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Blockchain synchronisation from peers.
|
|
|
|
// Blockchain synchronisation from peers.
|
|
|
|
private void synchronize( |
|
|
|
private void synchronize( |
|
|
|
final BesuController<?> controller, |
|
|
|
final BesuController<?> controller, |
|
|
|