mirror
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoldsky Mirror Pipelines
Goldsky Mirror 管道
Mirror is Goldsky's original streaming pipeline product. It reads onchain data from a source (a subgraph entity or a direct-indexing dataset), optionally applies transforms, and writes the result to a sink (your database or message queue).
Mirror是Goldsky的原生流处理管道产品。它从数据源(子图实体或直接索引数据集)读取链上数据,可选择性地应用转换操作,然后将结果写入数据接收器(你的数据库或消息队列)。
Mirror vs Turbo — which should you use?
Mirror vs Turbo — 如何选择?
| Mirror | Turbo | |
|---|---|---|
| Subgraph sources | Yes | No |
| Speed & reliability | Good | Faster, more reliable |
| Sink variety | 11 sink types | Growing — new sinks added regularly |
| Config complexity | Moderate | Simpler YAML |
| Dataset coverage | 130+ chains | 130+ chains, richer catalog |
Use Turbo unless you need a subgraph source. Turbo is faster, more reliable, and actively gaining feature parity with Mirror — especially sink support. If you don't have a subgraph requirement, say "help me build a Turbo pipeline" and the skill will guide you through a faster setup.
/turbo-builder| Mirror | Turbo | |
|---|---|---|
| 子图数据源 | 支持 | 不支持 |
| 速度与可靠性 | 良好 | 更快、更可靠 |
| 接收器类型数量 | 11种 | 持续增加——定期新增接收器类型 |
| 配置复杂度 | 中等 | 更简洁的YAML |
| 数据集覆盖范围 | 130+条链 | 130+条链,更丰富的数据集目录 |
除非你需要子图数据源,否则请使用Turbo。Turbo速度更快、更可靠,并且正在逐步实现与Mirror的功能对等——尤其是在接收器支持方面。如果你没有子图需求,请输入"help me build a Turbo pipeline",技能将引导你完成更快速的设置。
/turbo-builderHow Mirror Pipelines Work
Mirror管道的工作原理
Source (subgraph entity or direct-indexing dataset)
↓
Transforms (optional SQL or external handlers)
↓
Sink (PostgreSQL, ClickHouse, Kafka, S3, etc.)A pipeline is defined in a YAML file () and deployed with .
apiVersion: 3goldsky pipeline apply数据源(子图实体或直接索引数据集)
↓
转换操作(可选的SQL或外部处理器)
↓
数据接收器(PostgreSQL、ClickHouse、Kafka、S3等)管道通过YAML文件定义(),并使用命令部署。
apiVersion: 3goldsky pipeline applyPipeline YAML Structure
管道YAML结构
Top-level fields:
| Field | Type | Required | Description |
|---|---|---|---|
| string | yes | Lowercase letters, numbers, hyphens only. Under 50 characters. |
| number | yes | Always |
| string | no | |
| string | no | Pipeline description |
| object | yes | At least one source |
| object | no | Use |
| object | yes | At least one sink |
顶级字段:
| 字段 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 仅允许小写字母、数字和连字符,长度不超过50个字符。 |
| number | 是 | 固定为 |
| string | 否 | |
| string | 否 | 管道描述 |
| object | 是 | 至少一个数据源 |
| object | 否 | 若无转换操作,使用 |
| object | 是 | 至少一个数据接收器 |
Sources
数据源
| Source type | YAML | Description |
|---|---|---|
| Subgraph entity | | Mirror data from Goldsky-hosted subgraphs |
| Dataset (direct indexing) | | Raw onchain datasets (blocks, logs, transactions, traces, transfers) |
| 数据源类型 | YAML | 描述 |
|---|---|---|
| 子图实体 | | 从Goldsky托管的子图中同步数据 |
| 数据集(直接索引) | | 原始链上数据集(区块、日志、交易、追踪记录、转账记录) |
Subgraph entity source
子图实体数据源
yaml
sources:
subgraph_account:
type: subgraph_entity
name: account # Entity name in your subgraph
start_at: latest # "earliest" or "latest" (default: latest)
filter: "" # Optional SQL WHERE clause for fast scan
subgraphs:
- name: my-subgraph # Deployed subgraph name
version: 1.0.0
- name: my-subgraph-arb # Cross-chain: add more subgraphs
version: 1.0.0Fields: (required: ), (required: entity name), (required: list of ), (optional), (optional), (optional).
typesubgraph_entitynamesubgraphs{name, version}start_atfilterdescriptionyaml
sources:
subgraph_account:
type: subgraph_entity
name: account # 你的子图中的实体名称
start_at: latest # "earliest"或"latest"(默认值:latest)
filter: "" # 可选的SQL WHERE子句,用于快速扫描
subgraphs:
- name: my-subgraph # 已部署的子图名称
version: 1.0.0
- name: my-subgraph-arb # 跨链:添加更多子图
version: 1.0.0字段:(必填:)、(必填:实体名称)、(必填:列表)、(可选)、(可选)、(可选)。
typesubgraph_entitynamesubgraphs{name, version}start_atfilterdescriptionDataset source
数据集数据源
yaml
sources:
base_logs:
type: dataset
dataset_name: base.logs # Use `goldsky dataset list` to discover names
version: 1.0.0 # Use `goldsky dataset get <name>` for versions
start_at: latest # "earliest" or "latest" (default: latest)
filter: "address = '0x...'" # Optional — enables Fast Scan for backfillsFields: (required: ), (required), (required), (optional), (optional), (optional).
typedatasetdataset_nameversionstart_atfilterdescriptionFast Scan: When is defined on a dataset source with , the filter is pre-applied at the source level, making historical backfill much faster. Use attributes that exist in the dataset schema ( to check).
filterstart_at: earliestgoldsky dataset get <dataset_name>yaml
sources:
base_logs:
type: dataset
dataset_name: base.logs # 使用`goldsky dataset list`命令查看可用数据集名称
version: 1.0.0 # 使用`goldsky dataset get <name>`命令查看版本
start_at: latest # "earliest"或"latest"(默认值:latest)
filter: "address = '0x...'" # 可选——启用快速扫描以加速历史数据回填字段:(必填:)、(必填)、(必填)、(可选)、(可选)、(可选)。
typedatasetdataset_nameversionstart_atfilterdescription快速扫描:当在的数据集数据源上定义时,过滤器会在数据源层面预应用,大幅加快历史数据回填速度。请使用数据集架构中存在的属性(使用命令查看架构)。
start_at: earliestfiltergoldsky dataset get <dataset_name>Sinks
数据接收器
| Sink | YAML | Notes |
|---|---|---|
| PostgreSQL | | Most common — OLTP, auto-creates tables, upsert via INSERT ON CONFLICT. Hosted option via NeonDB. |
| ClickHouse | | OLAP — uses ReplacingMergeTree by default, |
| MySQL | | OLTP workloads |
| Elasticsearch | | Real-time search and analytics |
| Kafka | | High-throughput streaming to a topic, configurable |
| Object Storage | | S3, GCS, or R2 — Parquet format, append-only, supports |
| AWS SQS | | Message queuing |
| Webhook | | HTTP POST to an external endpoint |
All sinks writing to user-managed destinations require a Goldsky Secret (). Create one with .
secret_namegoldsky secret createSinks support for casting column types at the sink level (e.g., to ).
schema_overridestringjsonb| 接收器 | YAML | 说明 |
|---|---|---|
| PostgreSQL | | 最常用——OLTP,自动创建表,通过INSERT ON CONFLICT实现更新插入。支持NeonDB托管选项。 |
| ClickHouse | | OLAP——默认使用ReplacingMergeTree, |
| MySQL | | OLTP工作负载 |
| Elasticsearch | | 实时搜索与分析 |
| Kafka | | 高吞吐量流传输到主题,可配置 |
| 对象存储 | | S3、GCS或R2——Parquet格式,仅追加写入,支持 |
| AWS SQS | | 消息队列 |
| Webhook | | HTTP POST到外部端点 |
所有写入用户托管目标的接收器都需要Goldsky Secret()。使用命令创建。
secret_namegoldsky secret create接收器支持,用于在接收器层面转换列类型(例如:转)。
schema_overridestringjsonbSink examples
接收器示例
yaml
undefinedyaml
undefinedPostgreSQL
PostgreSQL
sinks:
my_pg:
type: postgres
table: transfers
schema: public
secret_name: MY_PG_SECRET
from: my_transform
sinks:
my_pg:
type: postgres
table: transfers
schema: public
secret_name: MY_PG_SECRET
from: my_transform
ClickHouse
ClickHouse
sinks:
my_ch:
type: clickhouse
table: transfers
database: my_db
secret_name: MY_CH_SECRET
from: my_source
sinks:
my_ch:
type: clickhouse
table: transfers
database: my_db
secret_name: MY_CH_SECRET
from: my_source
Kafka
Kafka
sinks:
my_kafka:
type: kafka
topic: accounts
topic_partitions: 2
secret_name: MY_KAFKA_SECRET
from: my_source
sinks:
my_kafka:
type: kafka
topic: accounts
topic_partitions: 2
secret_name: MY_KAFKA_SECRET
from: my_source
Object Storage (S3/GCS/R2)
对象存储(S3/GCS/R2)
sinks:
my_s3:
type: file
path: s3://bucket/path/
format: parquet
secret_name: MY_S3_SECRET
from: my_source
sinks:
my_s3:
type: file
path: s3://bucket/path/
format: parquet
secret_name: MY_S3_SECRET
from: my_source
SQS
SQS
sinks:
my_sqs:
type: sqs
url: https://sqs.us-east-1.amazonaws.com/123456/my-queue
secret_name: MY_SQS_SECRET
from: my_source
See [docs.goldsky.com/mirror/sinks/supported-sinks](https://docs.goldsky.com/mirror/sinks/supported-sinks).
---sinks:
my_sqs:
type: sqs
url: https://sqs.us-east-1.amazonaws.com/123456/my-queue
secret_name: MY_SQS_SECRET
from: my_source
查看[docs.goldsky.com/mirror/sinks/supported-sinks](https://docs.goldsky.com/mirror/sinks/supported-sinks)。
---Transforms
转换操作
| Type | YAML | Description |
|---|---|---|
| SQL | (none — default) | Filter, join, or reshape records with SQL |
| External handler | | POST records to an HTTP endpoint for custom logic |
| 类型 | YAML | 描述 |
|---|---|---|
| SQL | (无——默认) | 使用SQL过滤、连接或重塑记录 |
| 外部处理器 | | 将记录POST到HTTP端点以执行自定义逻辑 |
SQL transform
SQL转换
yaml
transforms:
filtered_logs:
sql: SELECT id, block_number, address FROM base_logs WHERE block_number > 1000
primary_key: idSQL transforms reference source or transform names as table names. Supports chaining (one transform reads from another).
Built-in decode functions:
- — decode raw log events
_gs_log_decode(abi, topics, data) - — decode raw trace/transaction data
_gs_tx_decode(abi, input, output) - — fetch ABI from URL (etherscan-compatible or raw JSON); fetched once at pipeline start
_gs_fetch_abi(url, type)
yaml
transforms:
filtered_logs:
sql: SELECT id, block_number, address FROM base_logs WHERE block_number > 1000
primary_key: idSQL转换将数据源或转换操作的名称作为表名引用。支持链式调用(一个转换操作读取另一个转换操作的结果)。
内置解码函数:
- —— 解码原始日志事件
_gs_log_decode(abi, topics, data) - —— 解码原始追踪/交易数据
_gs_tx_decode(abi, input, output) - —— 从URL获取ABI(兼容etherscan或原始JSON);在管道启动时仅获取一次
_gs_fetch_abi(url, type)
External handler transform
外部处理器转换
yaml
transforms:
my_handler:
type: handler
primary_key: id
url: http://example.com/transform
from: my_source
batch_size: 100 # Records per batch (default: 100)
batch_flush_interval: 1s # Flush interval (default: 1s)
payload_columns: [col1,col2] # Optional: send subset of columns
headers: # Optional custom headers
X-Api-Key: my-key- At-least-once delivery with exponential backoff on failure
- Max response time: 5 minutes; max connection time: 1 minute
- Supports for return type casting
schema_override
yaml
transforms:
my_handler:
type: handler
primary_key: id
url: http://example.com/transform
from: my_source
batch_size: 100 # 每批记录数(默认值:100)
batch_flush_interval: 1s # 刷新间隔(默认值:1s)
payload_columns: [col1,col2] # 可选:仅发送部分列
headers: # 可选自定义请求头
X-Api-Key: my-key- 至少一次交付,失败时使用指数退避重试
- 最大响应时间:5分钟;最大连接时间:1分钟
- 支持用于返回类型转换
schema_override
Full YAML Examples
完整YAML示例
Subgraph entity to PostgreSQL
子图实体到PostgreSQL
yaml
name: my-subgraph-sync
apiVersion: 3
resource_size: s
sources:
subgraph_transfer:
type: subgraph_entity
name: Transfer
subgraphs:
- name: uniswap-v3
version: 1.0.0
transforms: {}
sinks:
my_postgres:
type: postgres
table: transfers
schema: public
secret_name: MY_PG_SECRET
from: subgraph_transferyaml
name: my-subgraph-sync
apiVersion: 3
resource_size: s
sources:
subgraph_transfer:
type: subgraph_entity
name: Transfer
subgraphs:
- name: uniswap-v3
version: 1.0.0
transforms: {}
sinks:
my_postgres:
type: postgres
table: transfers
schema: public
secret_name: MY_PG_SECRET
from: subgraph_transferDataset (direct indexing) to PostgreSQL with SQL transform
数据集(直接索引)到PostgreSQL并使用SQL转换
yaml
name: base-logs-filtered
apiVersion: 3
resource_size: s
sources:
base_logs:
type: dataset
dataset_name: base.logs
version: 1.0.0
start_at: earliest
filter: "address = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'"
transforms:
select_fields:
sql: SELECT id, block_number, transaction_hash, data FROM base_logs
primary_key: id
sinks:
pg_logs:
type: postgres
table: base_logs
schema: public
secret_name: MY_PG_SECRET
from: select_fieldsNo subgraph source? You should almost certainly use Turbo instead — it's faster, more reliable, and has a richer dataset catalog with simpler syntax. Useto get started./turbo-builder
yaml
name: base-logs-filtered
apiVersion: 3
resource_size: s
sources:
base_logs:
type: dataset
dataset_name: base.logs
version: 1.0.0
start_at: earliest
filter: "address = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'"
transforms:
select_fields:
sql: SELECT id, block_number, transaction_hash, data FROM base_logs
primary_key: id
sinks:
pg_logs:
type: postgres
table: base_logs
schema: public
secret_name: MY_PG_SECRET
from: select_fields无需子图数据源? 你几乎肯定应该使用Turbo替代——它更快、更可靠,拥有更丰富的数据集目录和更简洁的语法。使用开始创建。/turbo-builder
CLI Reference — All Pipeline Commands
CLI参考 — 所有管道命令
Global options available on every command: (CLI auth token), (colorize output, default true), .
--token <string>--color-h, --help所有命令都支持全局选项:(CLI认证令牌)、(彩色输出,默认启用)、。
--token <string>--color-h, --helpgoldsky pipeline apply <config-path>
goldsky pipeline apply <config-path>goldsky pipeline apply <config-path>
goldsky pipeline apply <config-path>Create or update a pipeline from a YAML config file. Idempotent.
| Flag | Type | Description |
|---|---|---|
| | Desired pipeline status |
| string | Snapshot to start from: |
| boolean | Skip confirmation prompts (useful for CI) |
| boolean | Skip transform validation on update |
| boolean | (deprecated, use |
| boolean | (deprecated, use |
| boolean | (deprecated) Same as |
bash
goldsky pipeline apply my-pipeline.yaml --status ACTIVE
goldsky pipeline apply my-pipeline.yaml --status ACTIVE --from-snapshot last
goldsky pipeline apply my-pipeline.yaml --force # CI/CD usage从YAML配置文件创建或更新管道。操作具有幂等性。
| 标志 | 类型 | 描述 |
|---|---|---|
| | 期望的管道状态 |
| string | 启动时使用的快照: |
| boolean | 跳过确认提示(适用于CI场景) |
| boolean | 更新时跳过转换操作验证 |
| boolean | (已废弃,使用 |
| boolean | (已废弃,使用 |
| boolean | (已废弃) 与 |
bash
goldsky pipeline apply my-pipeline.yaml --status ACTIVE
goldsky pipeline apply my-pipeline.yaml --status ACTIVE --from-snapshot last
goldsky pipeline apply my-pipeline.yaml --force # CI/CD场景使用goldsky pipeline start <nameOrConfigPath>
goldsky pipeline start <nameOrConfigPath>goldsky pipeline start <nameOrConfigPath>
goldsky pipeline start <nameOrConfigPath>Start a pipeline (equivalent to apply with ).
--status ACTIVE| Flag | Type | Description |
|---|---|---|
| string | |
| boolean | (deprecated, use |
启动管道(等同于带参数的apply命令)。
--status ACTIVE| 标志 | 类型 | 描述 |
|---|---|---|
| string | |
| boolean | (已废弃,使用 |
goldsky pipeline stop <nameOrConfigPath>
goldsky pipeline stop <nameOrConfigPath>goldsky pipeline stop <nameOrConfigPath>
goldsky pipeline stop <nameOrConfigPath>Stop a pipeline without taking a snapshot. Sets status to INACTIVE, runtime to TERMINATED.
No additional flags beyond global options.
停止管道不创建快照。将状态设置为INACTIVE,运行状态设置为TERMINATED。
除全局选项外无其他标志。
goldsky pipeline pause <nameOrConfigPath>
goldsky pipeline pause <nameOrConfigPath>goldsky pipeline pause <nameOrConfigPath>
goldsky pipeline pause <nameOrConfigPath>Pause a pipeline with a snapshot so it can resume from where it left off. Sets status to PAUSED, runtime to TERMINATED.
No additional flags beyond global options.
暂停管道并创建快照,以便后续从暂停处恢复。将状态设置为PAUSED,运行状态设置为TERMINATED。
除全局选项外无其他标志。
goldsky pipeline restart <nameOrConfigPath>
goldsky pipeline restart <nameOrConfigPath>goldsky pipeline restart <nameOrConfigPath>
goldsky pipeline restart <nameOrConfigPath>Restart a pipeline without configuration changes. Useful when the sink database was restarted, connection is stuck, etc.
| Flag | Type | Description |
|---|---|---|
| string | Required. |
| boolean | Skip monitoring after restart (default: false) |
bash
goldsky pipeline restart my-pipeline --from-snapshot last
goldsky pipeline restart my-pipeline --from-snapshot none # restart from scratch无需更改配置即可重启管道。适用于接收器数据库重启、连接卡住等场景。
| 标志 | 类型 | 描述 |
|---|---|---|
| string | 必填。 |
| boolean | 重启后跳过监控(默认值:false) |
bash
goldsky pipeline restart my-pipeline --from-snapshot last
goldsky pipeline restart my-pipeline --from-snapshot none # 从头开始重启goldsky pipeline get <nameOrConfigPath>
goldsky pipeline get <nameOrConfigPath>goldsky pipeline get <nameOrConfigPath>
goldsky pipeline get <nameOrConfigPath>Get pipeline configuration and status.
| Flag | Type | Description |
|---|---|---|
| | Output format (default: yaml) |
| boolean | Print only the pipeline definition (sources, transforms, sinks) |
| string | Pipeline version (default: latest) |
获取管道配置和状态。
| 标志 | 类型 | 描述 |
|---|---|---|
| | 输出格式(默认值:yaml) |
| boolean | 仅打印管道定义(数据源、转换操作、接收器) |
| string | 管道版本(默认值:最新版本) |
goldsky pipeline list
goldsky pipeline listgoldsky pipeline list
goldsky pipeline listList all pipelines in the project.
| Flag | Type | Description |
|---|---|---|
| | Output format (default: table) |
| | Detail level (default: summary) |
| boolean | Include runtime status and errors (default: false) |
bash
goldsky pipeline list --output json
goldsky pipeline list --include-runtime-details列出项目中的所有管道。
| 标志 | 类型 | 描述 |
|---|---|---|
| | 输出格式(默认值:table) |
| | 详细程度(默认值:summary) |
| boolean | 包含运行状态和错误信息(默认值:false) |
bash
goldsky pipeline list --output json
goldsky pipeline list --include-runtime-detailsgoldsky pipeline info <nameOrConfigPath>
goldsky pipeline info <nameOrConfigPath>goldsky pipeline info <nameOrConfigPath>
goldsky pipeline info <nameOrConfigPath>Display pipeline information (status, config, runtime details).
| Flag | Type | Description |
|---|---|---|
| string | Pipeline version (default: latest) |
显示管道信息(状态、配置、运行详情)。
| 标志 | 类型 | 描述 |
|---|---|---|
| string | 管道版本(默认值:最新版本) |
goldsky pipeline monitor <nameOrConfigPath>
goldsky pipeline monitor <nameOrConfigPath>goldsky pipeline monitor <nameOrConfigPath>
goldsky pipeline monitor <nameOrConfigPath>Monitor pipeline runtime — status, metrics (records received/written), errors. Refreshes every 10 seconds.
| Flag | Type | Description |
|---|---|---|
| boolean | Monitor an in-flight update request |
| number | Max number of data refreshes |
| string | Pipeline version (default: latest) |
监控管道运行状态——状态、指标(接收/写入记录数)、错误信息。每10秒刷新一次。
| 标志 | 类型 | 描述 |
|---|---|---|
| boolean | 监控正在进行的更新请求 |
| number | 最大数据刷新次数 |
| string | 管道版本(默认值:最新版本) |
goldsky pipeline delete <nameOrConfigPath>
goldsky pipeline delete <nameOrConfigPath>goldsky pipeline delete <nameOrConfigPath>
goldsky pipeline delete <nameOrConfigPath>Delete a pipeline permanently.
| Flag | Type | Description |
|---|---|---|
| boolean | Force deletion without confirmation prompt (default: false) |
永久删除管道。
| 标志 | 类型 | 描述 |
|---|---|---|
| boolean | 强制删除,跳过确认提示(默认值:false) |
goldsky pipeline resize <nameOrConfigPath> <resourceSize>
goldsky pipeline resize <nameOrConfigPath> <resourceSize>goldsky pipeline resize <nameOrConfigPath> <resourceSize>
goldsky pipeline resize <nameOrConfigPath> <resourceSize>Change the compute resources for a pipeline.
| Positional | Description |
|---|---|
| One of: |
bash
goldsky pipeline resize my-pipeline l更改管道的计算资源。
| 位置参数 | 描述 |
|---|---|
| 可选值: |
bash
goldsky pipeline resize my-pipeline lgoldsky pipeline validate [config-path]
goldsky pipeline validate [config-path]goldsky pipeline validate [config-path]
goldsky pipeline validate [config-path]Validate a pipeline YAML config without deploying.
| Flag | Type | Description |
|---|---|---|
| string | (deprecated) Inline JSON definition |
| string | (deprecated) Path to JSON/YAML definition |
bash
goldsky pipeline validate my-pipeline.yaml验证管道YAML配置,无需部署。
| 标志 | 类型 | 描述 |
|---|---|---|
| string | (已废弃) 内联JSON定义 |
| string | (已废弃) JSON/YAML定义文件路径 |
bash
goldsky pipeline validate my-pipeline.yamlgoldsky pipeline export [name]
goldsky pipeline export [name]goldsky pipeline export [name]
goldsky pipeline export [name]Export pipeline configuration.
| Flag | Type | Description |
|---|---|---|
| boolean | Export configs for all pipelines |
导出管道配置。
| 标志 | 类型 | 描述 |
|---|---|---|
| boolean | 导出所有管道的配置 |
goldsky pipeline cancel-update <nameOrConfigPath>
goldsky pipeline cancel-update <nameOrConfigPath>goldsky pipeline cancel-update <nameOrConfigPath>
goldsky pipeline cancel-update <nameOrConfigPath>Cancel an in-flight update or snapshot request. Useful when a long-running snapshot blocks a needed update.
No additional flags beyond global options.
取消正在进行的更新或快照请求。适用于长时间运行的快照阻塞了必要更新的场景。
除全局选项外无其他标志。
goldsky pipeline create <name>
(interactive/guided)
goldsky pipeline create <name>goldsky pipeline create <name>
(交互式引导)
goldsky pipeline create <name>Guided CLI experience for creating a pipeline interactively.
| Flag | Type | Description |
|---|---|---|
| | Resource size (default: s) |
| boolean | Use dedicated egress IPs (default: false) |
| boolean | Skip transform validation |
| | (deprecated, use |
| string | (deprecated, use |
| string | (deprecated, use |
| string | (deprecated, use |
| | Output format (default: yaml) |
交互式CLI体验,引导创建管道。
| 标志 | 类型 | 描述 |
|---|---|---|
| | 资源大小(默认值:s) |
| boolean | 使用专用出口IP(默认值:false) |
| boolean | 跳过转换操作验证 |
| | (已废弃,使用 |
| string | (已废弃,使用 |
| string | (已废弃,使用 |
| string | (已废弃,使用 |
| | 输出格式(默认值:yaml) |
goldsky pipeline get-definition <name>
(deprecated)
goldsky pipeline get-definition <name>goldsky pipeline get-definition <name>
(已废弃)
goldsky pipeline get-definition <name>Get a shareable pipeline definition. Use instead.
goldsky pipeline get <name> --definition获取可共享的管道定义。请改用。
goldsky pipeline get <name> --definitionSnapshot Commands
快照命令
bash
undefinedbash
undefinedList snapshots for a pipeline
列出管道的所有快照
goldsky pipeline snapshots list <nameOrConfigPath> [-v <version>]
goldsky pipeline snapshots list <nameOrConfigPath> [-v <version>]
Create a snapshot manually
手动创建快照
goldsky pipeline snapshots create <nameOrConfigPath>
`snapshots list` supports `-v, --version` to filter by pipeline version (default: all versions).
---goldsky pipeline snapshots create <nameOrConfigPath>
`snapshots list`支持`-v, --version`参数按管道版本过滤(默认值:所有版本)。
---Lifecycle Quick Reference
生命周期速查
| Action | Command |
|---|---|
| Deploy / start | |
| Start (existing) | |
| Pause (with snapshot) | |
| Stop (no snapshot) | |
| Restart (no config change) | |
| Update config | |
| Resize | |
| Validate YAML | |
| Monitor | |
| Get config | |
| Export config | |
| Delete | |
| Cancel in-flight op | |
| List snapshots | |
| Create snapshot | |
| List all pipelines | |
Pause vs. Stop:
- — takes a snapshot and suspends the pipeline (status: PAUSED + TERMINATED). Can resume from where it left off.
pause - — stops without taking a snapshot (status: INACTIVE + TERMINATED). Resuming may reprocess data.
stop
Desired statuses: ACTIVE, INACTIVE, PAUSED
Runtime statuses: STARTING, RUNNING, FAILING, TERMINATED
| 操作 | 命令 |
|---|---|
| 部署/启动 | |
| 启动(现有管道) | |
| 暂停(带快照) | |
| 停止(无快照) | |
| 重启(无配置更改) | |
| 更新配置 | |
| 调整资源大小 | |
| 验证YAML | |
| 监控 | |
| 获取配置 | |
| 导出配置 | |
| 删除 | |
| 取消正在进行的操作 | |
| 列出快照 | |
| 创建快照 | |
| 列出所有管道 | |
暂停 vs 停止:
- —— 创建快照并暂停管道(状态:PAUSED + TERMINATED)。可从暂停处恢复。
pause - —— 停止管道但不创建快照(状态:INACTIVE + TERMINATED)。恢复时可能需要重新处理数据。
stop
期望状态: ACTIVE、INACTIVE、PAUSED
运行状态: STARTING、RUNNING、FAILING、TERMINATED
Snapshots
快照
Snapshots capture a point-in-time state of a RUNNING pipeline for resumption. They contain progress on reading sources and SQL transform state — not sink state.
- Automatic snapshots are taken every 4 hours for healthy RUNNING pipelines.
- Before updates: a snapshot is created automatically before applying config changes to a RUNNING pipeline.
- On pause: a snapshot is created when pausing.
- Manual: .
goldsky pipeline snapshots create <name> - Resume: only the latest snapshot can be used. For older snapshots, contact support.
The flag (on , , ) controls snapshot behavior:
--from-snapshotapplystartrestart- — create a fresh snapshot, then start from it (default)
new - — use the latest existing snapshot (no new snapshot)
last - — start from scratch, no snapshot
none - — use a specific snapshot
<snapshot-id>
快照捕获RUNNING状态管道的时间点状态,用于恢复。快照包含数据源读取进度和SQL转换操作状态——不包含接收器状态。
- 自动快照:健康的RUNNING管道每4小时自动创建一次快照。
- 更新前:在对RUNNING管道应用配置更改前,会自动创建快照。
- 暂停时:暂停管道时会创建快照。
- 手动创建:。
goldsky pipeline snapshots create <name> - 恢复:仅能使用最新快照。如需使用旧快照,请联系支持团队。
--from-snapshotapplystartrestart- —— 创建新快照,然后从该快照启动(默认值)
new - —— 使用最新现有快照(不创建新快照)
last - —— 从头开始,不使用快照
none - —— 使用指定快照
<snapshot-id>
Resource Sizing
资源大小设置
Set via in YAML or .
resource_sizegoldsky pipeline resize <name> <size>| Size | Description |
|---|---|
| Default. Handles most use cases, backfill of small chains, up to 300K records/sec, up to ~8 subgraph sources |
| Larger compute — for backfilling large chains or large JOINs |
Start small and scale up if needed. Resource size affects pricing.
通过YAML中的字段或命令设置。
resource_sizegoldsky pipeline resize <name> <size>| 大小 | 描述 |
|---|---|
| 默认值。适用于大多数场景、小链的数据回填,支持最高30万条记录/秒,最多支持约8个子图数据源 |
| 更大的计算资源——适用于大链的数据回填或大型JOIN操作 |
从小资源大小开始,按需扩容。资源大小会影响定价。
Networking
网络
- Mirror pipelines write data from AWS us-west-2. Ensure your sink allows inbound connections from this region.
- IP addresses are dynamic by default.
- Dedicated egress IPs available on request — use on
--use-dedicated-ip, or contact support@goldsky.com.pipeline create - VPC peering available on request.
- For external handler transforms, deploy close to us-west-2 for best performance (aim for p95 < 100ms).
- Mirror管道从AWS us-west-2区域写入数据。请确保你的接收器允许来自该区域的入站连接。
- 默认情况下IP地址是动态的。
- 专用出口IP可按需申请——在命令中使用
pipeline create参数,或联系support@goldsky.com。--use-dedicated-ip - 可按需申请VPC对等连接。
- 对于外部处理器转换操作,请将部署位置靠近us-west-2区域以获得最佳性能(目标p95延迟 < 100ms)。
Dataset Discovery
数据集发现
bash
undefinedbash
undefinedList available datasets
列出可用数据集
goldsky dataset list
goldsky dataset list
Get schema for a specific dataset
获取特定数据集的架构
goldsky dataset get <dataset_name>
---goldsky dataset get <dataset_name>
---Common Questions
常见问题
Can Mirror pipelines use subgraphs as a source?
Yes — this is Mirror's primary advantage over Turbo. Set in your source and reference your deployed subgraph.
type: subgraph_entityCan Mirror handle multiple sources or cross-chain data?
Yes — define multiple sources in the YAML and use SQL transforms to join or merge them. For subgraphs, you can list multiple subgraphs (different chains) in a single source's array.
subgraphsMy pipeline needs more resources / is too slow?
Run (or , ). Start small and scale up.
goldsky pipeline resize <name> lxlxxlMy pipeline is ACTIVE but TERMINATED — what happened?
The desired status is ACTIVE but the runtime failed (e.g., bad secret, sink unavailable, resource issues). Check errors with or view the dashboard. Fix the issue and restart.
goldsky pipeline monitor <name> --include-runtime-detailsHow do I update a pipeline without losing progress?
Edit your YAML and run . By default, a snapshot is taken before the update is applied. Use to skip creating a new snapshot and use the latest existing one.
goldsky pipeline apply <file.yaml>--from-snapshot lastA long snapshot is blocking my update — what do I do?
Run to cancel the in-flight operation, then reapply with or .
goldsky pipeline cancel-update <name>--from-snapshot last--from-snapshot noneMirror管道能否使用子图作为数据源?
可以——这是Mirror相对于Turbo的主要优势。在数据源中设置并引用已部署的子图即可。
type: subgraph_entityMirror能否处理多个数据源或跨链数据?
可以——在YAML中定义多个数据源,并使用SQL转换操作进行连接或合并。对于子图,你可以在单个数据源的数组中列出多个子图(不同链)。
subgraphs我的管道需要更多资源/速度太慢?
运行(或、)。从小资源大小开始,按需扩容。
goldsky pipeline resize <name> lxlxxl我的管道状态是ACTIVE但运行状态是TERMINATED——发生了什么?
期望状态为ACTIVE但运行时失败(例如:无效密钥、接收器不可用、资源问题)。使用命令查看错误信息,或查看控制台。修复问题后重启管道。
goldsky pipeline monitor <name> --include-runtime-details如何在不丢失进度的情况下更新管道?
编辑YAML文件后运行。默认情况下,更新前会自动创建快照。使用参数可跳过创建新快照,直接使用最新现有快照。
goldsky pipeline apply <file.yaml>--from-snapshot last长时间运行的快照阻塞了我的更新——该怎么办?
运行命令取消正在进行的操作,然后使用或参数重新应用配置。
goldsky pipeline cancel-update <name>--from-snapshot last--from-snapshot noneRelated
相关资源
- — Build a new Turbo pipeline (recommended for new projects not using subgraph sources)
/turbo-builder - — Deploy and manage the subgraph you want to sync via Mirror
/subgraphs - — Create secrets for sink credentials
/secrets - — Browse available dataset names and chain prefixes
/datasets - Goldsky docs: docs.goldsky.com/mirror/introduction
- Pipeline config reference: docs.goldsky.com/mirror/reference/config-file/pipeline
- —— 创建新的Turbo管道(推荐给不需要子图数据源的新项目)
/turbo-builder - —— 部署和管理你想要通过Mirror同步的子图
/subgraphs - —— 创建用于接收器凭证的密钥
/secrets - —— 浏览可用数据集名称和链前缀
/datasets - Goldsky文档:docs.goldsky.com/mirror/introduction
- 管道配置参考:docs.goldsky.com/mirror/reference/config-file/pipeline