votesync

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: GPL-3.0 Imports: 29 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// PollProtocolID is ID of poll protocol
	PollProtocolID = "poll"
)

Variables

This section is empty.

Functions

func NewAgentContract added in v0.3.5

func NewAgentContract(cli iotex.AuthedClient, addr address.Address) (*agentContract, error)

func NewBrokerContract added in v0.3.5

func NewBrokerContract(cli iotex.AuthedClient, addr address.Address, batchSize uint8) (*brokerContract, error)

func NewClerkContract added in v0.3.5

func NewClerkContract(cli iotex.AuthedClient, addr address.Address) (*clerkContract, error)

func NewIoTeXClient added in v0.3.5

func NewIoTeXClient(client iotexapi.APIServiceClient) *iotexClient

func NewRotatableWeightedVPS added in v0.3.5

func NewRotatableWeightedVPS(cli iotex.AuthedClient, addr address.Address, batchSize uint8) (*rwvps, error)

func NewVitaContract added in v0.3.5

func NewVitaContract(cli iotex.AuthedClient, addr address.Address) (*vitaContract, error)

Types

type Config

type Config struct {
	GravityChainAPIs          []string      `yaml:"gravityChainAPIs"`
	GravityChainTimeInterval  time.Duration `yaml:"gravityChainTimeInterval"`
	OperatorPrivateKey        string        `yaml:"operatorPrivateKey"`
	IoTeXAPI                  string        `yaml:"ioTeXAPI"`
	IoTeXAPISecure            bool          `yaml:"ioTeXAPISecure"`
	RegisterContractAddress   string        `yaml:"registerContractAddress"`
	StakingContractAddress    string        `yaml:"stakingContractAddress"`
	PaginationSize            uint8         `yaml:"paginationSize"`
	BrokerPaginationSize      uint8         `yaml:"brokerPaginationSize"`
	VitaContractAddress       string        `yaml:"vitaContractAddress"`
	DiscordBotToken           string        `yaml:"discordBotToken"`
	DiscordChannelID          string        `yaml:"discordChannelID"`
	DiscordMsg                string        `yaml:"discordMsg"`
	DiscordReminder           string        `yaml:"discordReminder"`
	DardanellesHeight         uint64        `yaml:"dardanellesHeight"`
	FairBankHeight            uint64        `yaml:"fairbankHeight"`
	NativeCommitteeInitHeight uint64        `yaml:"nativeCommitteeInitHeight"`
	EnableAgentMode           bool          `yaml:"enableAgentMode"`
	AgentContractAddress      string        `yaml:"agentContractAddress"`
}

Config defines the configs for VoteSync

type VoteFetcher added in v0.3.5

type VoteFetcher struct {
	// contains filtered or unexported fields
}

VoteFetcher defines fields used to fetch votes

func (*VoteFetcher) FetchBucketsByHeight added in v0.3.5

func (fetcher *VoteFetcher) FetchBucketsByHeight(ctx context.Context, h uint64) (*iotextypes.VoteBucketList, *iotextypes.CandidateListV2, error)

type VoteSync

type VoteSync struct {
	// contains filtered or unexported fields
}

VoteSync defines fields used in VoteSync

func NewVoteSync

func NewVoteSync(cfg Config) (*VoteSync, error)

NewVoteSync instantiates new VoteSync

func (*VoteSync) ProofForAccount added in v0.3.5

func (vc *VoteSync) ProofForAccount(acct address.Address) (*big.Int, *big.Int, []byte, error)

func (*VoteSync) Start

func (vc *VoteSync) Start(ctx context.Context)

Start starts voteSync

func (*VoteSync) Stop

func (vc *VoteSync) Stop(ctx context.Context)

Stop stops voteSync

type VotingPowers added in v0.3.5

type VotingPowers struct {
	// contains filtered or unexported fields
}

func (*VotingPowers) Total added in v0.3.5

func (vp *VotingPowers) Total() *big.Int

func (*VotingPowers) Update added in v0.3.5

func (vp *VotingPowers) Update(cycle *big.Int, total *big.Int, votingPowers map[common.Address]*big.Int)

func (*VotingPowers) VotingPower added in v0.3.5

func (vp *VotingPowers) VotingPower(acct common.Address) (*big.Int, *big.Int)

type WeightedVote

type WeightedVote struct {
	Voter string
	Votes *big.Int
}

WeightedVote defines voter and votes for weighted vote

Jump to

Keyboard shortcuts

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