You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/features/data-streams/common/gettingStarted.mdx
+15-21
Original file line number
Diff line number
Diff line change
@@ -26,22 +26,24 @@ Read data from a Data Stream and validate the answer on-chain. This example uses
26
26
27
27
## Deploy the Chainlink Automation upkeep
28
28
29
-
Deploy an upkeep that is enabled to retrieve data from Data Streams. For this example, you will read from the ETH/USD stream with ID `0x00023496426b520583ae20a66d80484e0fc18544866a5b0bfee15ec771963274` on Arbitrum Sepolia. For a complete list of available assets, IDs, and verifier proxy addresses, see the [Stream Identifiers](/data-streams/stream-ids) page.
29
+
Deploy an upkeep that is enabled to retrieve data from Data Streams. For this example, you will read from the ETH/USD stream with ID `0x00027bbaff688c906a3e20a34fe951715d1018d262a5b66e38eda027a674cd1b` on Arbitrum Sepolia. For a complete list of available assets, IDs, and verifier proxy addresses, see the [Stream Identifiers](/data-streams/stream-ids) page.
30
30
31
31
1. Select the Arbitrum Sepolia network in MetaMask.
@@ -87,34 +89,26 @@ Now you can use your emitter contract to emit a log and initiate the upkeep, whi
87
89
88
90
1. Go to [sepolia.arbiscan.io](https://sepolia.arbiscan.io/).
89
91
90
-
1. Use the search to find your emitter contract using the address you saved earlier.
91
-
92
-
1. Click the **Contract** tab to view the contract.
93
-
94
-
1. Click the **Write Contract** button to find the `emitLog` function.
92
+
1. Under the **Deployed Contracts** list, click the **emitLog** button to run the function and emit a log. MetaMask prompts you to accept the transaction.
95
93
96
-
1. Click **Connect to Web3** to connect your wallet to Arbiscan. This allows you to run write functions in Arbiscan. MetaMask will prompt you to accept the connection.
94
+
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.
97
95
98
-
1. Click the `emitLog` function to expand the function details.
96
+
## View the retrieved price
99
97
100
-
1. Click the **Write** button to execute the function that will emit the log. MetaMask prompts you to accept the transaction.
98
+
The retrieved price is stored as a variable in the contract and is also emitted in the logs.
101
99
102
-
After the transaction is complete, the log is emitted and the upkeep is triggered. You can see the retrieved data on your upkeep.
100
+
1. In Remix, go to the **Deploy & Run** tab.
103
101
104
-
## View the upkeep
102
+
1. Under the **Deployed Contracts**, find the deployed upkeep contract and view the variables.
105
103
106
-
View the upkeep and check the on-chain verification.
104
+
1. Click the `last_retrieved_price` variable to view the retrieved price.
107
105
108
-
1. Go to the [Chainlink Automation UI](https://automation.chain.link/arbitrum-sepolia) for Arbitrum Sepolia.
109
-
110
-
1. On your list of upkeeps, click the upkeep that you crated for this guide. The upkeep details open with a list of upkeeps that were performed. You should see your log triggered upkeep on this list.
111
-
112
-
1. Click the transaction hash for the upkeep to view the transaction in Arbiscan.
113
-
114
-
1. On the **Logs** tab for your transaction, you will see that the `performUpkeep` function emitted the price from the verified report.
106
+
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 explorer.
115
107
116
108
## Examine the code
117
109
118
110
The example code that you deployed has all of 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` 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.
119
111
112
+
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 the use of `revert` in this way.
0 commit comments