@subsquid/pipes-cli v1.0.0-alpha.6
Pre-release
Pre-release
·
9 commits
to main
since this release
npm i @subsquid/pipes-cli@alphaOptional RPC fallback in generated projects
pipes init can now generate a pipe that keeps running from a JSON-RPC endpoint while the Portal is unavailable.
- Interactive: a new "Add an RPC fallback source?" prompt (EVM only, default no), followed by an optional endpoint URL.
--config: a newrpcFallbackboolean on EVM configs. Runpipes init --schemafor the full schema.
With the option on, the generated project gets:
- a source list — the Portal stays primary, the RPC endpoint is the standby:
source: [ 'https://portal.sqd.dev/datasets/ethereum-mainnet', { type: 'rpc', url: env.RPC_URL, name: 'rpc-fallback' }, ]
RPC_URLas a required variable in its env schema, so the pipe fails fast instead of silently running Portal-only;- the optional RPC peer dependencies of
@subsquid/pipesin itspackage.json; - an RPC fallback section in its README, and
RPC_URLpassed through to the indexer service indocker-compose.yml.
The endpoint URL is written only to the generated .env — it is never stored in pipes.config.json, which is meant to be committed.
Requires @subsquid/pipes@1.0.0-alpha.22 or newer, which generated projects now pin.
What to test
Generate a project with the fallback enabled, set RPC_URL in .env, and confirm it indexes; then generate one without the option and confirm nothing changed for the Portal-only path.
Note when regenerating
Re-running init over an existing project keeps your .env as-is, so enabling the option there will not add RPC_URL to it — add the line yourself; the pipe tells you if it is missing.