-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: at startup, check to make sure provider seed phrase matches configured provider ID #444
feat: at startup, check to make sure provider seed phrase matches configured provider ID #444
Conversation
…figured provider ID
|
||
public async validateProviderSeedPhrase() { | ||
const { providerPublicKeyAddress, providerId } = this.configService; | ||
const resolvedProviderId = await this.publicKeyToMsaId(providerPublicKeyAddress || ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not error out with the ''
version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point--not sure what the chain state query does if you pass an empty string for the public key. Reworked to skip querying the chain entirely if there's no public key (ie, no seed phrase configured).
This behavior is intended for the upcoming "read-only" mode. Note that currently you MUST configure a seed phrase because it's required in the environment config; once that requirement is relaxed, this behavior will take effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question and a test would be nice, but it is a small piece of code that is quite clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements
account
,content-publishing
,content-watcher
to query the chain for the MSA ID associated with the public key derived from the configured seed phrase; throw an error if it does not match the configured Provider IDBlockchainService
ingraph-service
with the rest of the services' implementations (missed in previous PR)Closes #419