用途:通过 Pipes CLI(@iankressin/pipes-cli)交互式脚手架,从零生成生产可用的区块链索引器项目,适用于 EVM、Solana(SVM)与 Hyperliquid 链。
主要能力:内置模板包括 EVM 的 erc20Transfers、uniswapV3Swaps、custom(自定义合约事件),SVM 的 custom 空白模板;支持 ClickHouse 与 PostgreSQL 输出(Memory sink 尚未实现)。SDK 1.0 支持 ISO 日期字符串、Date 对象、带下划线区块号及 'latest' 作为范围起点。
使用方式:用 npx @iankressin/pipes-cli@latest init --schema 查看模板与参数结构;模板 ID 必须为 camelCase。Solana Anchor 程序用 @subsquid/solana-typegen 从 IDL 生成类型,例如 npx squid-solana-typegen src/abi whirlpool.json 或 npx squid-solana-typegen src/abi <programId>#<name>;非 Anchor 程序需手动按 d1 单字节判别符解码。Hyperliquid fills 无 CLI 模板,需手动搭建,使用 @subsquid/pipes/hyperliquid 的 hyperliquidFillsQuery 与 hyperliquidFillsPortalStream,且 .addFill() 必须传 range。
适用场景:新建索引器、按模板快速启动、索引新协议、构建 Hyperliquid 永续合约成交索引器(如鲸鱼追踪、多币种成交量、永续分析)。
限制:custom 模板的 contractEvents 必须传完整 ABI 事件对象,仅传事件名会报错;SVM custom 模板可能报 Invalid input 需手动搭建;非 Anchor 程序无法使用 typegen;CPI 调用需加 innerInstructions: true,否则静默返回零数据;建议使用 Node.js LTS v20/v22,v25.x 存在 zstd 解压缺陷;部分代币使用前缀符号(如 kPEPE、cash:GOLD)。