FROM node:24-alpine WORKDIR /app # @subql/node with @polkadot aliased to @pezkuwi. The tree is locked in # docker/indexer so every build installs the same packages (and Dependabot # can see them); without the lock a cached layer kept whatever was current # the day it was first built. COPY docker/indexer/package.json docker/indexer/package-lock.json ./ RUN npm ci --no-audit --no-fund # @subql/node requires '@polkadot/api-augment/substrate' but @pezkuwi uses # chain-specific paths (./pezkuwi, ./bizinikiwi). Patch the exports map in # package.json to add ./substrate pointing to pezkuwi augmentation. RUN node -e " \ const fs = require('fs'); \ const p = '/app/node_modules/@polkadot/api-augment/package.json'; \ const pkg = JSON.parse(fs.readFileSync(p, 'utf8')); \ pkg.exports['./substrate'] = { \ require: './cjs/pezkuwi/index.js', \ default: './pezkuwi/index.js' \ }; \ fs.writeFileSync(p, JSON.stringify(pkg, null, 2)); \ " # Patch: handle pruned blockchain state gracefully. # Without this, SubQuery crashes when RPC nodes have pruned old block state. COPY docker/patches/pruned-state-fallback.js /tmp/pruned-state-fallback.js RUN node /tmp/pruned-state-fallback.js && rm /tmp/pruned-state-fallback.js ENTRYPOINT ["/app/node_modules/.bin/subql-node"]