Skip to main content

portalSqliteCache

Create SQLite cache for Portal responses. Use with evmPortalSource to cache Portal API responses locally.
portalSqliteCache(config: { path: string }): PortalCache
Example:
import { portalSqliteCache } from "@subsquid/pipes/portal-cache/node";
import { evmPortalSource } from "@subsquid/pipes/evm";

const source = evmPortalSource({
  portal: "https://portal.sqd.dev/datasets/ethereum-mainnet",
  cache: {
    adapter: await portalSqliteCache({ path: "./cache.sqlite" }),
  },
});
Import from @subsquid/pipes/portal-cache/node instead of @subsquid/pipes/portal-cache.

When to Use

  • Development iteration
  • Testing pipelines
  • Repeated processing of same blocks