Adding Keys
Command
$ sagacli keys add --help
Derive a new private key and encrypt to disk.
Optionally specify a BIP39 mnemonic, a BIP39 passphrase to further secure the mnemonic,
and a bip32 HD path to derive a specific account. The key will be stored under the given name
and encrypted with the given password. The only input that is required is the encryption password.
If run with -i, it will prompt the user for BIP44 path, BIP39 mnemonic, and passphrase.
The flag --recover allows one to recover a key from a seed passphrase.
If run with --dry-run, a key would be generated (or recovered) but not stored to the
local keystore.
Use the --pubkey flag to add arbitrary public keys to the keystore for constructing
multisig transactions.
You can create and store a multisig key by passing the list of key names stored in a keyring
and the minimum number of signatures required through --multisig-threshold. The keys are
sorted by address, unless the flag --nosort is set.
Example:
keys add mymultisig --multisig "keyname1,keyname2,keyname3" --multisig-threshold 2
Usage:
sagacli keys add <name> [flags]
Flags:
--account uint32 Account number for HD derivation (less than equal 2147483647)
--coin-type uint32 coin type number for HD derivation (default 118)
--dry-run Perform action, but don't add key to local keystore
--hd-path string Manual HD Path derivation (overrides BIP44 config)
-h, --help help for add
--index uint32 Address index number for HD derivation (less than equal 2147483647)
-i, --interactive Interactively prompt user for BIP39 passphrase and mnemonic
--key-type string Key signing algorithm to generate keys for (default "secp256k1")
--ledger Store a local reference to a private key on a Ledger device
--multisig strings List of key names stored in keyring to construct a public legacy multisig key
--multisig-threshold int K out of N required signatures. For use in conjunction with --multisig (default 1)
--no-backup Don't print out seed phrase (if others are watching the terminal)
--nosort Keys passed to --multisig are taken in the order they're supplied
--pubkey string Parse a public key in JSON format and saves key info to <name> file.
--recover Provide seed phrase to recover existing key instead of creating
Global Flags:
--controller string controller grpc url (host:port) (default "https://controller.testnet-sp1.sagarpc.io")
--from string Name of private key used to sign (default "bogdan_local")
--keyring-backend string Select keyring's backend (os|file|test) (default "file")
-l, --loglevel string commands logging level (default "info")
--network-rpc string <host>:<port> to tendermint rpc interface for remote chain (default "https://spc.testnet-sp1.sagarpc.io")
-o, --output string output type <text|json> (default "text")
--platform-chain-id string The SPC network chain ID (default "spc-testnet-1")
Creating a New Key in sagacli
sagacliImport an Existing Key into sagacli
sagacliConfiguring a Default Key in sagacli
sagacliLast updated