Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch data from signed APIs #29

Merged
merged 33 commits into from
Oct 19, 2023
Merged

Conversation

aquarat
Copy link
Collaborator

@aquarat aquarat commented Oct 11, 2023

This PR adds code that:

  • Fetches signed data from a set of signed data API URLs
  • Checks the timestamp and signature on each received data sample
  • If valid adds the data to a datastore
  • Datastore pruning added
  • Adds a basic state (cloneDeep a good idea? may impact performance? hopefully not duplicated?)

It was decided in a meeting that the API calls be done all at once/not staggered for simplicity.

I could probably move the current initialisation boilerplate into a main file/function.

Note to self:

  • Also check airnode address of received data matches configured airnode address/filter out data that won't be used before storing

Closes #23
Closes #6
Closes #19

Screenshot 2023-10-12 at 11 25 09

@aquarat aquarat changed the title [WIP] Fetch data from signed APIs Fetch data from signed APIs Oct 11, 2023
@aquarat aquarat self-assigned this Oct 11, 2023
@aquarat aquarat marked this pull request as ready for review October 11, 2023 14:37
Copy link
Contributor

@vponline vponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking greatly simplified 😄, so no more batching, right?

src/signed-data-store/signed-data-store.ts Outdated Show resolved Hide resolved
src/signed-api-fetch/data-fetcher.ts Outdated Show resolved Hide resolved
src/state/state.ts Outdated Show resolved Hide resolved
src/signed-data-store/signed-data-store.ts Outdated Show resolved Hide resolved
src/signed-api-fetch/data-fetcher.ts Outdated Show resolved Hide resolved
@vponline
Copy link
Contributor

I think this is also closes #19

@vponline vponline linked an issue Oct 16, 2023 that may be closed by this pull request
@aquarat
Copy link
Collaborator Author

aquarat commented Oct 16, 2023

I think this is also closes #19

Indeed 😆
and thanks for the review ❤️

package.json Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/signed-api-fetch/data-fetcher.test.ts Outdated Show resolved Hide resolved
src/signed-api-fetch/data-fetcher.test.ts Outdated Show resolved Hide resolved
src/signed-api-fetch/data-fetcher.test.ts Outdated Show resolved Hide resolved
src/signed-data-store/signed-data-store.ts Outdated Show resolved Hide resolved
src/signed-data-store/signed-data-store.ts Outdated Show resolved Hide resolved
src/state/state.ts Outdated Show resolved Hide resolved
src/types.ts Outdated Show resolved Hide resolved
src/utils/evm.ts Outdated Show resolved Hide resolved
@aquarat aquarat requested a review from Siegrift October 17, 2023 13:59
.gitignore Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/config/schema.ts Outdated Show resolved Hide resolved
src/signed-data-store/signed-data-store.ts Outdated Show resolved Hide resolved
src/signed-data-store/signed-data-store.ts Outdated Show resolved Hide resolved
src/utils/evm.ts Outdated Show resolved Hide resolved
src/utils/evm.ts Outdated Show resolved Hide resolved
src/utils/evm.ts Outdated Show resolved Hide resolved
test/fixtures/mock-config.ts Outdated Show resolved Hide resolved
test/fixtures/mock-config.ts Outdated Show resolved Hide resolved
@aquarat aquarat requested a review from Siegrift October 18, 2023 16:08
@aquarat
Copy link
Collaborator Author

aquarat commented Oct 18, 2023

One more time @Siegrift 😆

Copy link
Collaborator

@Siegrift Siegrift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@aquarat aquarat merged commit 16080ef into main Oct 19, 2023
3 checks passed
@aquarat aquarat deleted the 6-fetch-data-from-signed-api-all-at-once branch October 19, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signed data checking Implement AirseekerV2's internal state Fetch data from signed API
3 participants