-
Notifications
You must be signed in to change notification settings - Fork 7
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
Can't inject my fireblocks keys on the fly to hardhat config #7
Comments
Hi @yagozz , we're looking into options on supporting this..will get back to you. However, have you already tried using env vars - eg. you could setup a script to fetch the secrets from your KMS asynchronously and assign those as env vars for |
Hello @dsahni, I tried several ways of running an async script / function and fetch the keys and inject them into hardhat config which didn't work, but didn't try to fill them into .env file and read from there. I will try that tomorrow and let you know. |
hi again @dsahni sorry for the delayed message. On Friday I tried to fetch keys and set them to env variables using an async function, but the result is the same. Whenever I run a script using |
@yagozz you can write a script in bash, or in javascript/typescript (run by node.js), that fetches the secrets and sets them as environment variables, then executes the hardhat script ( That way the secrets are kept in memory and never saved to disk. |
hi @orenyomtov, thanks for the tip, will give it a shot and let you know |
Hi again @orenyomtov, sorry for the delay I wanted to hold on until we sort out issues I had with TAP. Your suggestion does the trick, and I believe we can use it, thanks for the help! However it comes with its own down sides. One example is I can't run This latest issue with compiling is not a huge deal and I'm looking for a solution on this thing, but it would be great to have the functionality to set async functions to fireblocks field in hardhat config that would fetch keys as the main solution |
Just found the issue and fixed it, fyi. |
Hello, I'm trying to set my
apiKey
andprivateKey
to hardhat config after I fetch them from a key management system on the fly (after I run some commands withnpx hardhat run <script_path>
). The problem is, I can't do await calls in the hardhat config script before module.exports statement. Hence, I can't fetch my keys and make the process wait until that happens. I tried several workarounds like immediately invoked function expressions, but even if I can run a logic to fetch keys asynchronously, config is exported way before fetch process ends hence I can't set these fields properly.Maybe I'm missing a trick that I can handle this with node.js, but I thought this can be achieved if you can let
apiKey
andprivateKey
fields to be assigned async functions that return string values for these fields, so that I can assign async functions to these fields which will fetch the keys and return those to config fields. If this sounds weird and you know another way of doing this, I appreciate any suggestion!The text was updated successfully, but these errors were encountered: