Documentation
¶
Overview ¶
Package cli defines constants, configurations, and utilities that are used across the Flow CLI.
Index ¶
- Constants
- Variables
- func ConfigExists() bool
- func EnvFromNetwork(network flow.ChainID) templates.Environment
- func ExecuteScript(host string, script []byte, arguments ...cadence.Value)
- func Exit(code int, msg string)
- func Exitf(code int, msg string, args ...interface{})
- func GcloudApplicationSignin(project string)
- func GetAccount(host string, address flow.Address) *flow.Account
- func GetAddressNetwork(address flow.Address) (flow.ChainID, error)
- func GetBlockByHeight(host string, height uint64) *flow.Block
- func GetBlockByID(host string, blockID flow.Identifier) *flow.Block
- func GetBlockEvents(host string, startHeight, endHeight uint64, eventType string, printEmpty bool)
- func GetCollectionByID(host string, collectionID flow.Identifier) *flow.Collection
- func GetLatestBlock(host string) *flow.Block
- func GetTransactionResult(host string, id string, sealed bool, showTransactionCode bool)
- func KeyContextFromKMSResourceID(resourceID string) (map[string]string, error)
- func MustDecodePrivateKeyHex(sigAlgo crypto.SignatureAlgorithm, prKeyHex string) crypto.PrivateKey
- func MustDecodePublicKeyHex(sigAlgo crypto.SignatureAlgorithm, pubKeyHex string) crypto.PublicKey
- func MustSaveConfig(conf *Config)
- func ParseArguments(input string) ([]cadence.Value, error)
- func PrintIndent(numberOfIndents int)
- func RandomSeed(n int) []byte
- func SaveConfig(conf *Config) error
- func SendTransaction(host string, signerAccount *Account, tx *flow.Transaction, withResults bool)
- type Account
- type CadenceArgument
- type Config
- type KeyType
Constants ¶
View Source
const ( EnvPrefix = "FLOW" DefaultSigAlgo = crypto.ECDSA_P256 DefaultHashAlgo = crypto.SHA3_256 DefaultHost = "127.0.0.1:3569" MaxGRPCMessageSize = 1024 * 1024 * 16 Indent = " " )
Variables ¶
View Source
var ConfigPath = []string{"flow.json"}
Functions ¶
func ConfigExists ¶
func ConfigExists() bool
func EnvFromNetwork ¶ added in v0.15.0
func EnvFromNetwork(network flow.ChainID) templates.Environment
func GcloudApplicationSignin ¶ added in v0.12.0
func GcloudApplicationSignin(project string)
GcloudApplicationSignin signs in as an application user using gcloud command line tool currently assumes gcloud is already installed on the machine will by default pop a browser window to sign in
func GetAddressNetwork ¶ added in v0.15.0
func GetBlockByID ¶
func GetBlockByID(host string, blockID flow.Identifier) *flow.Block
func GetBlockEvents ¶
func GetCollectionByID ¶
func GetCollectionByID(host string, collectionID flow.Identifier) *flow.Collection
func GetLatestBlock ¶
func GetTransactionResult ¶
func KeyContextFromKMSResourceID ¶ added in v0.12.0
func MustDecodePrivateKeyHex ¶
func MustDecodePrivateKeyHex(sigAlgo crypto.SignatureAlgorithm, prKeyHex string) crypto.PrivateKey
func MustDecodePublicKeyHex ¶
func MustDecodePublicKeyHex(sigAlgo crypto.SignatureAlgorithm, pubKeyHex string) crypto.PublicKey
func MustSaveConfig ¶
func MustSaveConfig(conf *Config)
func PrintIndent ¶ added in v0.15.0
func PrintIndent(numberOfIndents int)
func RandomSeed ¶
func SaveConfig ¶
func SendTransaction ¶
func SendTransaction(host string, signerAccount *Account, tx *flow.Transaction, withResults bool)
Types ¶
type Account ¶
type Account struct {
KeyType KeyType
KeyIndex int
KeyContext map[string]string
Address flow.Address
PrivateKey crypto.PrivateKey
SigAlgo crypto.SignatureAlgorithm
HashAlgo crypto.HashAlgorithm
Signer crypto.Signer
}
func (*Account) LoadSigner ¶ added in v0.12.0
func (*Account) MarshalJSON ¶
func (*Account) UnmarshalJSON ¶
type CadenceArgument ¶ added in v0.15.0
func (CadenceArgument) MarshalJSON ¶ added in v0.15.0
func (v CadenceArgument) MarshalJSON() ([]byte, error)
func (*CadenceArgument) UnmarshalJSON ¶ added in v0.15.0
func (v *CadenceArgument) UnmarshalJSON(b []byte) (err error)
type Config ¶
func LoadConfig ¶
func LoadConfig() *Config
func (*Config) HostWithOverride ¶
func (*Config) LoadSigners ¶ added in v0.12.0
func (*Config) ServiceAccount ¶
func (*Config) SetServiceAccountKey ¶
func (c *Config) SetServiceAccountKey(privateKey crypto.PrivateKey, hashAlgo crypto.HashAlgorithm)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.