fix: run geth and parity in archival mode for dev nodes

This will only be enabled for test networks in order to be able to debug
transactions that have occurred in the past.
This commit is contained in:
Andre Medeiros 2019-03-20 13:18:39 -04:00 committed by Iuri Matias
parent 250cb07dd2
commit 542809cd9f
2 changed files with 16 additions and 0 deletions

View File

@ -73,6 +73,10 @@ class GethClient {
cmd.push("--syncmode=" + config.syncMode); cmd.push("--syncmode=" + config.syncMode);
} }
if(this.runAsArchival(config)) {
cmd.push("--gcmode=archive");
}
if (config.account && config.account.password) { if (config.account && config.account.password) {
const resolvedPath = path.resolve(fs.dappPath(), config.account.password); const resolvedPath = path.resolve(fs.dappPath(), config.account.password);
cmd.push(`--password=${resolvedPath}`); cmd.push(`--password=${resolvedPath}`);
@ -135,6 +139,10 @@ class GethClient {
return cmd; return cmd;
} }
runAsArchival(config) {
return config.networkId === 1337 || config.archivalMode;
}
initGenesisCommmand() { initGenesisCommmand() {
let config = this.config; let config = this.config;
let cmd = this.bin + " " + this.commonOptions().join(' '); let cmd = this.bin + " " + this.commonOptions().join(' ');

View File

@ -102,6 +102,10 @@ class ParityClient {
} }
} }
if(this.runAsArchival(config)) {
cmd.push("--pruning=archive");
}
return cmd; return cmd;
} }
@ -127,6 +131,10 @@ class ParityClient {
return parsed; return parsed;
} }
runAsArchival(config) {
return config.networkId === 1337 || config.archivalMode;
}
isSupportedVersion(parsedVersion) { isSupportedVersion(parsedVersion) {
let test; let test;
try { try {