Documentation ¶
Index ¶
- Variables
- func Genesis(cfg *Config, state *state.StateDB, timestamp uint64, number uint64) error
- type API
- func (api *API) AvailableStake(epoch uint64, voter string) (*big.Int, error)
- func (api *API) BrowserAllEpoch() (interface{}, error)
- func (api *API) BrowserEpochRecord(reqEpochNumber uint64) (interface{}, error)
- func (api *API) BrowserVote(reqEpochNumber uint64) (interface{}, error)
- func (api *API) Candidate(epoch uint64, name string) (interface{}, error)
- func (api *API) Candidates(epoch uint64, detail bool) (interface{}, error)
- func (api *API) CandidatesSize(epoch uint64) (uint64, error)
- func (api *API) Epoch(height uint64) (uint64, error)
- func (api *API) GetActivedCandidate(epoch uint64, index uint64) (interface{}, error)
- func (api *API) GetActivedCandidateSize(epoch uint64) (uint64, error)
- func (api *API) Info() interface{}
- func (api *API) Irreversible() interface{}
- func (api *API) NextEpoch(epoch uint64) (uint64, error)
- func (api *API) NextValidCandidates() (interface{}, error)
- func (api *API) PrevEpoch(epoch uint64) (uint64, error)
- func (api *API) SnapShotStake(epoch uint64, name string) (interface{}, error)
- func (api *API) SnapShotTime(epoch uint64) (interface{}, error)
- func (api *API) ValidCandidates(epoch uint64) (interface{}, error)
- func (api *API) VotersByCandidate(epoch uint64, candidate string, detail bool) (interface{}, error)
- func (api *API) VotersByVoter(epoch uint64, voter string, detail bool) (interface{}, error)
- type ArrayCandidateInfoForBrowser
- type CandidateInfo
- type CandidateInfoArray
- type CandidateInfoForBrowser
- type CandidateType
- type Config
- type Dpos
- func (dpos *Dpos) APIs(chain consensus.IChainReader) []rpc.API
- func (dpos *Dpos) Author(header *types.Header) (common.Name, error)
- func (dpos *Dpos) BlockInterval() uint64
- func (dpos *Dpos) CalcBFTIrreversible() uint64
- func (dpos *Dpos) CalcDifficulty(chain consensus.IChainReader, time uint64, parent *types.Header) *big.Int
- func (dpos *Dpos) CalcProposedIrreversible(chain consensus.IChainReader, parent *types.Header, strict bool) uint64
- func (dpos *Dpos) Config() *Config
- func (dpos *Dpos) Engine() consensus.IEngine
- func (dpos *Dpos) Finalize(chain consensus.IChainReader, header *types.Header, txs []*types.Transaction, ...) (*types.Block, error)
- func (dpos *Dpos) GetActivedCandidate(state *state.StateDB, epoch uint64, index uint64) (string, *big.Int, *big.Int, uint64, uint64, uint64, bool, error)
- func (dpos *Dpos) GetActivedCandidateSize(state *state.StateDB, epoch uint64) (uint64, error)
- func (dpos *Dpos) GetCandidateStake(state *state.StateDB, epoch uint64, candidate string) (*big.Int, error)
- func (dpos *Dpos) GetDelegatedByTime(state *state.StateDB, candidate string, timestamp uint64) (*big.Int, error)
- func (dpos *Dpos) GetEpoch(state *state.StateDB, t uint64, curEpoch uint64) (epoch uint64, time uint64, err error)
- func (dpos *Dpos) GetVoterStake(state *state.StateDB, epoch uint64, voter string, candidate string) (*big.Int, error)
- func (dpos *Dpos) IsValidateCandidate(chain consensus.IChainReader, parent *types.Header, timestamp uint64, ...) error
- func (dpos *Dpos) Prepare(chain consensus.IChainReader, header *types.Header, txs []*types.Transaction, ...) error
- func (dpos *Dpos) ProcessAction(fid uint64, number uint64, chainCfg *params.ChainConfig, state *state.StateDB, ...) ([]*types.InternalAction, error)
- func (dpos *Dpos) Seal(chain consensus.IChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
- func (dpos *Dpos) SetConfig(config *Config)
- func (dpos *Dpos) SetSignFn(signFn SignFn)
- func (dpos *Dpos) Slot(timestamp uint64) uint64
- func (dpos *Dpos) VerifySeal(chain consensus.IChainReader, header *types.Header) error
- type Epoch
- type Epochs
- type GlobalState
- type IDB
- type IDatabase
- type KickedCandidate
- type LDB
- func (db *LDB) CandidatesSize(epoch uint64) (uint64, error)
- func (db *LDB) DelCandidate(epoch uint64, name string) error
- func (db *LDB) GetActivatedCandidate(index uint64) (*CandidateInfo, error)
- func (db *LDB) GetAvailableQuantity(epoch uint64, voter string) (*big.Int, error)
- func (db *LDB) GetCandidate(epoch uint64, name string) (*CandidateInfo, error)
- func (db *LDB) GetCandidateInfoByTime(epoch uint64, candidate string, timestamp uint64) (*CandidateInfo, error)
- func (db *LDB) GetCandidates(epoch uint64) (CandidateInfoArray, error)
- func (db *LDB) GetLastestEpoch() (uint64, error)
- func (db *LDB) GetState(epoch uint64) (*GlobalState, error)
- func (db *LDB) GetTakeOver() (uint64, error)
- func (db *LDB) GetVoter(epoch uint64, voter string, candidate string) (*VoterInfo, error)
- func (db *LDB) GetVotersByCandidate(epoch uint64, candidate string) ([]*VoterInfo, error)
- func (db *LDB) GetVotersByVoter(epoch uint64, voter string) ([]*VoterInfo, error)
- func (db *LDB) SetActivatedCandidate(index uint64, candidate *CandidateInfo) error
- func (db *LDB) SetAvailableQuantity(epoch uint64, voter string, quantity *big.Int) error
- func (db *LDB) SetCandidate(candidate *CandidateInfo) error
- func (db *LDB) SetLastestEpoch(epoch uint64) error
- func (db *LDB) SetState(gstate *GlobalState) error
- func (db *LDB) SetTakeOver(epoch uint64) error
- func (db *LDB) SetVoter(voter *VoterInfo) error
- type RegisterCandidate
- type RemoveKickedCandidate
- type SignFn
- type System
- func (sys *System) ExitTakeOver(epoch uint64, number uint64, fid uint64) error
- func (sys *System) KickedCandidate(epoch uint64, candidate string, number uint64, fid uint64) error
- func (sys *System) RefundCandidate(epoch uint64, candidate string, number uint64, fid uint64) error
- func (sys *System) RegCandidate(epoch uint64, candidate string, url string, stake *big.Int, number uint64, ...) error
- func (sys *System) RemoveKickedCandidate(epoch uint64, candidate string, number uint64, fid uint64) error
- func (sys *System) UnregCandidate(epoch uint64, candidate string, number uint64, fid uint64) error
- func (sys *System) UpdateCandidate(epoch uint64, candidate string, url string, nstake *big.Int, number uint64, ...) error
- func (sys *System) UpdateElectedCandidates0(pepoch uint64, epoch uint64, number uint64, miner string) error
- func (sys *System) UpdateElectedCandidates1(pepoch uint64, epoch uint64, number uint64, miner string) error
- func (sys *System) VoteCandidate(epoch uint64, voter string, candidate string, stake *big.Int, number uint64, ...) error
- type UInt64Slice
- type UpdateCandidate
- type VoteCandidate
- type VoterInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrIllegalCandidateName = errors.New("illegal candidate name") ErrIllegalCandidatePubKey = errors.New("illegal candidate pubkey") ErrTooMuchRreversible = errors.New("too much rreversible blocks") ErrSystemTakeOver = errors.New("system account take over") )
var ( // CandidateKeyPrefix candidateInfo CandidateKeyPrefix = "p" // CandidateHead all candidate key CandidateHead = "s" // ActivatedCandidateKeyPrefix candidateInfo ActivatedCandidateKeyPrefix = "ap" // VoterKeyPrefix voterInfo VoterKeyPrefix = "v" // VoterHead head VoterHead = "v" // TakeOver key TakeOver = "takeover" // StateKeyPrefix globalState StateKeyPrefix = "s" // LastestStateKey lastest LastestStateKey = "lastest" // Separator Split characters Separator = "_" )
var DefaultConfig = &Config{ MaxURLLen: 512, UnitStake: big.NewInt(1000), CandidateMinQuantity: big.NewInt(10), CandidateAvailableMinQuantity: big.NewInt(10), VoterMinQuantity: big.NewInt(2), ActivatedMinCandidate: 3, ActivatedMinQuantity: big.NewInt(100), BlockInterval: 3000, BlockFrequency: 6, CandidateScheduleSize: 3, BackupScheduleSize: 0, EpochInterval: 1080000, FreezeEpochSize: 3, AccountName: "ftsystemdpos", SystemName: "ftsystemio", SystemURL: "www.fractalproject.com", ExtraBlockReward: big.NewInt(1), BlockReward: big.NewInt(5), Decimals: 18, AssetID: 1, ReferenceTime: 1555776000000 * uint64(time.Millisecond), }
DefaultConfig configures
var (
InvalidIndex = uint64(math.MaxUint64)
)
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API exposes dpos related methods for the RPC interface.
func (*API) AvailableStake ¶
AvailableStake get available stake that can vote candidate
func (*API) BrowserAllEpoch ¶
func (*API) BrowserEpochRecord ¶
func (*API) BrowserVote ¶
func (*API) Candidates ¶
Candidates get all candidates info
func (*API) CandidatesSize ¶
CandidatesSize get candidates size
func (*API) GetActivedCandidate ¶
GetActivedCandidate get actived candidate info
func (*API) GetActivedCandidateSize ¶
GetActivedCandidateSize get actived candidate size
func (*API) Irreversible ¶
func (api *API) Irreversible() interface{}
Irreversible get irreversible info
func (*API) NextValidCandidates ¶
NextValidCandidates next valid candidates
func (*API) SnapShotStake ¶
SnapShotStake get snapshot stake
func (*API) SnapShotTime ¶
SnapShotTime get snapshot timestamp
func (*API) ValidCandidates ¶
ValidCandidates get valid candidates
func (*API) VotersByCandidate ¶
VotersByCandidate get voters info of candidate
type ArrayCandidateInfoForBrowser ¶
type ArrayCandidateInfoForBrowser struct { Data []*CandidateInfoForBrowser `json:"data"` BadCandidateIndexSchedule []uint64 `json:"bad"` UsingCandidateIndexSchedule []uint64 `json:"using"` }
ArrayCandidateInfoForBrowser dpos state
type CandidateInfo ¶
type CandidateInfo struct { Epoch uint64 `json:"epoch"` Name string `json:"name"` // candidate name URL string `json:"url"` // candidate url Quantity *big.Int `json:"quantity"` // candidate stake quantity TotalQuantity *big.Int `json:"totalQuantity"` // candidate total stake quantity Number uint64 `json:"number"` // timestamp Counter uint64 `json:"shouldCounter"` ActualCounter uint64 `json:"actualCounter"` Type CandidateType `json:"type"` PrevKey string `json:"-"` NextKey string `json:"-"` }
CandidateInfo info
type CandidateInfoArray ¶
type CandidateInfoArray []*CandidateInfo
CandidateInfoArray array of candidate
func (CandidateInfoArray) Len ¶
func (prods CandidateInfoArray) Len() int
func (CandidateInfoArray) Less ¶
func (prods CandidateInfoArray) Less(i, j int) bool
func (CandidateInfoArray) Swap ¶
func (prods CandidateInfoArray) Swap(i, j int)
type CandidateInfoForBrowser ¶
type CandidateInfoForBrowser struct { Candidate string `json:"candidate"` Holder string `json:"holder"` Quantity string `json:"quantity"` TotalQuantity string `json:"totalQuantity"` Counter uint64 `json:"shouldCounter"` ActualCounter uint64 `json:"actualCounter"` NowCounter uint64 `json:"nowShouldCounter"` NowActualCounter uint64 `json:"nowActualCounter"` }
CandidateInfoForBrowser dpos state
type CandidateType ¶
type CandidateType uint64
const ( Normal CandidateType = iota Freeze Black Jail Unkown )
func (CandidateType) MarshalJSON ¶
func (t CandidateType) MarshalJSON() ([]byte, error)
MarshalJSON returns the hex representation of a.
func (CandidateType) MarshalText ¶
func (t CandidateType) MarshalText() ([]byte, error)
MarshalText returns the hex representation of a.
func (*CandidateType) UnmarshalJSON ¶
func (t *CandidateType) UnmarshalJSON(data []byte) error
UnmarshalJSON parses a type in syntax.
func (*CandidateType) UnmarshalText ¶
func (t *CandidateType) UnmarshalText(input []byte) error
UnmarshalText parses a hash in syntax.
type Config ¶
type Config struct { // consensus fileds MaxURLLen uint64 `json:"maxURLLen"` // url length UnitStake *big.Int `json:"unitStake"` // state unit CandidateMinQuantity *big.Int `json:"candidateMinQuantity"` // min quantity CandidateAvailableMinQuantity *big.Int `json:"candidateAvailableMinQuantity"` // min quantity VoterMinQuantity *big.Int `json:"voterMinQuantity"` // min quantity ActivatedMinCandidate uint64 `json:"activatedMinCandidate"` ActivatedMinQuantity *big.Int `json:"activatedMinQuantity"` // min active quantity BlockInterval uint64 `json:"blockInterval"` BlockFrequency uint64 `json:"blockFrequency"` CandidateScheduleSize uint64 `json:"candidateScheduleSize"` BackupScheduleSize uint64 `json:"backupScheduleSize"` EpochInterval uint64 `json:"epochInterval"` FreezeEpochSize uint64 `json:"freezeEpochSize"` AccountName string `json:"accountName"` SystemName string `json:"systemName"` SystemURL string `json:"systemURL"` ExtraBlockReward *big.Int `json:"extraBlockReward"` BlockReward *big.Int `json:"blockReward"` Decimals uint64 `json:"decimals"` AssetID uint64 `json:"assetID"` ReferenceTime uint64 `json:"referenceTime"` // contains filtered or unexported fields }
Config dpos configures
type Dpos ¶
type Dpos struct {
// contains filtered or unexported fields
}
Dpos dpos engine
func New ¶
func New(config *Config, chain consensus.IChainReader) *Dpos
New creates a DPOS consensus engine
func (*Dpos) APIs ¶
func (dpos *Dpos) APIs(chain consensus.IChainReader) []rpc.API
APIs returning the user facing RPC APIs.
func (*Dpos) CalcBFTIrreversible ¶
CalcBFTIrreversible calc irreversible
func (*Dpos) CalcDifficulty ¶
func (dpos *Dpos) CalcDifficulty(chain consensus.IChainReader, time uint64, parent *types.Header) *big.Int
CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty that a new block should have when created at time given the parent block's time and difficulty.
func (*Dpos) CalcProposedIrreversible ¶
func (dpos *Dpos) CalcProposedIrreversible(chain consensus.IChainReader, parent *types.Header, strict bool) uint64
CalcProposedIrreversible calc irreversible
func (*Dpos) Finalize ¶
func (dpos *Dpos) Finalize(chain consensus.IChainReader, header *types.Header, txs []*types.Transaction, receipts []*types.Receipt, state *state.StateDB) (*types.Block, error)
Finalize assembles the final block.
func (*Dpos) GetActivedCandidate ¶
func (dpos *Dpos) GetActivedCandidate(state *state.StateDB, epoch uint64, index uint64) (string, *big.Int, *big.Int, uint64, uint64, uint64, bool, error)
GetActivedCandidate get actived candidate info
func (*Dpos) GetActivedCandidateSize ¶
GetActivedCandidateSize get actived candidate size
func (*Dpos) GetCandidateStake ¶
func (dpos *Dpos) GetCandidateStake(state *state.StateDB, epoch uint64, candidate string) (*big.Int, error)
GetCandidateStake candidate delegate stake
func (*Dpos) GetDelegatedByTime ¶
func (dpos *Dpos) GetDelegatedByTime(state *state.StateDB, candidate string, timestamp uint64) (*big.Int, error)
GetDelegatedByTime get delegate of candidate
func (*Dpos) GetEpoch ¶
func (dpos *Dpos) GetEpoch(state *state.StateDB, t uint64, curEpoch uint64) (epoch uint64, time uint64, err error)
GetEpoch get epoch and epoch start time by type
func (*Dpos) GetVoterStake ¶
func (dpos *Dpos) GetVoterStake(state *state.StateDB, epoch uint64, voter string, candidate string) (*big.Int, error)
GetVoterStake voter stake
func (*Dpos) IsValidateCandidate ¶
func (dpos *Dpos) IsValidateCandidate(chain consensus.IChainReader, parent *types.Header, timestamp uint64, candidate string, pubkeys [][]byte, state *state.StateDB, force bool, fid uint64) error
IsValidateCandidate current candidate
func (*Dpos) Prepare ¶
func (dpos *Dpos) Prepare(chain consensus.IChainReader, header *types.Header, txs []*types.Transaction, receipts []*types.Receipt, state *state.StateDB) error
Prepare initializes the consensus fields of a block header according to the rules of a particular engine. The changes are executed inline.
func (*Dpos) ProcessAction ¶
func (dpos *Dpos) ProcessAction(fid uint64, number uint64, chainCfg *params.ChainConfig, state *state.StateDB, action *types.Action) ([]*types.InternalAction, error)
ProcessAction exec action
func (*Dpos) Seal ¶
func (dpos *Dpos) Seal(chain consensus.IChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error)
Seal generates a new block for the given input block with the local miner's seal place on top.
func (*Dpos) VerifySeal ¶
VerifySeal checks whether the crypto seal on a header is valid according to the consensus rules of the given engine.
type GlobalState ¶
type GlobalState struct { Epoch uint64 `json:"epoch"` // epoch PreEpoch uint64 `json:"preEpoch"` // epoch ActivatedCandidateSchedule []string `json:"activatedCandidateSchedule"` // candidates ActivatedTotalQuantity *big.Int `json:"activatedTotalQuantity"` // the sum of activate candidate votes BadCandidateIndexSchedule []uint64 `json:"badCandidateIndexSchedule"` // activated backup candidates UsingCandidateIndexSchedule []uint64 `json:"usingCandidateIndexSchedule"` // activated backup candidates TotalQuantity *big.Int `json:"totalQuantity"` // the sum of all candidate votes TakeOver bool `json:"takeOver"` // systemio take over dpos Dpos bool `json:"dpos"` // dpos status Number uint64 `json:"number"` // timestamp }
GlobalState dpos state
type IDB ¶
type IDB interface { SetCandidate(*CandidateInfo) error DelCandidate(uint64, string) error GetCandidate(uint64, string) (*CandidateInfo, error) GetCandidates(uint64) (CandidateInfoArray, error) CandidatesSize(uint64) (uint64, error) SetActivatedCandidate(uint64, *CandidateInfo) error GetActivatedCandidate(uint64) (*CandidateInfo, error) SetAvailableQuantity(uint64, string, *big.Int) error GetAvailableQuantity(uint64, string) (*big.Int, error) SetVoter(*VoterInfo) error GetVoter(uint64, string, string) (*VoterInfo, error) GetVotersByVoter(uint64, string) ([]*VoterInfo, error) GetVotersByCandidate(uint64, string) ([]*VoterInfo, error) SetState(*GlobalState) error GetState(uint64) (*GlobalState, error) SetLastestEpoch(uint64) error GetLastestEpoch() (uint64, error) SetTakeOver(uint64) error GetTakeOver() (uint64, error) Undelegate(string, *big.Int) (*types.Action, error) IncAsset2Acct(string, string, *big.Int) (*types.Action, error) GetBalanceByTime(name string, timestamp uint64) (*big.Int, error) GetCandidateInfoByTime(epoch uint64, name string, timestamp uint64) (*CandidateInfo, error) }
IDB dpos database
type IDatabase ¶
type IDatabase interface { Get(key string) ([]byte, error) Put(key string, value []byte) error Delete(key string) error Undelegate(string, *big.Int) (*types.Action, error) IncAsset2Acct(string, string, *big.Int) (*types.Action, error) GetBalanceByTime(name string, timestamp uint64) (*big.Int, error) GetSnapshot(key string, timestamp uint64) ([]byte, error) }
IDatabase level db
type KickedCandidate ¶
type KickedCandidate struct {
Candidates []string
}
KickedCandidate kicked info
type LDB ¶
type LDB struct {
IDatabase
}
LDB dpos level db
func (*LDB) CandidatesSize ¶
CandidatesSize candidate len
func (*LDB) DelCandidate ¶
DelCandidate del candidate info
func (*LDB) GetActivatedCandidate ¶
func (db *LDB) GetActivatedCandidate(index uint64) (*CandidateInfo, error)
GetActivatedCandidate get activated candidate info
func (*LDB) GetAvailableQuantity ¶
GetAvailableQuantity get quantity
func (*LDB) GetCandidate ¶
func (db *LDB) GetCandidate(epoch uint64, name string) (*CandidateInfo, error)
GetCandidate get candidate info by name
func (*LDB) GetCandidateInfoByTime ¶
func (db *LDB) GetCandidateInfoByTime(epoch uint64, candidate string, timestamp uint64) (*CandidateInfo, error)
GetCandidateInfoByTime candidate info
func (*LDB) GetCandidates ¶
func (db *LDB) GetCandidates(epoch uint64) (CandidateInfoArray, error)
GetCandidates get all candidate info & sort
func (*LDB) GetLastestEpoch ¶
GetLastestEpoch get latest epoch
func (*LDB) GetState ¶
func (db *LDB) GetState(epoch uint64) (*GlobalState, error)
GetState get state info
func (*LDB) GetTakeOver ¶
GetTakeOver get activated candidate info
func (*LDB) GetVotersByCandidate ¶
GetVotersByCandidate voters info by candidate
func (*LDB) GetVotersByVoter ¶
GetVotersByVoter voters info by voter
func (*LDB) SetActivatedCandidate ¶
func (db *LDB) SetActivatedCandidate(index uint64, candidate *CandidateInfo) error
SetActivatedCandidate update activated candidate info
func (*LDB) SetAvailableQuantity ¶
SetAvailableQuantity set quantity
func (*LDB) SetCandidate ¶
func (db *LDB) SetCandidate(candidate *CandidateInfo) error
SetCandidate update candidate info
func (*LDB) SetLastestEpoch ¶
SetLastestEpoch set latest epoch
func (*LDB) SetState ¶
func (db *LDB) SetState(gstate *GlobalState) error
SetState set global state info
func (*LDB) SetTakeOver ¶
SetTakeOver update activated candidate info
type RegisterCandidate ¶
type RegisterCandidate struct {
URL string
}
RegisterCandidate candidate info
type RemoveKickedCandidate ¶
type RemoveKickedCandidate struct {
Candidates []string
}
RemoveKickedCandidate remove kicked info
type System ¶
type System struct { IDB // contains filtered or unexported fields }
System dpos internal contract
func (*System) ExitTakeOver ¶
ExitTakeOver system exit take over
func (*System) KickedCandidate ¶
KickedCandidate kicked
func (*System) RefundCandidate ¶
RefundCandidate refund a candidate
func (*System) RegCandidate ¶
func (sys *System) RegCandidate(epoch uint64, candidate string, url string, stake *big.Int, number uint64, fid uint64) error
RegCandidate register a candidate
func (*System) RemoveKickedCandidate ¶
func (sys *System) RemoveKickedCandidate(epoch uint64, candidate string, number uint64, fid uint64) error
RemoveKickedCandidate remove
func (*System) UnregCandidate ¶
UnregCandidate unregister a candidate
func (*System) UpdateCandidate ¶
func (sys *System) UpdateCandidate(epoch uint64, candidate string, url string, nstake *big.Int, number uint64, fid uint64) error
UpdateCandidate update a candidate
func (*System) UpdateElectedCandidates0 ¶
func (sys *System) UpdateElectedCandidates0(pepoch uint64, epoch uint64, number uint64, miner string) error
UpdateElectedCandidates0 update
type UInt64Slice ¶
type UInt64Slice []uint64
UInt64Slice attaches the methods of sort.Interface to []uint64, sorting in increasing order.
func (UInt64Slice) Len ¶
func (s UInt64Slice) Len() int
func (UInt64Slice) Less ¶
func (s UInt64Slice) Less(i, j int) bool
func (UInt64Slice) Swap ¶
func (s UInt64Slice) Swap(i, j int)
type VoteCandidate ¶
VoteCandidate vote info
type VoterInfo ¶
type VoterInfo struct { Epoch uint64 `json:"epoch"` Name string `json:"name"` // voter name Candidate string `json:"candidate"` // candidate approved by this voter Quantity *big.Int `json:"quantity"` // stake approved by this voter Number uint64 `json:"number"` // timestamp NextKeyForVoter string `json:"-"` NextKeyForCandidate string `json:"-"` }
VoterInfo info