Documentation
¶
Index ¶
- Constants
- func CheckTerminalSupported() bool
- func CreateNode(numValidators int, chain genesis.ChainType, workingDir string, mnemonic string, ...) ([]string, []string, error)
- func FatalErrorCheck(err error)
- func MakeConfig(genDoc *genesis.Genesis, confPath, walletsDir string) (*config.Config, error)
- func MakeRewardAddresses(walletInstance *wallet.Wallet, valAddrsInfo []vault.AddressInfo, ...) ([]crypto.Address, error)
- func MakeValidatorKey(walletInstance *wallet.Wallet, valAddrsInfo []vault.AddressInfo, ...) ([]*bls.ValidatorKey, error)
- func PactusConfigPath(home string) string
- func PactusDefaultHomeDir() string
- func PactusDefaultWalletPath(home string) string
- func PactusGenesisPath(home string) string
- func PactusWalletDir(home string) string
- func PrintErrorMsgf(format string, a ...any)
- func PrintInfoMsgBoldf(format string, a ...any)
- func PrintInfoMsgf(format string, a ...any)
- func PrintJSONData(data []byte)
- func PrintJSONObject(obj any)
- func PrintLine()
- func PrintSuccessMsgf(format string, a ...any)
- func PrintWarnMsgf(format string, a ...any)
- func PromptConfirm(label string) bool
- func PromptInput(label string) string
- func PromptInputWithRange(label string, def, min, max int) int
- func PromptInputWithSuggestion(label, suggestion string) string
- func PromptPassword(label string, confirmation bool) string
- func RecoverConfig(confPath string, defConf *config.Config, chainType genesis.ChainType) (*config.Config, error)
- func StartNode(workingDir string, passwordFetcher func(*wallet.Wallet) (string, bool)) (*node.Node, *wallet.Wallet, error)
- func TrapSignal(cleanupFunc func())
Constants ¶
const ( DefaultHomeDirName = "pactus" DefaultWalletsDirName = "wallets" DefaultWalletName = "default_wallet" )
Variables ¶
This section is empty.
Functions ¶
func CheckTerminalSupported ¶ added in v1.0.0
func CheckTerminalSupported() bool
CheckTerminalSupported returns true if the current terminal supports line editing features.
func CreateNode ¶ added in v0.10.0
func FatalErrorCheck ¶ added in v0.10.0
func FatalErrorCheck(err error)
func MakeConfig ¶ added in v1.0.0
MakeConfig opens the given config file and creates the appropriate configuration per chain type. The chain type is determined from the genesis document. It also updates some private configurations, like "wallets directory". TODO: write test for me.
func MakeRewardAddresses ¶ added in v1.1.0
func MakeValidatorKey ¶ added in v1.1.0
func PactusConfigPath ¶
func PactusDefaultHomeDir ¶ added in v0.18.2
func PactusDefaultHomeDir() string
func PactusDefaultWalletPath ¶
func PactusGenesisPath ¶
func PactusWalletDir ¶ added in v1.0.0
func PrintErrorMsgf ¶ added in v0.15.0
func PrintInfoMsgBoldf ¶ added in v0.15.0
func PrintInfoMsgf ¶ added in v0.15.0
func PrintJSONData ¶
func PrintJSONData(data []byte)
func PrintJSONObject ¶
func PrintJSONObject(obj any)
func PrintSuccessMsgf ¶ added in v0.15.0
func PrintWarnMsgf ¶ added in v0.15.0
func PromptConfirm ¶
PromptConfirm prompts user to confirm the operation.
func PromptInputWithRange ¶ added in v0.10.0
PromptInputWithRange prompts the user for an input integer within a specified range.
func PromptInputWithSuggestion ¶
PromptInputWithSuggestion prompts the user for an input string with a suggestion.
func PromptPassword ¶
PromptPassword prompts the user for a password. Set confirmation to true to require the user to confirm the password.
func RecoverConfig ¶ added in v1.1.0
func StartNode ¶ added in v0.11.0
func StartNode(workingDir string, passwordFetcher func(*wallet.Wallet) (string, bool)) ( *node.Node, *wallet.Wallet, error, )
StartNode starts the node from the given working directory. The passwordFetcher will be used to fetch the password for the default_wallet if it is encrypted. It returns an error if the genesis doc or default_wallet can't be found inside the working directory. TODO: write test for me.
func TrapSignal ¶
func TrapSignal(cleanupFunc func())
TrapSignal traps SIGINT and SIGTERM and terminates the server correctly.
Types ¶
This section is empty.