Skip to content

Commit 9ab40d5

Browse files
committed
more cleanup
1 parent 7ed611f commit 9ab40d5

11 files changed

Lines changed: 312 additions & 243 deletions

src/content/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ metadata:
1111

1212
import { Aside } from "@components"
1313

14-
This guide shows how to manually generate a **CRE report** containing a single value (like `uint256`, `address`, or `bool`). A CRE report is a DON-signed package from `runtime.GenerateReport()` / `runtime.report()`: your encoded data plus workflow metadata and signatures.
14+
This guide shows how to manually generate a **[CRE report](/cre/key-terms#report-cre-report)** containing a single value (like `uint256`, `address`, or `bool`). See [Key Terms: Report](/cre/key-terms#report-cre-report) for the full definition; in short, it is a DON-signed package from [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values) / [`runtime.report()`](/cre/reference/sdk/core-ts#runtime-and-noderuntime) with your encoded data, workflow metadata, and signatures.
1515

16-
This guide covers **creating** the signed report (`GenerateReport()` / `runtime.report()`). **Delivering** it is a separate step: see the table below.
16+
This guide covers **creating** the signed report ([`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values) / [`runtime.report()`](/cre/reference/sdk/core-ts#runtime-and-noderuntime)). **Delivering** it is a separate step: see the table below.
1717

1818
**Use this approach when:**
1919

@@ -31,12 +31,12 @@ This guide covers **creating** the signed report (`GenerateReport()` / `runtime.
3131
Manually generating a report for a single value involves two main steps:
3232

3333
1. **ABI-encode the value** into bytes using the `go-ethereum/accounts/abi` package
34-
1. **Generate a cryptographically signed report** using `runtime.GenerateReport()`
34+
1. **Generate a cryptographically signed report** using [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values)
3535

36-
| After `GenerateReport()` / `report()` | Guide | Who verifies? |
37-
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
38-
| `evm.Client.WriteReport()` / `writeReport()` | [Submitting Reports Onchain](/cre/guides/workflow/using-evm-client/onchain-write/submitting-reports-onchain) | `KeystoneForwarder` onchain |
39-
| `http.Client` `SendReport()` | [Submitting Reports via HTTP](/cre/guides/workflow/using-http-client/submitting-reports-http) | Receiver: [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain) or your API |
36+
| After [`GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values) / [`report()`](/cre/reference/sdk/core-ts#runtime-and-noderuntime) | Guide | Who verifies? |
37+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
38+
| [`WriteReport()`](/cre/reference/sdk/evm-client-go#writereport) / [`writeReport()`](/cre/reference/sdk/evm-client-ts#writereport) | [Submitting Reports Onchain](/cre/guides/workflow/using-evm-client/onchain-write/submitting-reports-onchain) | `KeystoneForwarder` onchain |
39+
| [`SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport) / [`sendReport()`](/cre/reference/sdk/http-client-ts#using-sendreport) | [Submitting Reports via HTTP](/cre/guides/workflow/using-http-client/submitting-reports-http) | Receiver: [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain) or your API |
4040

4141
See [API Interactions: CRE reports over HTTP](/cre/guides/workflow/using-http-client#cre-reports-over-http) for the sender → receiver mental model.
4242

src/content/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-structs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111

1212
import { Aside } from "@components"
1313

14-
This guide shows how to generate a **CRE report** containing a struct with multiple fields. A CRE report is a DON-signed package from `runtime.GenerateReport()`. After generation, deliver it [onchain](/cre/guides/workflow/using-evm-client/onchain-write/submitting-reports-onchain) or via [HTTP](/cre/guides/workflow/using-http-client/submitting-reports-http); HTTP receivers should [verify offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain). See [API Interactions: CRE reports over HTTP](/cre/guides/workflow/using-http-client#cre-reports-over-http).
14+
This guide shows how to generate a **[CRE report](/cre/key-terms#report-cre-report)** containing a struct with multiple fields. See [Key Terms: Report](/cre/key-terms#report-cre-report) for the full definition. After generation, deliver it [onchain](/cre/guides/workflow/using-evm-client/onchain-write/submitting-reports-onchain) or via [HTTP](/cre/guides/workflow/using-http-client/submitting-reports-http); HTTP receivers should [verify offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain). See [API Interactions: CRE reports over HTTP](/cre/guides/workflow/using-http-client#cre-reports-over-http).
1515

1616
There are two encoding approaches depending on whether you have generated bindings for your contract.
1717

src/content/cre/guides/workflow/using-http-client/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The CRE SDK provides an HTTP client that allows your workflows to interact with
3232

3333
## CRE reports over HTTP
3434

35-
A **CRE report** is a DON-signed package your workflow creates with `runtime.report()` (TypeScript) or `runtime.GenerateReport()` (Go). It contains your encoded payload, workflow metadata, and cryptographic signatures.
35+
A **[CRE report](/cre/key-terms#report-cre-report)** is a DON-signed package your workflow creates with [`runtime.report()`](/cre/reference/sdk/core-ts#runtime-and-noderuntime) (TypeScript) or [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values) (Go). It bundles your encoded payload, workflow metadata, report context, and cryptographic signatures from the DON. See [Key Terms: Report](/cre/key-terms#report-cre-report) for the full definition, including how onchain delivery differs from HTTP.
3636

3737
A typical secure integration uses two parties:
3838

src/content/cre/guides/workflow/using-http-client/submitting-reports-http-go.mdx

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This guide is for the **sender** side: a CRE workflow that **creates** a signed
1616

1717
**What you'll learn:**
1818

19-
- How to use `SendReport` to submit reports via HTTP
19+
- How to use [`SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport) to submit reports via HTTP
2020
- How to write transformation functions for different API formats
2121
- Best practices for report submission and deduplication
2222

@@ -25,27 +25,33 @@ This guide is for the **sender** side: a CRE workflow that **creates** a signed
2525
This guide covers HTTP submission. For submitting reports to smart contracts, see [Submitting Reports Onchain](/cre/guides/workflow/using-evm-client/onchain-write/submitting-reports-onchain).
2626
</Aside>
2727

28+
## What is a CRE report?
29+
30+
A **[CRE report](/cre/key-terms#report-cre-report)** is the signed output your workflow DON produces when you call [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values). It packages your encoded data (the payload you computed in the callback), fixed workflow metadata, a report context (config digest and sequence number), and ECDSA signatures from DON nodes.
31+
32+
This guide covers the **sender** path: create the report in your workflow, then POST it to an HTTP endpoint. The receiver must verify those signatures before trusting the data. See [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain-go) on the receiver side.
33+
2834
## Where this guide fits
2935

30-
| Question | Answer |
31-
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32-
| What is the report? | Output of `runtime.GenerateReport()` after your workflow DON reaches consensus: encoded payload + metadata + signatures. |
33-
| Where does it come from? | **Inside this workflow:** after your logic runs (fetch data, compute, encode). There is no separate "get report" step. |
34-
| What does this guide cover? | Steps 3–4 below: `GenerateReport()`, then `SendReport()` to your API. Steps 1–2 (trigger and your callback logic) are prerequisites, not the focus here. |
35-
| Who verifies it? | The **receiver:** your HTTP service or a separate CRE workflow. See [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain-go). |
36+
| Question | Answer |
37+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38+
| What is the report? | A [CRE report](/cre/key-terms#report-cre-report): output of [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values) after DON consensus (encoded payload + metadata + signatures). |
39+
| Where does it come from? | **Inside this workflow:** after your logic runs (fetch data, compute, encode). There is no separate "get report" step. |
40+
| What does this guide cover? | Steps 3–4 below: [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values), then [`SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport) to your API. Steps 1–2 (trigger and your callback logic) are prerequisites, not the focus here. |
41+
| Who verifies it? | The **receiver:** your HTTP service or a separate CRE workflow. See [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain-go). |
3642

3743
**Sender flow in one workflow execution:**
3844

3945
1. Trigger fires (cron, HTTP, …).
4046
2. Your callback runs (API calls, encoding, etc.).
41-
3. `runtime.GenerateReport()`: DON produces a signed `sdk.ReportResponse`.
42-
4. `SendReport()`: format and POST to your URL.
47+
3. [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values): DON produces a signed `sdk.ReportResponse`.
48+
4. [`SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport): format and POST to your URL.
4349

4450
## Prerequisites
4551

4652
- Familiarity with [making POST requests](/cre/guides/workflow/using-http-client/post-request)
4753
- Understanding of [generating reports](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values)
48-
- A generated report from `runtime.GenerateReport()`
54+
- A generated report from [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values)
4955

5056
{/* prettier-ignore */}
5157
<Aside type="caution" title="Redirects are not supported">
@@ -97,7 +103,7 @@ func submitReport(config *Config, logger *slog.Logger, sendRequester *http.SendR
97103
**What's happening here:**
98104

99105
1. `formatReportSimple` transforms the report into an HTTP request that your API understands
100-
1. `sendRequester.SendReport()` calls your transformation function and sends the request
106+
1. [`sendRequester.SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport) calls your transformation function and sends the request
101107
1. The SDK handles consensus and returns the result
102108

103109
The rest of this guide explains how this works and shows different formatting patterns for various API requirements.
@@ -106,7 +112,7 @@ The rest of this guide explains how this works and shows different formatting pa
106112

107113
### The report structure
108114

109-
When you call `runtime.GenerateReport()`, the SDK creates a `sdk.ReportResponse` containing:
115+
After [consensus](/cre/key-terms#consensus), [`runtime.GenerateReport()`](/cre/guides/workflow/using-evm-client/onchain-write/generating-reports-single-values) returns a `sdk.ReportResponse`: the wire-format view of a [CRE report](/cre/key-terms#report-cre-report). It contains:
110116

111117
```go
112118
type sdk.ReportResponse struct {
@@ -135,7 +141,7 @@ func(reportResponse *sdk.ReportResponse) (*http.Request, error)
135141

136142
**The SDK calls this function internally:**
137143

138-
1. You pass your transformation function to `SendReport`
144+
1. You pass your transformation function to [`SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport)
139145
1. The SDK calls it with the generated `sdk.ReportResponse`
140146
1. Your function returns an `http.Request` formatted for your API
141147
1. The SDK sends the request and handles consensus
@@ -380,7 +386,7 @@ This approach is reliable because the `RawReport` is identical across all nodes
380386

381387
## Using `SendReport` (recommended approach)
382388

383-
Use the high-level `http.SendRequest` pattern with `sendRequester.SendReport()`:
389+
Use the high-level `http.SendRequest` pattern with [`sendRequester.SendReport()`](/cre/reference/sdk/http-client-go#sendrequestersendreport):
384390

385391
```go
386392
func submitReportViaHTTP(config *Config, logger *slog.Logger, sendRequester *http.SendRequester) (*SubmitResponse, error) {
@@ -650,7 +656,7 @@ func onCronTrigger(config *Config, runtime cre.Runtime, trigger *cron.Payload) (
650656

651657
{/* prettier-ignore */}
652658
<Aside type="caution" title="Signature verification is your responsibility">
653-
Unlike onchain submissions (where the `KeystoneForwarder` contract verifies signatures), **HTTP submissions require you to verify signatures** before trusting the report data. Use `cre.ParseReport()` in a receiver workflow or implement equivalent checks in your API. See [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain-go).
659+
Unlike onchain submissions (where the `KeystoneForwarder` contract verifies signatures), **HTTP submissions require you to verify signatures** before trusting the report data. Use [`cre.ParseReport()`](/cre/reference/sdk/core-go#creparsereport) in a receiver workflow or implement equivalent checks in your API. See [Verifying CRE Reports Offchain](/cre/guides/workflow/using-http-client/verifying-reports-offchain-go).
654660
</Aside>
655661

656662
## Troubleshooting

0 commit comments

Comments
 (0)