Auto-generated documentation.
Import a private key into the keyring / keystore.
polycli signer import [flags]It's possible to import a simple hex encoded private key into a local keystore or as a crypto key version in GCP KMS.
In order to import into a local keystore, a command like this could be used:
polycli signer import --keystore /tmp/keystore --private-key cf42d151cec45693f2ac1201e803b056c5f9e2e5d1af627ce41ab3b6faceda25Importing into GCP KMS is a little bit more complicated. In order to run the import, a command like this would be used:
polycli signer import --private-key 42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa --kms gcp --gcp-project-id prj-polygonlabs-devtools-dev --key-id jhilliard-code-quality --gcp-import-job-id test-import-jobThere are a few things going on here:
- We're specifying a
--private-keythat's hex encoded. That's the only format thatimportaccepts at this time. - We're using
--kms gcpwhich tell polycli that we want to use gcp kms as our backend - We've specified
--gcp-project-idwhich names a test project that we're using. We've left out--gcp-locationand--gcp-keyring-idwhich means we're using the defaults. - We've set
--gcp-import-job-id test-import-jobwhich names a job that will be used to import the key. Basically GCP will give us a public key that we use to encrypt our key for importing
The --key-id is also important. This will set the name of the key that's going to be imported. Note, the key-id must have already been created in order for import to work. When we're doing the import, we're actually importing a new version of the key that already exists. For the time being, the signer import command will not create the first version of the key for you.
-h, --help help for importThe command also inherits flags from parent commands.
--chain-id uint chain ID for transactions
--config string config file (default is $HOME/.polygon-cli.yaml)
--data-file string file name holding data to be signed
--gcp-import-job-id string GCP import job ID to use when importing key
--gcp-key-version int GCP crypto key version to use (default 1)
--gcp-keyring-id string GCP keyring ID to be used (default "polycli-keyring")
--gcp-location string GCP region to use (default "europe-west2")
--gcp-project-id string GCP project ID to use
--key-id string ID of key to be used for signing
--keystore string use keystore in given folder or file
--kms string AWS or GCP if key is stored in cloud
--pretty-logs output logs in pretty format instead of JSON (default true)
--private-key string use provided hex encoded private key
--type string type of signer to use: latest, cancun, london, eip2930, eip155 (default "london")
--unsafe-password string non-interactively specified password for unlocking keystore
-v, --verbosity string log level (string or int):
0 - silent
100 - panic
200 - fatal
300 - error
400 - warn
500 - info (default)
600 - debug
700 - trace (default "info")- polycli signer - Utilities for security signing transactions.