Documentation ¶
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 Blokchain Controller ", SilenceUsage: true, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if verbose { common.EnableAllVerbose() } switch URLcomponents := strings.Split(node, ":"); len(URLcomponents) { case 1: node = node + ":50051" } conn = client.NewGrpcClient(node) opts := make([]grpc.DialOption, 0) if withTLS { opts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(nil))) } else { opts = append(opts, grpc.WithInsecure()) } if trongridKey := os.Getenv("TRONGRID_APIKEY"); len(trongridKey) > 0 { apiKey = trongridKey } conn.SetAPIKey(apiKey) if err := conn.Start(opts...); err != nil { return err } if len(signer) > 0 { var err error if signerAddress, err = findAddress(signer); err != nil { return err } } var err error passphrase, err = getPassphrase() if err != nil { return err } if len(defaultKeystoreDir) > 0 { store.SetDefaultLocation(defaultKeystoreDir) } return nil }, Long: fmt.Sprintf(` CLI interface to Tron blockchain %s`, g("type 'tronclt --help' for details")), RunE: func(cmd *cobra.Command, args []string) error { cmd.Help() return nil }, } )
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
Click to show internal directories.
Click to hide internal directories.