Skip to content

Commit 35265e2

Browse files
authored
Toggle utilizing signed API URLs from AirseekerRegistry (#452)
* Toggle utilizing signed API URLs from AirseekerRegistry * Standardize capitalization of "Signed API" throughout the docs and code * Update introduction
1 parent ce613dd commit 35265e2

File tree

15 files changed

+124
-30
lines changed

15 files changed

+124
-30
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# airseeker-v2
22

3-
> A service powering data feeds using the [signed API](https://github.com/api3dao/signed-api).
3+
> A service powering data feeds using the [Signed API](https://github.com/api3dao/signed-api).
44
5-
The Airseeker is a rework of the [original Airseeker](https://github.com/api3dao/airseeker). The Airseeker v2 is
6-
simplified and only works with signed APIs.
5+
Airseeker v2 is a streamlined redesign of the [original Airseeker](https://github.com/api3dao/airseeker-v1), focused
6+
exclusively on working with Signed APIs for improved efficiency and simplicity.
77

88
## Getting started
99

airseeker_v2_pipeline.drawio

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<mxCell id="ci7EG28U3f9VGxeywyoC-39" value="for each&lt;br&gt;in parallel" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-34" target="ci7EG28U3f9VGxeywyoC-38" edge="1">
2020
<mxGeometry relative="1" as="geometry"/>
2121
</mxCell>
22-
<mxCell id="ci7EG28U3f9VGxeywyoC-34" value="Get all active Airnode addresses and their respective signed API URLs." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
22+
<mxCell id="ci7EG28U3f9VGxeywyoC-34" value="Get all active Airnode addresses and their respective Signed API URLs." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
2323
<mxGeometry x="480" y="800" width="240" height="80" as="geometry"/>
2424
</mxCell>
2525
<mxCell id="ci7EG28U3f9VGxeywyoC-35" value="State" style="ellipse;whiteSpace=wrap;html=1;rounded=1;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
@@ -28,7 +28,7 @@
2828
<mxCell id="ci7EG28U3f9VGxeywyoC-41" value="for all&lt;br&gt;responses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-38" target="ci7EG28U3f9VGxeywyoC-40" edge="1">
2929
<mxGeometry relative="1" as="geometry"/>
3030
</mxCell>
31-
<mxCell id="ci7EG28U3f9VGxeywyoC-38" value="Call signed API URLs in parallel." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
31+
<mxCell id="ci7EG28U3f9VGxeywyoC-38" value="Call Signed API URLs in parallel." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
3232
<mxGeometry x="880" y="800" width="240" height="80" as="geometry"/>
3333
</mxCell>
3434
<mxCell id="ci7EG28U3f9VGxeywyoC-47" value="for all valid&lt;br&gt;responses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-40" target="ci7EG28U3f9VGxeywyoC-44" edge="1">
@@ -96,13 +96,13 @@
9696
<mxCell id="ci7EG28U3f9VGxeywyoC-59" value="Chain" style="rhombus;whiteSpace=wrap;html=1;rounded=1;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
9797
<mxGeometry x="1360" y="1639" width="80" height="80" as="geometry"/>
9898
</mxCell>
99-
<mxCell id="ci7EG28U3f9VGxeywyoC-61" value="Call signed API URLs in parallel." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
99+
<mxCell id="ci7EG28U3f9VGxeywyoC-61" value="Call Signed API URLs in parallel." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
100100
<mxGeometry x="890" y="810" width="240" height="80" as="geometry"/>
101101
</mxCell>
102-
<mxCell id="ci7EG28U3f9VGxeywyoC-62" value="Call signed API URL." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
102+
<mxCell id="ci7EG28U3f9VGxeywyoC-62" value="Call Signed API URL." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
103103
<mxGeometry x="900" y="820" width="240" height="80" as="geometry"/>
104104
</mxCell>
105-
<mxCell id="ci7EG28U3f9VGxeywyoC-69" value="Persist the Airnode addresses, template IDs, signed API URLs and on-chain values for these data feeds." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
105+
<mxCell id="ci7EG28U3f9VGxeywyoC-69" value="Persist the Airnode addresses, template IDs, Signed API URLs and on-chain values for these data feeds." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
106106
<mxGeometry x="1680" y="1479" width="240" height="80" as="geometry"/>
107107
</mxCell>
108108
<mxCell id="ci7EG28U3f9VGxeywyoC-74" value="write to" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-69" target="ci7EG28U3f9VGxeywyoC-75" edge="1">
@@ -121,7 +121,7 @@
121121
<mxCell id="ci7EG28U3f9VGxeywyoC-78" value="" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
122122
<mxGeometry x="1290" y="1490" width="240" height="80" as="geometry"/>
123123
</mxCell>
124-
<mxCell id="ci7EG28U3f9VGxeywyoC-79" value="Fetch the rest of the active data feed batches together with Airnode address, template ID(s), signed API URLs and on-chain values." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
124+
<mxCell id="ci7EG28U3f9VGxeywyoC-79" value="Fetch the rest of the active data feed batches together with Airnode address, template ID(s), Signed API URLs and on-chain values." style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;align=center;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
125125
<mxGeometry x="1300" y="1499" width="240" height="80" as="geometry"/>
126126
</mxCell>
127127
<mxCell id="ci7EG28U3f9VGxeywyoC-89" value="if there is any data feed&lt;br&gt;to be updated" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ci7EG28U3f9VGxeywyoC-86" target="ci7EG28U3f9VGxeywyoC-88" edge="1">

airseeker_v2_pipeline.drawio.svg

Lines changed: 1 addition & 1 deletion
Loading

config/airseeker.example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"individualBeaconUpdateSettings": null,
3030
"signedDataFetchInterval": 10,
3131
"signedApiUrls": [],
32+
"useSignedApiUrlsFromContract": true,
3233
"walletDerivationScheme": { "type": "managed" },
3334
"stage": "dev",
3435
"version": "3.11.0"

config/configuration.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,23 @@ only rely on the RPC provider for gas limit estimation and will skip an update i
255255

256256
### `signedDataFetchInterval`
257257

258-
The fetch interval in seconds between retrievals of signed API data.
258+
The fetch interval in seconds between retrievals of Signed API data.
259259

260260
### `signedApiUrls`
261261

262-
A list of signed API URLs to call along with URLs fetched from the chain.
262+
A list of Signed API URLs to call along with URLs fetched from the chain.
263+
264+
### `useSignedApiUrlsFromContract` _(optional)_
265+
266+
A boolean flag that determines whether to use Signed API URLs from the AirseekerRegistry contract. When set to `true`,
267+
Airseeker will use both the URLs from the configuration and from the contract. When set to `false`, only the URLs from
268+
the configuration will be used.
269+
270+
```jsonc
271+
"useSignedApiUrlsFromContract": true,
272+
```
273+
274+
Defaults to `true`.
263275

264276
### `walletDerivationScheme`
265277

local-test-configuration/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ is the setup:
55

66
- Use 2 Airnode feeds with Nodary API and reasonable fetch limits. Each Airnode feed has a different Airnode mnemonic to
77
mimic a different API. One of the APIs is delayed so that the beacons have different values.
8-
- Use 2 signed APIs and each Airnode feed pushes to a separate Signed API.
8+
- Use 2 Signed APIs and each Airnode feed pushes to a separate Signed API.
99
- We run Airseeker only on Hardhat network for setup simplicity. Initially, I wanted to have a Polygon testnet as well,
1010
but gave up on that idea for now. The setup can be easily extended to run on any chain, just by not starting Hardhat
1111
network and using a different RPCs.
@@ -72,7 +72,7 @@ also required for the monitoring page.
7272
The `AIRSEEKER_MNEMONIC` needs to be URI encoded via `encodeURIComponent` in JS. For example,
7373
`test%20test%20test%20test%20test%20test%20test%20test%20test%20test%20test%20junk`.
7474

75-
The page constantly polls the chain and respective signed APIs and compares the on-chain and off-chain values. If the
75+
The page constantly polls the chain and respective Signed APIs and compares the on-chain and off-chain values. If the
7676
deviation exceeds the treshold, the value is marked bold and should be updated by Airseeker shortly.
7777

7878
- Run the Airseeker:

local-test-configuration/airseeker/airseeker.example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"signedDataFetchInterval": 10,
3434
"signedApiUrls": [],
35+
"useSignedApiUrlsFromContract": true,
3536
"walletDerivationScheme": { "type": "managed" },
3637
"stage": "dev",
3738
"version": "3.1.0"

local-test-configuration/monitoring/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010
<h1>Airseeker monitoring</h1>
1111
<p>
12-
Uses a fixed (static) configuration to fetch on-chain values of active data feeds and signed API data and computes
12+
Uses a fixed (static) configuration to fetch on-chain values of active data feeds and Signed API data and computes
1313
the deviation treshold.
1414
</p>
1515

local-test-configuration/scripts/initialize-chain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ export const deploy = async (funderWallet: ethers.NonceManager, provider: ethers
212212

213213
// Set active dAPIs
214214
const apiTreeValues = [
215-
[airnodeFeed1Wallet.address, joinUrl(airnodeFeed1.signedApis[0].url, 'default')], // NOTE: Airnode feed pushes to the "/" of the signed API, but we need to query it additional path.
216-
[airnodeFeed2Wallet.address, joinUrl(airnodeFeed2.signedApis[0].url, 'default')], // NOTE: Airnode feed pushes to the "/" of the signed API, but we need to query it additional path.
215+
[airnodeFeed1Wallet.address, joinUrl(airnodeFeed1.signedApis[0].url, 'default')], // NOTE: Airnode feed pushes to the "/" of the Signed API, but we need to query it additional path.
216+
[airnodeFeed2Wallet.address, joinUrl(airnodeFeed2.signedApis[0].url, 'default')], // NOTE: Airnode feed pushes to the "/" of the Signed API, but we need to query it additional path.
217217
] as const;
218218
for (const [airnode, url] of apiTreeValues) {
219219
const setSignedApiUrlTx = await airseekerRegistry.connect(deployerAndManager).setSignedApiUrl(airnode, url);

src/config/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export const configSchema = z
195195
stage: z
196196
.string()
197197
.regex(/^[\da-z-]{1,256}$/, 'Only lowercase letters, numbers and hyphens are allowed (max 256 characters)'),
198+
useSignedApiUrlsFromContract: z.boolean().default(true),
198199
version: z.string().refine((version) => version === packageVersion, 'Invalid Airseeker version'),
199200
walletDerivationScheme: walletDerivationSchemeSchema,
200201
})

0 commit comments

Comments
 (0)