define

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0, GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetIndexError          = errors.New("get Index nil(no Address)")
	NoTargetValidatorError = errors.New("not find target validator")
	BigSubValue            = errors.New("not enough map")
)
View Source
var (
	KeyStoreFlag = cli.StringFlag{
		Name:  "keystore",
		Usage: "Keystore file path",
	}
	NameFlag = cli.StringFlag{
		Name:  "name",
		Usage: "Name of account",
	}
	URLFlag = cli.StringFlag{
		Name:  "url",
		Usage: "Metadata url of account",
	}
	CommissionFlag = cli.Uint64Flag{
		Name:  "commission",
		Usage: "Register validator param",
	}
	RelayerFlag = cli.StringFlag{
		Name:  "relayerf",
		Usage: "Register validator param",
	}
	VoteNumFlag = cli.Int64Flag{
		Name:  "voteNum",
		Usage: "The amount of gold to use to vote",
	}
	TopNumFlag = cli.Int64Flag{
		Name:  "topNum",
		Usage: "TopNum of validator",
	}
	LockedNumFlag = cli.Int64Flag{
		Name:  "lockedNum",
		Usage: "The amount of map to lock 、unlock、relock、withdraw ",
	}
	WithdrawIndexFlag = cli.Int64Flag{
		Name:  "withdrawIndex",
		Usage: "Use for withdraw",
	}
	ReLockIndexFlag = cli.Int64Flag{
		Name:  "relockIndex",
		Usage: "Use for relock",
	}
	VerbosityFlag = cli.Int64Flag{
		Name:  "Verbosity",
		Usage: "Verbosity of log level",
	}
	RPCAddrFlag = cli.StringFlag{
		Name:  "rpcaddr",
		Usage: "HTTP-RPC server listening interface",
		Value: "localhost",
	}
	ValueFlag = cli.Uint64Flag{
		Name:  "value",
		Usage: "Value units one eth",
		Value: 0,
	}
	AmountFlag = cli.StringFlag{
		Name:  "amount",
		Usage: "Transfer amount, unit (wei)",
		Value: "0",
	}
	DurationFlag = cli.Int64Flag{
		Name:  "duration",
		Usage: "Duration The time (in seconds) that these requirements persist for.",
		Value: 0,
	}
	TargetAddressFlag = cli.StringFlag{
		Name:  "target",
		Usage: "Target query address",
		Value: "",
	}
	ValidatorAddressFlag = cli.StringFlag{
		Name:  "validator",
		Usage: "Validator address",
		Value: "",
	}
	SignerPriFlag = cli.StringFlag{
		Name:  "signerPriv",
		Usage: "Signer private",
		Value: "",
	}
	SignerFlag = cli.StringFlag{
		Name:  "signer",
		Usage: "Signer address",
		Value: "",
	}
	SignatureFlag = cli.StringFlag{
		Name:  "signature",
		Usage: "ECDSA Signature",
		Value: "",
	}
	ProofFlag = cli.StringFlag{
		Name:  "proof",
		Usage: "Signer proof",
		Value: "",
	}
	AccountAddressFlag = cli.StringFlag{
		Name:  "accountAddress",
		Usage: "Account address",
		Value: "",
	}
	ContractAddressFlag = cli.StringFlag{
		Name:  "contractAddress",
		Usage: "Set contract Address",
		Value: "",
	}
	ImplementationAddressFlag = cli.StringFlag{
		Name:  "implementationAddress",
		Usage: "Set implementation Address",
		Value: "",
	}
	GasLimitFlag = cli.Int64Flag{
		Name:  "gasLimit",
		Usage: "Use for sendContractTransaction gasLimit",
		Value: 0,
	}
	KeystoreAddressFlag = cli.StringFlag{
		Name:  "keystoreAddress",
		Usage: "The address corresponding to the keystore",
		Value: "",
	}
	BuildpathFlag = cli.StringFlag{
		Name:  "buildpath",
		Usage: "Directory where smartcontract truffle build file live",
	}
	NewEnvFlag = cli.StringFlag{
		Name:  "newenv",
		Usage: "Creates a new env in desired folder",
	}
	MarkerCfgFlag = cli.StringFlag{
		Name:  "markercfg",
		Usage: "Marker config path",
	}
)
View Source
var (
	Voter2validator []Voter2validatorInfo
	VoterList       []VoterStruct
)
View Source
var MustFlagCombination = []cli.Flag{
	RPCAddrFlag,
	KeyStoreFlag,
	GasLimitFlag,
}
View Source
var TemplateFlags = []cli.Flag{
	cli.StringFlag{
		Name:  "template",
		Usage: "Optional template to use (default: local)",
	},
	cli.IntFlag{
		Name:  "validators",
		Usage: "Number of Validators",
	},
	cli.IntFlag{
		Name:  "dev.accounts",
		Usage: "Number of developer accounts",
	},
	cli.Uint64Flag{
		Name:  "blockperiod",
		Usage: "Seconds between each block",
	},
	cli.Uint64Flag{
		Name:  "epoch",
		Usage: "Epoch size",
	},
	cli.Int64Flag{
		Name:  "blockgaslimit",
		Usage: "Block gas limit",
	},
	cli.StringFlag{
		Name:  "mnemonic",
		Usage: "Mnemonic to generate accounts",
	},
}

