utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigPath     string
	OutputPath     string
	LogLevel       string
	LogFormat      string
	LogLevelFormat string
	LogFilePath    string
)

global base flags

View Source
var (
	OperatorsInfo                     string
	OperatorsInfoPath                 string
	OperatorIDs                       []string
	GenerateInitiatorKeyIfNotExisting bool
	WithdrawAddress                   common.Address
	Network                           string
	OwnerAddress                      common.Address
	Nonce                             uint64
	Validators                        uint64
)

init flags

View Source
var (
	NewOperatorIDs       []string
	KeysharesFilePath    string
	CeremonySigsFilePath string
)

reshare flags

View Source
var (
	PrivKey         string
	PrivKeyPassword string
	Port            uint64
	OperatorID      uint64
)

operator flags

Functions

func BindBaseFlags

func BindBaseFlags(cmd *cobra.Command) error

BindFlags binds flags to yaml config parameters

func BindInitFlags

func BindInitFlags(cmd *cobra.Command) error

BindInitFlags binds flags to yaml config parameters for the initial DKG

func BindInitiatorBaseFlags

func BindInitiatorBaseFlags(cmd *cobra.Command) error

BindInitiatorBaseFlags binds flags to yaml config parameters

func BindOperatorFlags

func BindOperatorFlags(cmd *cobra.Command) error

BindOperatorFlags binds flags to yaml config parameters for the resharing ceremony of DKG

func BindReshareFlags

func BindReshareFlags(cmd *cobra.Command) error

BindReshareFlags binds flags to yaml config parameters for the resharing ceremony of DKG

func GenerateRSAKeyPair

func GenerateRSAKeyPair(passwordFilePath, privKeyPath string, logger *zap.Logger) (*rsa.PrivateKey, []byte, error)

GenerateRSAKeyPair generates a RSA key pair. Password either supplied as path or generated at random.

func LoadInitiatorRSAPrivKey added in v1.1.0

func LoadInitiatorRSAPrivKey(generate bool) (*rsa.PrivateKey, error)

LoadInitiatorRSAPrivKey loads RSA private key from path or generates a new key pair

func LoadOperators

func LoadOperators(logger *zap.Logger) (initiator.Operators, error)

LoadOperators loads operators data from raw json or file path

func OpenPrivateKey

func OpenPrivateKey(passwordFilePath, privKeyPath string) (*rsa.PrivateKey, error)

OpenPrivateKey reads an RSA key from file. If passwordFilePath is provided, treats privKeyPath as encrypted

func ReadOperatorsInfoFile

func ReadOperatorsInfoFile(operatorsInfoPath string, logger *zap.Logger) (initiator.Operators, error)

ReadOperatorsInfoFile reads operators data from path

func SetBaseFlags

func SetBaseFlags(cmd *cobra.Command)

func SetGlobalLogger

func SetGlobalLogger(cmd *cobra.Command, name string) (*zap.Logger, error)

SetGlobalLogger creates a logger

func SetHealthCheckFlags added in v1.1.0

func SetHealthCheckFlags(cmd *cobra.Command)

func SetInitFlags

func SetInitFlags(cmd *cobra.Command)

func SetOperatorFlags

func SetOperatorFlags(cmd *cobra.Command)

func SetReshareFlags

func SetReshareFlags(cmd *cobra.Command)

func SetViperConfig

func SetViperConfig(cmd *cobra.Command) error

SetViperConfig reads a yaml config file if provided

func StingSliceToUintArray

func StingSliceToUintArray(flagdata []string) ([]uint64, error)

StingSliceToUintArray converts the string slice to uint64 slice

func WriteCeremonySigs added in v1.2.0

func WriteCeremonySigs(ceremonySigs *initiator.CeremonySigs, dir string) error

func WriteDepositResult added in v1.1.0

func WriteDepositResult(depositData *initiator.DepositDataJson, dir string) error

func WriteInitResults added in v1.1.0

func WriteInitResults(depositDataArr []*initiator.DepositDataJson, keySharesArr []*initiator.KeyShares, nonces []uint64, ceremonySigsArr []*initiator.CeremonySigs, logger *zap.Logger)

func WriteKeysharesResult added in v1.1.0

func WriteKeysharesResult(keyShares *initiator.KeyShares, dir string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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