Documentation
¶
Overview ¶
Package cmd provides CLI subcommands for the tronctl command-line tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ConfigDir is the directory to store config file ConfigDir string // DefaultConfigFile is the default config file name DefaultConfigFile string )
Directories
View Source
var ( // ErrConfigNotMatch indicates error for no config matchs ErrConfigNotMatch = "no config matchs" // ErrEmptyEndpoint indicates error for empty endpoint ErrEmptyEndpoint = "no endpoint has been set" )
Error strings
View Source
var ( // RootCmd is single entry point of the CLI RootCmd = &cobra.Command{ Use: "tronctl", Short: "Tron Blockchain Controller", SilenceUsage: true, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { rt.Verbose = verbose rt.Node = node rt.APIKey = apiKey rt.WithTLS = withTLS rt.NoPrettyOutput = noPrettyOutput rt.NoWait = noWait rt.DryRun = dryRun rt.Timeout = timeout rt.UseLedgerWallet = useLedgerWallet rt.GivenFilePath = givenFilePath rt.DefaultKeystoreDir = defaultKeystoreDir rt.loadDotEnv() rt.setupVerbose() signer = rt.applyEnvOverrides(config.Node, signer, withTLS) if err := rt.setupNetwork(); err != nil { return err } conn = rt.Conn if err := rt.setupSigner(signer); err != nil { return err } signerAddress = rt.SignerAddress var err error rt.Passphrase, err = getPassphrase() if err != nil { return err } passphrase = rt.Passphrase rt.setupKeystore() return nil }, Long: fmt.Sprintf(` CLI interface to Tron blockchain %s`, g("type 'tronctl --help' for details")), RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }, } )
View Source
var (
// VersionWrapDump meant to be set from main.go
VersionWrapDump = ""
)
Functions ¶
Types ¶
type Config ¶
type Config struct {
Node string `yaml:"node"`
Ledger bool `yaml:"ledger"`
Verbose bool `yaml:"verbose"`
Timeout uint32 `yaml:"timeout"`
NoPretty bool `yaml:"noPretty"`
APIKey string `yaml:"apiKey"`
WithTLS bool `yaml:"withTLS"`
}
Config defines the config schema
type GitHubRelease ¶
type GitHubRelease struct {
Prerelease bool `json:"prerelease"`
TagName string `json:"tag_name"`
TargetCommitish string `json:"target_commitish"`
CreatedAt time.Time `json:"created_at"`
Assets []GitHubReleaseAssets `json:"assets"`
}
GitHubRelease json struct
type GitHubReleaseAssets ¶
type GitHubReleaseAssets struct {
ID json.Number `json:"id"`
Name string `json:"name"`
Size json.Number `json:"size"`
URL string `json:"browser_download_url"`
}
GitHubReleaseAssets json struct
type GitHubTag ¶
type GitHubTag struct {
Ref string `json:"ref"`
NodeID string `json:"node_id"`
URL string `json:"url"`
DATA struct {
SHA string `json:"sha"`
} `json:"object"`
}
GitHubTag json struct
type Runtime ¶ added in v0.26.0
type Runtime struct {
Conn *client.GrpcClient
SignerAddress tronAddress
Passphrase string
UseLedgerWallet bool
Verbose bool
DryRun bool
NoWait bool
NoPrettyOutput bool
Timeout uint32
Node string
APIKey string
WithTLS bool
GivenFilePath string
DefaultKeystoreDir string
}
Runtime holds shared state for CLI command execution.
Click to show internal directories.
Click to hide internal directories.