Skip to content

@subsquid/pipes-cli v1.0.0-alpha.6

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 25 Aug 15:44
· 9 commits to main since this release
npm i @subsquid/pipes-cli@alpha

Optional 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 new rpcFallback boolean on EVM configs. Run pipes init --schema for 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_URL as 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/pipes in its package.json;
  • an RPC fallback section in its README, and RPC_URL passed through to the indexer service in docker-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.