Functions

func GetPassword

func GetPassword(msg string) []byte

Types

type Account

type Account struct {
	Address    common.Address
	PrivateKey *ecdsa.PrivateKey
}

Account represents a atlas Account

func LoadAccount

func LoadAccount(path string, password string) (*Account, error)

func (*Account) BLSG1PublicKey

func (a *Account) BLSG1PublicKey() (bls.SerializedG1PublicKey, error)

BLSG1PublicKey returns the bls G1 public key

func (*Account) BLSProofOfPossession

func (a *Account) BLSProofOfPossession() ([]byte, error)

BLSProofOfPossession generates bls proof of possession

func (*Account) BLSPublicKey

func (a *Account) BLSPublicKey() (bls.SerializedPublicKey, error)

BLSPublicKey returns the bls public key

func (*Account) MustBLSProofOfPossession

func (a *Account) MustBLSProofOfPossession() []byte

MustBLSProofOfPossession variant of BLSProofOfPossession that panics on error

func (*Account) PrivateKeyHex

func (a *Account) PrivateKeyHex() string

PrivateKeyHex hex representation of the private key

func (*Account) PublicKey

func (a *Account) PublicKey() []byte

PublicKey hex representation of the public key

func (*Account) String

func (a *Account) String() string

type AccountsParameters

type AccountsParameters struct {
	AccountsABI     *abi.ABI
	AccountsAddress common.Address
}

type Config

type Config struct {
	From       common.Address
	PublicKey  []byte
	PrivateKey *ecdsa.PrivateKey
	BlsPub     blscrypto.SerializedPublicKey
	BlsG1Pub   blscrypto.SerializedG1PublicKey
	BLSProof   []byte
	Value      uint64
	Amount     string
	Duration   int64
	Commission uint64
	Fixed      string

	VoteNum       *big.Int
	TopNum        *big.Int
	LockedNum     *big.Int
	WithdrawIndex *big.Int
	RelockIndex   *big.Int

	TargetAddress         common.Address
	ContractAddress       common.Address
	SignerPriv            string
	AccountAddress        common.Address // validator
	SignerAddress         common.Address
	Signature             string
	Proof                 string
	ImplementationAddress common.Address
	RPCAddr               string
	GasLimit              int64
	Verbosity             string
	Name                  string
	MetadataURL           string
	LockedGoldParameters  LockedGoldParameters
	ValidatorParameters   ValidatorParameters
	EpochRewardParameters EpochRewardsParameters
	TestPoc2Parameters    TestPoc2
	ElectionParameters    ElectionParameters
	GoldTokenParameters   GoldTokenParameters
}

func AssemblyConfig

func AssemblyConfig(ctx *cli.Context) (*Config, error)

type ElectionParameters

type ElectionParameters struct {
	ElectionABI     *abi.ABI
	ElectionAddress common.Address
}

type EpochRewardsParameters

type EpochRewardsParameters struct {
	EpochRewardsABI     *abi.ABI
	EpochRewardsAddress common.Address
}

type GoldTokenParameters

type GoldTokenParameters struct {
	GoldTokenABI     *abi.ABI
	GoldTokenAddress common.Address
}

type LockedGoldParameters

type LockedGoldParameters struct {
	LockedGoldABI     *abi.ABI
	LockedGoldAddress common.Address
}

type TestPoc2

type TestPoc2 struct {
	ABI     *abi.ABI
	Address common.Address
}

type ValidatorInfo

type ValidatorInfo struct {
	EpochNum        uint64
	AllVotes        *big.Int
	ValidatorReward *big.Int
}

type ValidatorParameters

type ValidatorParameters struct {
	ValidatorABI     *abi.ABI
	ValidatorAddress common.Address
}

type Voter2validatorInfo

type Voter2validatorInfo struct {
	VoterAccount     string
	ValidatorAccount string
	Value            uint64
}

type VoterInfo

type VoterInfo struct {
	EpochNum  uint64
	VActive   *big.Int
	VPending  *big.Int
	Voter     common.Address
	Validator common.Address
}

type VoterStruct

type VoterStruct struct {
	Voter     common.Address
	Validator common.Address
}

Jump to

Keyboard shortcuts

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