Skip to content

Commit b6a50f0

Browse files
khadnidwightjl
andauthored
Apply editorial improvements from code review
Co-authored-by: Dwight Lyle <[email protected]>
1 parent 6c5c4bd commit b6a50f0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/content/data-streams/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ One example of how to use Data Streams is in a decentralized exchange. An exampl
6868
1. A user initiates a trade by confirming an `initiateTrade` transaction in their wallet.
6969
1. The onchain contract for the decentralized exchange responds by emitting a Log Trigger event.
7070
1. The Chainlink Automation upkeep monitors the contract for the event. When Automation detects the event, it runs the `checkLog` function specified in the upkeep contract. The upkeep is defined by the decentralized exchange.
71-
1. The `checkLog` function uses a `revert` with a custom error called `StreamsLookup`. This approach, aligning with [EIP-3668](https://eips.ethereum.org/EIPS/eip-3668#use-of-revert-to-convey-call-information), conveys necessary information through the data in the `revert` custom error.
71+
1. The `checkLog` function uses a `revert` with a custom error called `StreamsLookup`. This approach aligns with [EIP-3668](https://eips.ethereum.org/EIPS/eip-3668#use-of-revert-to-convey-call-information) and conveys the required information through the data in the `revert` custom error.
7272
1. Chainlink Automation monitors the `StreamsLookup` custom error that triggers Chainlink Data Streams to process the offchain data request. Chainlink Data Streams then returns the requested signed report in the `checkCallback` function for Chainlink Automation.
7373
1. Chainlink Automation passes the report to the Automation Registry, which executes the `performUpkeep` function defined by the decentralized exchange. The report is included as a variable in the `performUpkeep` function.
7474
1. The `performUpkeep` function calls the `verify` function on the Data Streams onchain verifier contract and passes the report as a variable.

src/content/data-streams/reference/interfaces.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: "Interfaces"
66

77
import { Aside, CodeSample } from "@components"
88

9-
<Aside type="note" title="MAINNET EARLY ACCESS">
9+
<Aside type="note" title="Mainnet Early Access">
1010
Chainlink Data Streams is available on Arbitrum Sepolia and in Early Access on Arbitrum Mainnet.{" "}
1111
<a href="https://chainlinkcommunity.typeform.com/datastreams?#ref_id=docs">Contact us</a> to talk to an expert about
1212
integrating Chainlink Data Streams with your applications.

src/content/data-streams/release-notes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ whatsnext:
1212

1313
import { Aside } from "@components"
1414

15-
<Aside type="note" title="MAINNET EARLY ACCESS">
15+
<Aside type="note" title="Mainnet Early Access">
1616
Chainlink Data Streams is available on Arbitrum Sepolia and in Early Access on Arbitrum Mainnet.{" "}
1717
<a href="https://chainlinkcommunity.typeform.com/datastreams?#ref_id=docs">Contact us</a> to talk to an expert about
1818
integrating Chainlink Data Streams with your applications.

src/features/data-streams/common/gettingStarted.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Aside, CodeSample, CopyText, ClickToZoom } from "@components"
22

3-
This guide shows you how to read data from a Data Stream and validate and store the answer onchain. This example uses a [Chainlink Automation Log Trigger](/chainlink-automation/guides/log-trigger) to check for events that require data. For this example, the log trigger comes from a simple emitter contract. Chainlink Automation then uses `StreamsLookup` to retrieve a signed report from the Data Streams Engine, return the data in a callback, and run the [`performUpkeep` function](/chainlink-automation/reference/automation-interfaces#performupkeep-function-for-log-triggers) on your registered upkeep contract. The `performUpkeep` function calls the `verify` function on the verifier contract.
3+
This guide shows you how to read data from a Data Stream, validate the answer, and store the answer onchain. This example uses a [Chainlink Automation Log Trigger](/chainlink-automation/guides/log-trigger) to check for events that require data. For this example, the log trigger comes from a simple emitter contract. Chainlink Automation then uses `StreamsLookup` to retrieve a signed report from the Data Streams Engine, return the data in a callback, and run the [`performUpkeep` function](/chainlink-automation/reference/automation-interfaces#performupkeep-function-for-log-triggers) on your registered upkeep contract. The `performUpkeep` function calls the `verify` function on the verifier contract.
44

55
<Aside type="caution" title="Disclaimer">
66
This guide represents an example of using a Chainlink product or service and is provided to help you understand how to
@@ -79,7 +79,7 @@ Deploy an upkeep contract that is enabled to retrieve data from Data Streams. Fo
7979

8080
## Deploy the emitter contract
8181

82-
This contract emits logs that trigger the upkeep. This code can be part of your dApp. For example, you might emit log triggers when your users initiate a trade or other action requiring data retrieval. For this Getting Started guide, we will use a very simple emitter so you can test the upkeep and data retrieval.
82+
This contract emits logs that trigger the upkeep. This code can be part of your dApp. For example, you might emit log triggers when your users initiate a trade or other action requiring data retrieval. For this Getting Started guide, use a very simple emitter so you can test the upkeep and data retrieval.
8383

8484
1. [Open the LogEmitter.sol](https://remix.ethereum.org/#url=https://docs.chain.link/samples/DataStreams/LogEmitter.sol) contract in Remix.
8585

@@ -95,7 +95,7 @@ This contract emits logs that trigger the upkeep. This code can be part of your
9595

9696
1. Open MetaMask and make sure the network is still set to _Arbitrum Sepolia_.
9797

98-
1. In Remix, under the **Deploy & Run Transactions** tab, ensure the **Environment** is still set to _Injected Provider - MetaMask_.
98+
1. On the **Deploy & Run Transactions** tab in Remix, ensure the **Environment** is still set to _Injected Provider - MetaMask_.
9999

100100
<ClickToZoom
101101
src="/images/data-streams/getting-started/injected-provider.webp"
@@ -175,15 +175,15 @@ Now, you can use your emitter contract to emit a log and initiate the upkeep, wh
175175

176176
1. Click the `emitLog` button to call the function and emit a log. MetaMask prompts you to accept the transaction.
177177

178-
After the transaction is complete, the log is emitted, and the upkeep is triggered. You can find the upkeep transaction hash at [Chainlink Automation UI](https://automation.chain.link/arbitrum-sepolia). Check to make sure the transaction is successful.
178+
After the transaction is complete, the log is emitted, and the upkeep is triggered. You can find the upkeep transaction hash in the [Chainlink Automation UI](https://automation.chain.link/arbitrum-sepolia). Check to make sure the transaction is successful.
179179

180180
<ClickToZoom src="/images/data-streams/getting-started/request-fulfilled.webp" />
181181

182182
## View the retrieved price
183183

184184
The retrieved price is stored as a variable in the contract and emitted in the logs.
185185

186-
1. In Remix, under the **Deploy & Run Transactions** tab, expand your upkeep contract in the **Deployed Contracts** section.
186+
1. On the **Deploy & Run Transactions** tab in Remix, expand the details of your upkeep contract in the **Deployed Contracts** section.
187187

188188
1. Click the `last_retrieved_price` getter function to view the retrieved price. The answer on the ETH/USD feed uses 18 decimal places, so an answer of `248412100000000000` indicates an ETH/USD price of 2484.121. Each feed uses a different number of decimal places for answers. See the [Stream IDs](/data-streams/stream-ids) page for more information.
189189

@@ -193,12 +193,12 @@ The retrieved price is stored as a variable in the contract and emitted in the l
193193
style="max-width: 70%;"
194194
/>
195195

196-
Alternatively, you can view the price emitted in the logs for your upkeep transaction. You can find the upkeep transaction hash at [Chainlink Automation UI](https://automation.chain.link/arbitrum-sepolia) and view the logs in the [Arbitrum Sepolia explorer](https://sepolia.arbiscan.io/).
196+
Alternatively, you can view the price emitted in the logs for your upkeep transaction. You can find the upkeep transaction hash at [Chainlink Automation UI](https://automation.chain.link/arbitrum-sepolia) and view the transaction logs in the [Arbitrum Sepolia explorer](https://sepolia.arbiscan.io/).
197197

198198
## Examine the code
199199

200200
The example code you deployed has all the interfaces and functions required to work with Chainlink Automation as an upkeep contract. It follows a similar flow to the trading flow in the [Architecture](/data-streams#example-trading-flow) documentation but uses a basic log emitter to simulate the client contract that would initiate a `StreamsLookup`. After the contract receives and verifies the report, `performUpkeep` stores the price from the report in the `last_retrieved_price` and emits a `PriceUpdate` log message with the price. You could modify this to use the data in a way that works for your specific use case and application.
201201

202-
The code example uses `revert` with `StreamsLookup` to convey call information about what streams to retrieve. See the [eip-3668 rationale](https://eips.ethereum.org/EIPS/eip-3668#rationale) for more information on `revert` use in this way.
202+
The code example uses `revert` with `StreamsLookup` to convey call information about what streams to retrieve. See the [EIP-3668 rationale](https://eips.ethereum.org/EIPS/eip-3668#rationale) for more information about how to use `revert` in this way.
203203

204204
<CodeSample src="samples/DataStreams/StreamsUpkeep.sol" />

0 commit comments

Comments
 (0)