helper

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockTrackerPollInterval = errors.New("block tracker poll interval must be greater than 0")

Functions

func FormatKV

func FormatKV(in []string) string

FormatKV formats key value pairs:

Key = Value

Key = <none>

func FormatList

func FormatList(in []string) string

FormatList formats a list, using a specific blank value replacement

func GetGRPCAddress added in v0.3.0

func GetGRPCAddress(cmd *cobra.Command) string

GetGRPCAddress extracts the set GRPC address

func GetGRPCConnection added in v0.3.0

func GetGRPCConnection(address string) (*grpc.ClientConn, error)

GetGRPCConnection returns a grpc client connection

func GetIBFTOperatorClientConnection added in v0.3.0

func GetIBFTOperatorClientConnection(address string) (
	ibftOp.IbftOperatorClient,
	error,
)

GetIBFTOperatorClientConnection returns the IBFT operator client connection

func GetJSONLogFormat added in v0.6.2

func GetJSONLogFormat(cmd *cobra.Command) bool

GetJSONLogFormat extracts the set JSON Format flag

func GetJSONRPCAddress added in v0.3.0

func GetJSONRPCAddress(cmd *cobra.Command) string

GetJSONRPCAddress extracts the set JSON-RPC address

func GetSystemClientConnection added in v0.3.0

func GetSystemClientConnection(address string) (
	proto.SystemClient,
	error,
)

GetSystemClientConnection returns the System operator client connection

func GetTxPoolClientConnection added in v0.3.0

func GetTxPoolClientConnection(address string) (
	txpoolOp.TxnPoolOperatorClient,
	error,
)

GetTxPoolClientConnection returns the TxPool operator client connection

func HandleSignals

func HandleSignals(
	closeFn func(),
	outputter command.OutputFormatter,
) error

HandleSignals is a helper method for handling signals sent to the console Like stop, error, etc.

func ParseAmount added in v0.9.0

func ParseAmount(amount string) (*big.Int, error)

func ParseGRPCAddress added in v0.3.0

func ParseGRPCAddress(grpcAddress string) (*net.TCPAddr, error)

ParseGRPCAddress parses the passed in GRPC address

func ParseJSONRPCAddress added in v0.3.0

func ParseJSONRPCAddress(jsonrpcAddress string) (*url.URL, error)

ParseJSONRPCAddress parses the passed in JSONRPC address

func RegisterGRPCAddressFlag added in v0.3.0

func RegisterGRPCAddressFlag(cmd *cobra.Command)

RegisterGRPCAddressFlag registers the base GRPC address flag for all child commands

func RegisterJSONOutputFlag added in v0.3.0

func RegisterJSONOutputFlag(cmd *cobra.Command)

RegisterJSONOutputFlag registers the --json output setting for all child commands

func RegisterJSONRPCFlag added in v0.3.0

func RegisterJSONRPCFlag(cmd *cobra.Command)

RegisterJSONRPCFlag registers the base JSON-RPC address flag for all child commands

func RegisterLegacyGRPCAddressFlag added in v0.3.0

func RegisterLegacyGRPCAddressFlag(cmd *cobra.Command)

RegisterLegacyGRPCAddressFlag registers the legacy GRPC address flag for all child commands

func ResolveAddr added in v0.3.0

func ResolveAddr(address string, defaultIP IPBinding) (*net.TCPAddr, error)

ResolveAddr resolves the passed in TCP address The second param is the default ip to bind to, if no ip address is specified

func SetRequiredFlags added in v0.5.0

func SetRequiredFlags(cmd *cobra.Command, requiredFlags []string)

func ValidateProxyContractsAdmin added in v1.3.0

func ValidateProxyContractsAdmin(proxyContractsAdmin string) error

func WriteGenesisConfigToDisk added in v0.3.0

func WriteGenesisConfigToDisk(genesisConfig *chain.Chain, genesisPath string) error

WriteGenesisConfigToDisk writes the passed in configuration to a genesis file at the specified path

Types

type ClientCloseResult added in v0.3.0

type ClientCloseResult struct {
	Message string `json:"message"`
}

func (*ClientCloseResult) GetOutput added in v0.3.0

func (r *ClientCloseResult) GetOutput() string

type IPBinding added in v0.3.0

type IPBinding string
const (
	LocalHostBinding     IPBinding = "127.0.0.1"
	AllInterfacesBinding IPBinding = "0.0.0.0"
)

type PremineInfo added in v1.3.2

type PremineInfo struct {
	Address types.Address
	Amount  *big.Int
	Key     string // only used for tests
}

func ParsePremineInfo added in v1.3.2

func ParsePremineInfo(premineInfoRaw string) (*PremineInfo, error)

parsePremineInfo parses provided premine information and returns premine address and amount

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL