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

converting helius-fed database to new foundation schema #505

Merged
merged 2 commits into from
May 3, 2023

Conversation

jeffgrunewald
Copy link
Contributor

the new database being fed from the solana chain stores the helium crypto public key address of the hotspots as a binary buffer of the b58 decoded address string, as well as splitting the hotspot metadata info between the iot_hotspot_infos table where the metadata is stored and the key_to_assets table where the encoded pubkey address is stored. this change enables querying the new schema structure by the iot_config server (mobile_config server pending) without changing the RPC API the rest of the oracles use to lookup or stream hotspot on-chain metadata

@@ -143,13 +144,16 @@ pub(crate) mod db {
db: impl PgExecutor<'_>,
address: &PublicKeyBinary,
) -> anyhow::Result<Option<IotMetadata>> {
let entity_key = bs58::decode(address.to_string()).into_vec()?;
Copy link
Contributor

@andymck andymck May 3, 2023

Choose a reason for hiding this comment

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

are you sure this gives you what you need ? seems odd to use a public key in a format not directly supported by crypto-rs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’d like to go through it with folks today but I’ve tested this locally with a dump of data and this is unfortunately what we need ☹️

Copy link
Contributor

@andymck andymck left a comment

Choose a reason for hiding this comment

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

looks ok to me but i havent seen the schema so making some assumptions here

@bbalser bbalser merged commit 9f23ac4 into main May 3, 2023
@bbalser bbalser deleted the jg/new-chain-metadata-schema branch May 3, 2023 18:36
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.

3 participants