Difficulty creating signer
albydarned opened this issue · comments
Hello! I'm trying to sign transactions on the Polygon Mumbai Testnet. This is the error i'm getting
Steps I've taken:
- Uploaded wallet private key to Google Cloud KMS
- Configured
Goth
process namedGCPCredentials
and verified I get a valid response onGoth.fetch(GCPCredentials)
- Added the following config to the bottom of runtime.exs, replacing the necessary values from step 1
config :signet, :signer, [
{MySigner, {:cloud_kms, GCPCredentials, "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{keyid}" "1"}}]
It seems i'm missing something simple getting the genserver process started or someting. Please let me know of any other info I need to provide.
Can you add {:google_api_cloud_kms, "~> 0.38.1"},
to your mix.exs
. The CloudKMS module doesn't load unless you include this optional lib. We should not this in the docs.
Ah, thank you @hayesgm. That eliminated the error I had! I should've thought of searching for a package, the error makes sense now.
Do you have an example or some guidance on how to properly add a wallet private key from something like Metamask to GCloud KMS? I've created a Project, Keyring, and a key with:
- HSM protection level
- Asymmetric sign purpose
- Elliptic Curve secp245k1 key SHA256 Digest default algorithm
At this point, it looks like I need to make an upload job, format the key for import, then wrap the key using the provided wrapping key.
I really like how the library is designed and have enjoyed using it so far. When I get things done, I'll be happy to write a PR adding some setup instructions to the docs.
Thanks in advance!
Ok @hayesgm, I think I was able to get the key properly into GCP KMS... Happy to post my steps I've recorded once I validate them. Now, i'm running into a new error. It looks like its trying to pad something that doesn't need to be padded? The address it is signing with is correct which makes me think I have gotten the key uploaded properly. Any ideas?
@hayesgm Just wanted to bump this to see if you have any ideas as to why this is happening
Thanks for taking care of this. Sorry for the delay in processing, but that PR is merged now.