helper

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

func GetGRPCAddress(cmd *cobra.Command) string

GetGRPCAddress extracts the set GRPC address

func GetGRPCConnection

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

GetGRPCConnection returns a grpc client connection

func GetGraphQLAddress added in v0.5.3

func GetGraphQLAddress(cmd *cobra.Command) string

GetGraphQLAddress extracts the set GraphQL address

func GetIBFTOperatorClientConnection

func GetIBFTOperatorClientConnection(ctx context.Context, address string) (
	ibftOp.IbftOperatorClient,
	error,
)

GetIBFTOperatorClientConnection returns the IBFT operator client connection

func GetJSONRPCAddress

func GetJSONRPCAddress(cmd *cobra.Command) string

GetJSONRPCAddress extracts the set JSON-RPC address

func GetJaegerFlag added in v1.2.4

func GetJaegerFlag(cmd *cobra.Command) (bool, string)

GetJaegerFlag extracts the telemetry flag

func GetPprofFlag added in v1.2.0

func GetPprofFlag(cmd *cobra.Command) bool

GetPprofFlag extracts the

func GetSystemClientConnection

func GetSystemClientConnection(ctx context.Context, address string) (
	proto.SystemClient,
	error,
)

GetSystemClientConnection returns the System operator client connection

func GetTxPoolClientConnection

func GetTxPoolClientConnection(ctx context.Context, 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 ParseGRPCAddress

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

ParseGRPCAddress parses the passed in GRPC address

func ParseGraphQLAddress added in v0.5.3

func ParseGraphQLAddress(graphqlAddress string) (*url.URL, error)

ParseGraphQLAddress parses the passed in GraphQL address

func ParseJSONRPCAddress

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

ParseJSONRPCAddress parses the passed in JSONRPC address

func RegisterGRPCAddressFlag

func RegisterGRPCAddressFlag(cmd *cobra.Command)

RegisterGRPCAddressFlag registers the base GRPC address flag for all child commands

func RegisterGraphQLFlag added in v0.5.3

func RegisterGraphQLFlag(cmd *cobra.Command)

RegisterGraphQLFlag registers the base GraphQL address flag for all child commands

func RegisterJSONOutputFlag

func RegisterJSONOutputFlag(cmd *cobra.Command)

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

func RegisterJSONRPCFlag

func RegisterJSONRPCFlag(cmd *cobra.Command)

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

func RegisterJaegerFlag added in v1.2.4

func RegisterJaegerFlag(cmd *cobra.Command)

RegustreTelemetryFlag registers the telemetry flags

func RegisterLegacyGRPCAddressFlag

func RegisterLegacyGRPCAddressFlag(cmd *cobra.Command)

RegisterLegacyGRPCAddressFlag registers the legacy GRPC address flag for all child commands

func RegisterPprofFlag added in v1.1.3

func RegisterPprofFlag(cmd *cobra.Command)

RegisterPprofFlag registers the pprof flags

func ResolveAddr

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.5

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

func WriteGenesisConfigToDisk

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

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

func (*ClientCloseResult) GetOutput

func (r *ClientCloseResult) GetOutput() string

type IPBinding

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

Jump to

Keyboard shortcuts

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