Skip to content

Commit

Permalink
fix: 🐛 Remove db-max-total-wal-size arg for older chain
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantasdeveloper committed Aug 10, 2023
1 parent 873b54c commit 3174171
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/common/containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ export async function startContainers(
};
}

let walArgs = '--db-max-total-wal-size 1024';

if (version !== 'latest') {
const specVersion = +version
.split('.')
.map(miniVersion => miniVersion.padStart(3, '0'))
.join('');

if (specVersion < 5001001) {
walArgs = '';
}
}

const env = {
...process.env,
POLYMESH_VERSION: version,
Expand All @@ -64,6 +77,7 @@ export async function startContainers(
PG_DB: postgres.db,
FAKETIME: `@${timestamp}`,
CHAIN: chain,
WAL_ARGS: walArgs,
TOOLING_API_KEY: tooling.apiKey,
DATA_DIR: appData,
TOOLING_IMAGE: toolingImage,
Expand Down
3 changes: 1 addition & 2 deletions src/local/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 \
--unsafe-ws-external --unsafe-rpc-external --wasm-execution=compiled \
--no-prometheus --no-telemetry --pruning=archive --no-mdns \
--validator --rpc-cors=all --rpc-methods=unsafe --force-authoring \
--db-max-total-wal-size 1024 \
--port 30333 $1 ${BOOT_NODE}
${WAL_ARGS} --port 30333 $1 ${BOOT_NODE}

0 comments on commit 3174171

Please sign in to comment.