Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "create", Short: "Create a new account", Run: func(cmd *cobra.Command, args []string) { projectConf := cli.LoadConfig() signerAccount := projectConf.Accounts[conf.Signer] accountKeys := make([]*flow.AccountKey, len(conf.Keys)) sigAlgo := crypto.StringToSignatureAlgorithm(conf.SigAlgo) if sigAlgo == crypto.UnknownSignatureAlgorithm { cli.Exitf(1, "Failed to determine signature algorithm from %s", conf.SigAlgo) } hashAlgo := crypto.StringToHashAlgorithm(conf.HashAlgo) if hashAlgo == crypto.UnknownHashAlgorithm { cli.Exitf(1, "Failed to determine hash algorithm from %s", conf.HashAlgo) } for i, publicKeyHex := range conf.Keys { publicKey := cli.MustDecodePublicKeyHex(cli.DefaultSigAlgo, publicKeyHex) accountKeys[i] = &flow.AccountKey{ PublicKey: publicKey, SigAlgo: sigAlgo, HashAlgo: hashAlgo, Weight: flow.AccountKeyWeightThreshold, } } tx := templates.CreateAccount(accountKeys, nil, signerAccount.Address) cli.SendTransaction(projectConf.HostWithOverride(conf.Host), signerAccount, tx, conf.Results) }, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Signer string `default:"service" flag:"signer,s"`
Keys []string `flag:"key,k" info:"public keys to attach to account"`
SigAlgo string `default:"ECDSA_P256" flag:"sig-algo" info:"signature algorithm used to generate the keys"`
HashAlgo string `default:"SHA3_256" flag:"hash-algo" info:"hash used for the digest"`
Host string `flag:"host" info:"Flow Access API host address"`
Results bool `default:"false" flag:"results" info:"whether or not to wait for the results of the transaction"`
}
Click to show internal directories.
Click to hide internal directories.