Loading...
Loading...
Compare original and translation side by side
/turbo-builder/turbo-doctorCRITICAL: Always validate YAML withbefore showing complete pipeline YAML to the user or deploying.goldsky turbo validate <file.yaml>
/turbo-builder/turbo-doctor重要提示: 在向用户展示完整管道YAML或部署之前,请务必使用验证YAML文件。goldsky turbo validate <file.yaml>
name: my-first-pipeline
resource_size: s
sources:
transfers:
type: dataset
dataset_name: base.erc20_transfers
version: 1.2.0
start_at: latest
transforms: {}
sinks:
output:
type: blackhole
from: transfersundefinedname: my-first-pipeline
resource_size: s
sources:
transfers:
type: dataset
dataset_name: base.erc20_transfers
version: 1.2.0
start_at: latest
transforms: {}
sinks:
output:
type: blackhole
from: transfersundefined
---
---curl https://goldsky.com | shcurl https://install-turbo.goldsky.com | shgoldsky turbo listgoldsky logincurl https://goldsky.com | shcurl https://install-turbo.goldsky.com | shgoldsky turbo listgoldsky logindatasets| What They Want | Dataset to Use |
|---|---|
| Token transfers (fungible) | |
| NFT transfers | |
| All contract events | |
| Block data | |
| Transaction data | |
/datasetsdatasets| 需求 | 使用的数据集 |
|---|---|
| 同质化代币转账 | |
| NFT转账 | |
| 所有合约事件 | |
| 区块数据 | |
| 交易数据 | |
/datasets| Action | Command |
|---|---|
| Install Goldsky CLI | |
| Install Turbo extension | |
| Verify Turbo installed | |
| 操作 | 命令 |
|---|---|
| 安装Goldsky CLI | |
| 安装Turbo扩展 | |
| 验证Turbo是否安装 | |
| Action | Command |
|---|---|
| List datasets | |
| Validate (REQUIRED) | |
| Deploy/Update | |
| Deploy + Inspect | |
| List pipelines | |
| View live data | |
| Inspect node | |
| View logs | |
| Follow logs | |
| List secrets | |
/turbo-lifecycle| 操作 | 命令 |
|---|---|
| 列出数据集 | |
| 验证(必填) | |
| 部署/更新管道 | |
| 部署并检查 | |
| 列出管道 | |
| 查看实时数据 | |
| 检查节点 | |
| 查看日志 | |
| 实时跟踪日志 | |
| 列出密钥 | |
/turbo-lifecyclename: my-pipeline # Required: unique identifier
resource_size: s # Required: s, m, or l
description: "Optional desc" # Optional: what the pipeline does
sources:
source_name: # Define data inputs
type: dataset
# ... source config
transforms: # Optional: process data
transform_name:
type: sql
# ... transform config
sinks:
sink_name: # Define data outputs
type: postgres
# ... sink configname: my-pipeline # 必填:唯一标识符
resource_size: s # 必填:s、m或l
description: "可选描述" # 可选:管道的功能说明
sources:
source_name: # 定义数据输入
type: dataset
# ... 数据源配置
transforms: # 可选:数据处理
transform_name:
type: sql
# ... 转换配置
sinks:
sink_name: # 定义数据输出
type: postgres
# ... 接收器配置| Field | Required | Description |
|---|---|---|
| Yes | Unique pipeline identifier (lowercase, hyphens) |
| Yes | Worker allocation: |
| No | Human-readable description |
| No | |
| Yes | Data input definitions |
| No | Data processing definitions |
| Yes | Data output definitions |
| 字段 | 是否必填 | 描述 |
|---|---|---|
| 是 | 唯一管道标识符(小写,仅允许连字符) |
| 是 | 工作节点资源分配: |
| 否 | 人类可读的管道描述 |
| 否 | 设置为 |
| 是 | 数据输入定义 |
| 否 | 数据处理定义 |
| 是 | 数据输出定义 |
job: truename: backfill-usdc-history
resource_size: l
job: true
sources:
logs:
type: dataset
dataset_name: ethereum.raw_logs
version: 1.0.0
start_at: earliest
end_block: 19000000
filter: >-
address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
transforms: {}
sinks:
output:
type: s3_sink
from: logs
endpoint: https://s3.amazonaws.com
bucket: my-backfill-bucket
prefix: usdc/
secret_name: MY_S3goldsky turbo deleterestartend_blockresource_size: lFor architecture guidance on when to use job vs streaming mode, see./turbo-architecture
job: truename: backfill-usdc-history
resource_size: l
job: true
sources:
logs:
type: dataset
dataset_name: ethereum.raw_logs
version: 1.0.0
start_at: earliest
end_block: 19000000
filter: >-
address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
transforms: {}
sinks:
output:
type: s3_sink
from: logs
endpoint: https://s3.amazonaws.com
bucket: my-backfill-bucket
prefix: usdc/
secret_name: MY_S3goldsky turbo deleterestartend_blockresource_size: l如需了解何时使用任务模式 vs 流式模式的架构指导,请查看。/turbo-architecture
| Size | Workers | Use Case |
|---|---|---|
| 1 | Testing, low-volume data |
| 2 | Production, moderate volume |
| 4 | High-volume, multi-chain pipelines |
| 规格 | 工作节点数量 | 使用场景 |
|---|---|---|
| 1 | 测试、低数据量场景 |
| 2 | 生产环境、中等数据量场景 |
| 4 | 高数据量、跨链管道场景 |
sources:
my_source:
type: dataset
dataset_name: <chain>.<dataset_type>
version: <version>
start_at: latest | earliest # EVM chains
# OR
start_block: <slot_number> # Solana onlysources:
my_source:
type: dataset
dataset_name: <chain>.<dataset_type>
version: <version>
start_at: latest | earliest # EVM链适用
# 或者
start_block: <slot_number> # 仅Solana适用| Field | Required | Description |
|---|---|---|
| Yes | |
| Yes | Format: |
| Yes | Dataset version (e.g., |
| EVM | |
| Solana | Specific slot number (omit for latest) |
| No | Stop processing at this block (for bounded backfills) |
| No | SQL WHERE clause to pre-filter at source level (efficient) |
| 字段 | 是否必填 | 描述 |
|---|---|---|
| 是 | 对于区块链数据,值为 |
| 是 | 格式: |
| 是 | 数据集版本(例如: |
| EVM链必填 | |
| Solana必填 | 特定插槽号(省略则从最新区块开始) |
| 否 | 处理到该区块后停止(用于限定范围的回填任务) |
| 否 | SQL WHERE子句,用于在数据源层面预过滤数据(效率更高) |
filtersources:
usdc_logs:
type: dataset
dataset_name: base.raw_logs
version: 1.0.0
start_at: earliest
filter: >-
address = lower('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913')
AND block_number >= 10000000filterWHEREfilterfilterstart_at: earliestend_blockfiltersources:
usdc_logs:
type: dataset
dataset_name: base.raw_logs
version: 1.0.0
start_at: earliest
filter: >-
address = lower('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913')
AND block_number >= 10000000filterWHEREfilterfilterstart_at: earliestend_block/datasetsethereumbasematicpolygonarbitrumoptimismbscavalanchesolanastart_blockstart_atbitcoin.rawstellar_mainnetsuinearstarknetfogoraw_logsraw_transactionstransactionsblocksraw_traceserc20_transferserc721_transfersdecoded_logs/datasetsethereumbasematicpolygonarbitrumoptimismbscavalanchesolanastart_blockstart_atbitcoin.rawstellar_mainnetsuinearstarknetfogoraw_logsraw_transactionstransactionsblocksraw_traceserc20_transferserc721_transfersdecoded_logs| Type | Use Case |
|---|---|
| Filtering, projections, SQL functions |
| Custom TypeScript/WASM logic |
| Call external HTTP APIs to enrich data |
| Lookup tables backed by a database |
| 类型 | 使用场景 |
|---|---|
| 过滤、投影、SQL函数处理 |
| 自定义TypeScript/WASM逻辑 |
| 调用外部HTTP API丰富数据 |
| 基于数据库的查找表 |
transforms:
filtered:
type: sql
primary_key: id
sql: |
SELECT
id,
sender,
recipient,
amount
FROM source_name
WHERE amount > 1000| Field | Required | Description |
|---|---|---|
| Yes | |
| Yes | Column for uniqueness/ordering |
| Yes | SQL query (reference sources by name) |
| No | Override default source (for chaining) |
transforms:
filtered:
type: sql
primary_key: id
sql: |
SELECT
id,
sender,
recipient,
amount
FROM source_name
WHERE amount > 1000| 字段 | 是否必填 | 描述 |
|---|---|---|
| 是 | 值为 |
| 是 | 用于唯一性/排序的列 |
| 是 | SQL查询(通过名称引用数据源) |
| 否 | 覆盖默认数据源(用于链式转换) |
transforms:
custom:
type: script
primary_key: id
language: typescript
from: source_name
schema:
id: string
sender: string
amount: string
processed_at: string
script: |
function invoke(data) {
if (data.amount < 1000) return null; // Filter out
return {
id: data.id,
sender: data.sender,
amount: data.amount,
processed_at: new Date().toISOString()
};
}For full TypeScript transform documentation, schema types, and examples, see./turbo-transforms
transforms:
custom:
type: script
primary_key: id
language: typescript
from: source_name
schema:
id: string
sender: string
amount: string
processed_at: string
script: |
function invoke(data) {
if (data.amount < 1000) return null; // 过滤掉
return {
id: data.id,
sender: data.sender,
amount: data.amount,
processed_at: new Date().toISOString()
};
}如需完整的TypeScript转换文档、 schema类型及示例,请查看。/turbo-transforms
transforms:
tracked_wallets:
type: dynamic_table
backend_type: Postgres # or: InMemory
backend_entity_name: tracked_wallets
secret_name: MY_DB # required for Postgresdynamic_table_check()WHERE dynamic_table_check('tracked_wallets', sender)For full dynamic table documentation, backend options, and examples, see./turbo-transforms
transforms:
tracked_wallets:
type: dynamic_table
backend_type: Postgres # 或:InMemory
backend_entity_name: tracked_wallets
secret_name: MY_DB # 使用Postgres时必填dynamic_table_check()WHERE dynamic_table_check('tracked_wallets', sender)如需完整的动态表文档、后端选项及示例,请查看。/turbo-transforms
transforms:
enriched:
type: handler
primary_key: id
from: my_source
url: https://my-api.example.com/enrich
headers:
Authorization: Bearer my-token
batch_size: 100
timeout_ms: 5000For full handler transform documentation, see./turbo-transforms
transforms:
enriched:
type: handler
primary_key: id
from: my_source
url: https://my-api.example.com/enrich
headers:
Authorization: Bearer my-token
batch_size: 100
timeout_ms: 5000如需完整的Handler转换文档,请查看。/turbo-transforms
fromtransforms:
step1:
type: sql
primary_key: id
sql: SELECT * FROM source WHERE amount > 100
step2:
type: sql
primary_key: id
from: step1
sql: SELECT *, 'processed' as status FROM step1fromtransforms:
step1:
type: sql
primary_key: id
sql: SELECT * FROM source WHERE amount > 100
step2:
type: sql
primary_key: id
from: step1
sql: SELECT *, 'processed' as status FROM step1| Field | Required | Description |
|---|---|---|
| Yes | Sink type |
| Yes | Source or transform to read from |
| Varies | Secret for credentials (most sinks) |
| Varies | Column for upserts (database sinks) |
| 字段 | 是否必填 | 描述 |
|---|---|---|
| 是 | 接收器类型 |
| 是 | 读取数据的数据源或转换节点 |
| 视情况而定 | 凭证密钥(大多数接收器需要) |
| 视情况而定 | 用于更新的列(数据库接收器) |
sinks:
test_output:
type: blackhole
from: my_transformsinks:
test_output:
type: blackhole
from: my_transformsinks:
postgres_output:
type: postgres
from: my_transform
schema: public
table: my_table
secret_name: MY_POSTGRES_SECRET
primary_key: idpostgres://username:password@host:port/databasesinks:
postgres_output:
type: postgres
from: my_transform
schema: public
table: my_table
secret_name: MY_POSTGRES_SECRET
primary_key: idpostgres://username:password@host:port/databasesinks:
balances:
type: postgres_aggregate
from: transfers
schema: public
landing_table: transfer_log
agg_table: account_balances
primary_key: transfer_id
secret_name: MY_POSTGRES
group_by:
account:
type: text
aggregate:
balance:
from: amount
fn: sumsumcountavgminmaxsinks:
balances:
type: postgres_aggregate
from: transfers
schema: public
landing_table: transfer_log
agg_table: account_balances
primary_key: transfer_id
secret_name: MY_POSTGRES
group_by:
account:
type: text
aggregate:
balance:
from: amount
fn: sumsumcountavgminmaxsinks:
clickhouse_output:
type: clickhouse
from: my_transform
table: my_table
secret_name: MY_CLICKHOUSE_SECRET
primary_key: idhttps://username:password@host:port/databasesinks:
clickhouse_output:
type: clickhouse
from: my_transform
table: my_table
secret_name: MY_CLICKHOUSE_SECRET
primary_key: idhttps://username:password@host:port/databasesinks:
kafka_output:
type: kafka
from: my_transform
topic: my-topic
topic_partitions: 10
data_format: avro # or: json
schema_registry_url: http://schema-registry:8081 # required for avrosinks:
kafka_output:
type: kafka
from: my_transform
topic: my-topic
topic_partitions: 10
data_format: avro # 或:json
schema_registry_url: http://schema-registry:8081 # 使用avro时必填Note: Turbo webhook sinks do not support Goldsky's native secrets management. Include auth headers directly in the pipeline config.
sinks:
webhook_output:
type: webhook
from: my_transform
url: https://api.example.com/webhook
one_row_per_request: true
headers:
Authorization: Bearer your-token
Content-Type: application/json注意:Turbo webhook接收器不支持Goldsky原生密钥管理。请在管道配置中直接包含认证头。
sinks:
webhook_output:
type: webhook
from: my_transform
url: https://api.example.com/webhook
one_row_per_request: true
headers:
Authorization: Bearer your-token
Content-Type: application/jsonsinks:
s3_output:
type: s3_sink
from: my_transform
endpoint: https://s3.amazonaws.com
bucket: my-bucket
prefix: data/
secret_name: MY_S3_SECRETaccess_key_id:secret_access_keyaccess_key_id:secret_access_key:session_tokensinks:
s3_output:
type: s3_sink
from: my_transform
endpoint: https://s3.amazonaws.com
bucket: my-bucket
prefix: data/
secret_name: MY_S3_SECRETaccess_key_id:secret_access_keyaccess_key_id:secret_access_key:session_tokensinks:
s2_output:
type: s2_sink
from: my_transform
access_token: your_access_token
basin: your-basin-name
stream: your-stream-namesinks:
s2_output:
type: s2_sink
from: my_transform
access_token: your_access_token
basin: your-basin-name
stream: your-stream-nameTemplate files are available in thefolder. Copy and customize these for your pipelines.templates/
| Template | Description | Use Case |
|---|---|---|
| Simplest pipeline, no credentials | Quick testing |
| Filter by contract address | USDC, specific tokens |
| Write to PostgreSQL | Production data storage |
| Combine multiple chains | Cross-chain analytics |
| Solana SPL tokens | Non-EVM chains |
| Multiple outputs | Archive + alerts + streaming |
undefined模板文件位于文件夹中。 复制并自定义这些模板以创建你的管道。templates/
| 模板名称 | 描述 | 使用场景 |
|---|---|---|
| 最简单的管道,无需凭证 | 快速测试 |
| 按合约地址过滤 | USDC、特定代币场景 |
| 写入PostgreSQL | 生产环境数据存储 |
| 合并多条链的数据 | 跨链分析 |
| Solana SPL代币 | 非EVM链场景 |
| 多输出节点 | 归档+告警+流处理 |
undefined
**Template location:** `templates/` (relative to this skill's directory)
---
**模板位置:** `templates/`(相对于本技能的目录)
---transforms: {}
sinks:
output:
type: blackhole
from: transferstransforms:
filtered:
type: sql
primary_key: id
sql: |
SELECT * FROM transfers WHERE amount > 1000000
sinks:
output:
type: blackhole
from: filtered # Changed from 'transfers'transforms: {}
sinks:
output:
type: blackhole
from: transferstransforms:
filtered:
type: sql
primary_key: id
sql: |
SELECT * FROM transfers WHERE amount > 1000000
sinks:
output:
type: blackhole
from: filtered # 从'transfers'改为'filtered'sinks:
existing_sink:
type: blackhole
from: my_transform
# Add new sink
postgres_output:
type: postgres
from: my_transform
schema: public
table: my_data
secret_name: MY_POSTGRES_SECRET
primary_key: idsinks:
existing_sink:
type: blackhole
from: my_transform
# 添加新接收器
postgres_output:
type: postgres
from: my_transform
schema: public
table: my_data
secret_name: MY_POSTGRES_SECRET
primary_key: idresource_size: m # was: sresource_size: m # 之前是:ssources:
eth_transfers:
type: dataset
dataset_name: ethereum.erc20_transfers
version: 1.0.0
start_at: latest
# Add new source
base_transfers:
type: dataset
dataset_name: base.erc20_transfers
version: 1.2.0
start_at: latestsources:
eth_transfers:
type: dataset
dataset_name: ethereum.erc20_transfers
version: 1.0.0
start_at: latest
# 添加新数据源
base_transfers:
type: dataset
dataset_name: base.erc20_transfers
version: 1.2.0
start_at: latestsources:
transfers_v2: # Changed from 'transfers'
type: dataset
dataset_name: base.erc20_transfers
version: 1.2.0
start_at: earliest # Will process from beginningname: my-pipeline-v2 # Changed from 'my-pipeline'sources:
transfers_v2: # 从'transfers'修改而来
type: dataset
dataset_name: base.erc20_transfers
version: 1.2.0
start_at: earliest # 将从最开始处理name: my-pipeline-v2 # 从'my-pipeline'修改而来references/troubleshooting.md/turbo-monitor-debugreferences/troubleshooting.md/turbo-monitor-debug/turbo-builder/turbo-doctor/datasets/turbo-builder/turbo-doctor/datasets