iotex-core: github.com/iotexproject/iotex-core/action/protocol/poll Index | Files

package poll

import "github.com/iotexproject/iotex-core/action/protocol/poll"

Index

Package Files

blockmeta.go candidateindexer.go consortium.go consortiummanagement.abi.go governance_protocol.go lifelong_protocol.go nativeStaking.abi.go nativestaking.go nativestakingV2.go protocol.go slasher.go staking_command.go staking_committee.go util.go

Constants

const ConsortiumManagementABI = "" /* 4958 byte string literal not displayed */

ConsortiumManagementABI is the input ABI used to generate the binding from.

Variables

var (
    // CandidateNamespace is a namespace to store raw candidate
    CandidateNamespace = "candidates"
    // ProbationNamespace is a namespace to store probationlist
    ProbationNamespace = "kickout"
    // ErrIndexerNotExist is an error that shows not exist in candidate indexer DB
    ErrIndexerNotExist = errors.New("not exist in DB")
)
var (
    // ErrNoData is an error that there's no data in the contract
    ErrNoData = errors.New("no data")
    // ErrEndOfData is an error that reaching end of data in the contract
    ErrEndOfData = errors.New("end of data")
)
var ErrDelegatesNotAsExpected = errors.New("delegates are not as expected")

ErrDelegatesNotAsExpected is an error that the delegates are not as expected

var ErrDelegatesNotExist = errors.New("delegates cannot be found")

ErrDelegatesNotExist is an error that the delegates cannot be prepared

var ErrInconsistentHeight = errors.New("data is inconsistent because the state height has been changed")

ErrInconsistentHeight is an error that result of "readFromStateDB" is not consistent with others

var ErrNoElectionCommittee = errors.New("no election committee specified")

ErrNoElectionCommittee is an error that the election committee is not specified

var ErrProposedDelegatesLength = errors.New("the proposed delegate list length")

ErrProposedDelegatesLength is an error that the proposed delegate list length is not right

var NsAbi = "" /* 12352 byte string literal not displayed */

NsAbi is the ABI of native staking contract

type BlockMeta Uses

type BlockMeta struct {
    Height   uint64
    Producer string
    MintTime time.Time
}

BlockMeta is a struct to store block metadata

func NewBlockMeta Uses

func NewBlockMeta(height uint64, producer string, mintTime time.Time) *BlockMeta

NewBlockMeta constructs new blockmeta struct with given fieldss

func (*BlockMeta) Deserialize Uses

func (bm *BlockMeta) Deserialize(buf []byte) error

Deserialize deserializes bytes to blockMeta

func (*BlockMeta) LoadProto Uses

func (bm *BlockMeta) LoadProto(pb *blockmetapb.BlockMeta) error

LoadProto loads blockMeta from proto

func (*BlockMeta) Proto Uses

func (bm *BlockMeta) Proto() (*blockmetapb.BlockMeta, error)

Proto converts the BlockMeta struct to a protobuf message

func (*BlockMeta) Serialize Uses

func (bm *BlockMeta) Serialize() ([]byte, error)

Serialize serializes BlockMeta struct to bytes

type CandidateIndexer Uses

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

CandidateIndexer is an indexer to store candidate/probationList by given height

func NewCandidateIndexer Uses

func NewCandidateIndexer(kv db.KVStore) (*CandidateIndexer, error)

NewCandidateIndexer creates a new CandidateIndexer

func (*CandidateIndexer) CandidateList Uses

func (cd *CandidateIndexer) CandidateList(height uint64) (state.CandidateList, error)

CandidateList gets candidate list from indexer given epoch start height

func (*CandidateIndexer) ProbationList Uses

func (cd *CandidateIndexer) ProbationList(height uint64) (*vote.ProbationList, error)

ProbationList gets probation list from indexer given epoch start height

func (*CandidateIndexer) PutCandidateList Uses

func (cd *CandidateIndexer) PutCandidateList(height uint64, candidates *state.CandidateList) error

PutCandidateList puts candidate list into indexer

func (*CandidateIndexer) PutProbationList Uses

func (cd *CandidateIndexer) PutProbationList(height uint64, probationList *vote.ProbationList) error

PutProbationList puts probation list into indexer

func (*CandidateIndexer) Start Uses

func (cd *CandidateIndexer) Start(ctx context.Context) error

Start starts the indexer

func (*CandidateIndexer) Stop Uses

func (cd *CandidateIndexer) Stop(ctx context.Context) error

Stop stops the indexer

type ConsortiumManagement Uses

type ConsortiumManagement struct {
    ConsortiumManagementCaller     // Read-only binding to the contract
    ConsortiumManagementTransactor // Write-only binding to the contract
    ConsortiumManagementFilterer   // Log filterer for contract events
}

ConsortiumManagement is an auto generated Go binding around an Ethereum contract.

func NewConsortiumManagement Uses

func NewConsortiumManagement(address common.Address, backend bind.ContractBackend) (*ConsortiumManagement, error)

NewConsortiumManagement creates a new instance of ConsortiumManagement, bound to a specific deployed contract.

type ConsortiumManagementAddOperator Uses

type ConsortiumManagementAddOperator struct {
    Member   common.Address
    Operator common.Address
    Endpoint string
    Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementAddOperator represents a AddOperator event raised by the ConsortiumManagement contract.

type ConsortiumManagementAddOperatorIterator Uses

type ConsortiumManagementAddOperatorIterator struct {
    Event *ConsortiumManagementAddOperator // Event containing the contract specifics and raw log
    // contains filtered or unexported fields
}

ConsortiumManagementAddOperatorIterator is returned from FilterAddOperator and is used to iterate over the raw logs and unpacked data for AddOperator events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementAddOperatorIterator) Close Uses

func (it *ConsortiumManagementAddOperatorIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementAddOperatorIterator) Error Uses

func (it *ConsortiumManagementAddOperatorIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementAddOperatorIterator) Next Uses

func (it *ConsortiumManagementAddOperatorIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementCaller Uses

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

ConsortiumManagementCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewConsortiumManagementCaller Uses

func NewConsortiumManagementCaller(address common.Address, caller bind.ContractCaller) (*ConsortiumManagementCaller, error)

NewConsortiumManagementCaller creates a new read-only instance of ConsortiumManagement, bound to a specific deployed contract.

func (*ConsortiumManagementCaller) Delegates Uses

func (_ConsortiumManagement *ConsortiumManagementCaller) Delegates(opts *bind.CallOpts) ([]common.Address, error)

Delegates is a free data retrieval call binding the contract method 0x6138b19e.

Solidity: function delegates() constant returns(address[])

func (*ConsortiumManagementCaller) HealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementCaller) HealthEndpoint(opts *bind.CallOpts, operator common.Address) (string, error)

HealthEndpoint is a free data retrieval call binding the contract method 0xb44d5fc7.

Solidity: function healthEndpoint(address operator) constant returns(string)

func (*ConsortiumManagementCaller) IsMember Uses

func (_ConsortiumManagement *ConsortiumManagementCaller) IsMember(opts *bind.CallOpts, addr common.Address) (bool, error)

IsMember is a free data retrieval call binding the contract method 0xa230c524.

Solidity: function isMember(address addr) constant returns(bool)

func (*ConsortiumManagementCaller) Members Uses

func (_ConsortiumManagement *ConsortiumManagementCaller) Members(opts *bind.CallOpts) ([]common.Address, error)

Members is a free data retrieval call binding the contract method 0xbdd4d18d.

Solidity: function members() constant returns(address[])

func (*ConsortiumManagementCaller) Operators Uses

func (_ConsortiumManagement *ConsortiumManagementCaller) Operators(opts *bind.CallOpts, addr common.Address) ([]common.Address, error)

Operators is a free data retrieval call binding the contract method 0x13e7c9d8.

Solidity: function operators(address addr) constant returns(address[])

func (*ConsortiumManagementCaller) Proposal Uses

func (_ConsortiumManagement *ConsortiumManagementCaller) Proposal(opts *bind.CallOpts) (struct {
    Id          *big.Int
    Proposer    common.Address
    Ptype       uint8
    Member      common.Address
    Capacity    uint8
    Approves    []common.Address
    Disapproves []common.Address
}, error)

Proposal is a free data retrieval call binding the contract method 0x753ec103.

Solidity: function proposal() constant returns(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity, address[] approves, address[] disapproves)

type ConsortiumManagementCallerRaw Uses

type ConsortiumManagementCallerRaw struct {
    Contract *ConsortiumManagementCaller // Generic read-only contract binding to access the raw methods on
}

ConsortiumManagementCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*ConsortiumManagementCallerRaw) Call Uses

func (_ConsortiumManagement *ConsortiumManagementCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type ConsortiumManagementCallerSession Uses

type ConsortiumManagementCallerSession struct {
    Contract *ConsortiumManagementCaller // Generic contract caller binding to set the session for
    CallOpts bind.CallOpts               // Call options to use throughout this session
}

ConsortiumManagementCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*ConsortiumManagementCallerSession) Delegates Uses

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Delegates() ([]common.Address, error)

Delegates is a free data retrieval call binding the contract method 0x6138b19e.

Solidity: function delegates() constant returns(address[])

func (*ConsortiumManagementCallerSession) HealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementCallerSession) HealthEndpoint(operator common.Address) (string, error)

HealthEndpoint is a free data retrieval call binding the contract method 0xb44d5fc7.

Solidity: function healthEndpoint(address operator) constant returns(string)

func (*ConsortiumManagementCallerSession) IsMember Uses

func (_ConsortiumManagement *ConsortiumManagementCallerSession) IsMember(addr common.Address) (bool, error)

IsMember is a free data retrieval call binding the contract method 0xa230c524.

Solidity: function isMember(address addr) constant returns(bool)

func (*ConsortiumManagementCallerSession) Members Uses

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Members() ([]common.Address, error)

Members is a free data retrieval call binding the contract method 0xbdd4d18d.

Solidity: function members() constant returns(address[])

func (*ConsortiumManagementCallerSession) Operators Uses

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Operators(addr common.Address) ([]common.Address, error)

Operators is a free data retrieval call binding the contract method 0x13e7c9d8.

Solidity: function operators(address addr) constant returns(address[])

func (*ConsortiumManagementCallerSession) Proposal Uses

func (_ConsortiumManagement *ConsortiumManagementCallerSession) Proposal() (struct {
    Id          *big.Int
    Proposer    common.Address
    Ptype       uint8
    Member      common.Address
    Capacity    uint8
    Approves    []common.Address
    Disapproves []common.Address
}, error)

Proposal is a free data retrieval call binding the contract method 0x753ec103.

Solidity: function proposal() constant returns(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity, address[] approves, address[] disapproves)

type ConsortiumManagementFilterer Uses

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

ConsortiumManagementFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewConsortiumManagementFilterer Uses

func NewConsortiumManagementFilterer(address common.Address, filterer bind.ContractFilterer) (*ConsortiumManagementFilterer, error)

NewConsortiumManagementFilterer creates a new log filterer instance of ConsortiumManagement, bound to a specific deployed contract.

func (*ConsortiumManagementFilterer) FilterAddOperator Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterAddOperator(opts *bind.FilterOpts) (*ConsortiumManagementAddOperatorIterator, error)

FilterAddOperator is a free log retrieval operation binding the contract event 0xc1ad0c93e1873e80f0551582678c47e2e3cd93d9f12f18b1012ed1ad51654d74.

Solidity: event AddOperator(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) FilterPropose Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterPropose(opts *bind.FilterOpts) (*ConsortiumManagementProposeIterator, error)

FilterPropose is a free log retrieval operation binding the contract event 0x8665d2ae7d62e4273cdfc40af1cbbea2232b315ca2a2e244c833366f2b8ae9eb.

Solidity: event Propose(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity)

func (*ConsortiumManagementFilterer) FilterRemoveOperator Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterRemoveOperator(opts *bind.FilterOpts) (*ConsortiumManagementRemoveOperatorIterator, error)

FilterRemoveOperator is a free log retrieval operation binding the contract event 0xb157cf3e9ae29eb366b3bdda54b41d4738ada5daa73f8d2f1bef6280bb1418e4.

Solidity: event RemoveOperator(address member, address operator)

func (*ConsortiumManagementFilterer) FilterSettleProposal Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterSettleProposal(opts *bind.FilterOpts) (*ConsortiumManagementSettleProposalIterator, error)

FilterSettleProposal is a free log retrieval operation binding the contract event 0xf412ee5dcd836b3a4fa40ae9d7e90eeea743a32f4e0ba26c91c7cbc8c3d8b44b.

Solidity: event SettleProposal(uint256 id, bool success)

func (*ConsortiumManagementFilterer) FilterUpdateOperatorHealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterUpdateOperatorHealthEndpoint(opts *bind.FilterOpts) (*ConsortiumManagementUpdateOperatorHealthEndpointIterator, error)

FilterUpdateOperatorHealthEndpoint is a free log retrieval operation binding the contract event 0x8daf704ffb23b2e479e9849d1bda8860345f6c15d43b68cd9cf8622952564895.

Solidity: event UpdateOperatorHealthEndpoint(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) FilterVote Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) FilterVote(opts *bind.FilterOpts) (*ConsortiumManagementVoteIterator, error)

FilterVote is a free log retrieval operation binding the contract event 0xcfa82ef0390c8f3e57ebe6c0665352a383667e792af012d350d9786ee5173d26.

Solidity: event Vote(uint256 id, address voter, bool approve)

func (*ConsortiumManagementFilterer) WatchAddOperator Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchAddOperator(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementAddOperator) (event.Subscription, error)

WatchAddOperator is a free log subscription operation binding the contract event 0xc1ad0c93e1873e80f0551582678c47e2e3cd93d9f12f18b1012ed1ad51654d74.

Solidity: event AddOperator(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) WatchPropose Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchPropose(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementPropose) (event.Subscription, error)

WatchPropose is a free log subscription operation binding the contract event 0x8665d2ae7d62e4273cdfc40af1cbbea2232b315ca2a2e244c833366f2b8ae9eb.

Solidity: event Propose(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity)

func (*ConsortiumManagementFilterer) WatchRemoveOperator Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchRemoveOperator(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementRemoveOperator) (event.Subscription, error)

WatchRemoveOperator is a free log subscription operation binding the contract event 0xb157cf3e9ae29eb366b3bdda54b41d4738ada5daa73f8d2f1bef6280bb1418e4.

Solidity: event RemoveOperator(address member, address operator)

func (*ConsortiumManagementFilterer) WatchSettleProposal Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchSettleProposal(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementSettleProposal) (event.Subscription, error)

WatchSettleProposal is a free log subscription operation binding the contract event 0xf412ee5dcd836b3a4fa40ae9d7e90eeea743a32f4e0ba26c91c7cbc8c3d8b44b.

Solidity: event SettleProposal(uint256 id, bool success)

func (*ConsortiumManagementFilterer) WatchUpdateOperatorHealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchUpdateOperatorHealthEndpoint(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementUpdateOperatorHealthEndpoint) (event.Subscription, error)

WatchUpdateOperatorHealthEndpoint is a free log subscription operation binding the contract event 0x8daf704ffb23b2e479e9849d1bda8860345f6c15d43b68cd9cf8622952564895.

Solidity: event UpdateOperatorHealthEndpoint(address member, address operator, string endpoint)

func (*ConsortiumManagementFilterer) WatchVote Uses

func (_ConsortiumManagement *ConsortiumManagementFilterer) WatchVote(opts *bind.WatchOpts, sink chan<- *ConsortiumManagementVote) (event.Subscription, error)

WatchVote is a free log subscription operation binding the contract event 0xcfa82ef0390c8f3e57ebe6c0665352a383667e792af012d350d9786ee5173d26.

Solidity: event Vote(uint256 id, address voter, bool approve)

type ConsortiumManagementPropose Uses

type ConsortiumManagementPropose struct {
    Id       *big.Int
    Proposer common.Address
    Ptype    uint8
    Member   common.Address
    Capacity uint8
    Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementPropose represents a Propose event raised by the ConsortiumManagement contract.

type ConsortiumManagementProposeIterator Uses

type ConsortiumManagementProposeIterator struct {
    Event *ConsortiumManagementPropose // Event containing the contract specifics and raw log
    // contains filtered or unexported fields
}

ConsortiumManagementProposeIterator is returned from FilterPropose and is used to iterate over the raw logs and unpacked data for Propose events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementProposeIterator) Close Uses

func (it *ConsortiumManagementProposeIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementProposeIterator) Error Uses

func (it *ConsortiumManagementProposeIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementProposeIterator) Next Uses

func (it *ConsortiumManagementProposeIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementRaw Uses

type ConsortiumManagementRaw struct {
    Contract *ConsortiumManagement // Generic contract binding to access the raw methods on
}

ConsortiumManagementRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*ConsortiumManagementRaw) Call Uses

func (_ConsortiumManagement *ConsortiumManagementRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*ConsortiumManagementRaw) Transact Uses

func (_ConsortiumManagement *ConsortiumManagementRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ConsortiumManagementRaw) Transfer Uses

func (_ConsortiumManagement *ConsortiumManagementRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ConsortiumManagementRemoveOperator Uses

type ConsortiumManagementRemoveOperator struct {
    Member   common.Address
    Operator common.Address
    Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementRemoveOperator represents a RemoveOperator event raised by the ConsortiumManagement contract.

type ConsortiumManagementRemoveOperatorIterator Uses

type ConsortiumManagementRemoveOperatorIterator struct {
    Event *ConsortiumManagementRemoveOperator // Event containing the contract specifics and raw log
    // contains filtered or unexported fields
}

ConsortiumManagementRemoveOperatorIterator is returned from FilterRemoveOperator and is used to iterate over the raw logs and unpacked data for RemoveOperator events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementRemoveOperatorIterator) Close Uses

func (it *ConsortiumManagementRemoveOperatorIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementRemoveOperatorIterator) Error Uses

func (it *ConsortiumManagementRemoveOperatorIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementRemoveOperatorIterator) Next Uses

func (it *ConsortiumManagementRemoveOperatorIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementSession Uses

type ConsortiumManagementSession struct {
    Contract     *ConsortiumManagement // Generic contract binding to set the session for
    CallOpts     bind.CallOpts         // Call options to use throughout this session
    TransactOpts bind.TransactOpts     // Transaction auth options to use throughout this session
}

ConsortiumManagementSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*ConsortiumManagementSession) AddOperator Uses

func (_ConsortiumManagement *ConsortiumManagementSession) AddOperator(operator common.Address, endpoint string) (*types.Transaction, error)

AddOperator is a paid mutator transaction binding the contract method 0x2430df89.

Solidity: function addOperator(address operator, string endpoint) returns()

func (*ConsortiumManagementSession) Approve Uses

func (_ConsortiumManagement *ConsortiumManagementSession) Approve(id *big.Int) (*types.Transaction, error)

Approve is a paid mutator transaction binding the contract method 0xb759f954.

Solidity: function approve(uint256 id) returns()

func (*ConsortiumManagementSession) Delegates Uses

func (_ConsortiumManagement *ConsortiumManagementSession) Delegates() ([]common.Address, error)

Delegates is a free data retrieval call binding the contract method 0x6138b19e.

Solidity: function delegates() constant returns(address[])

func (*ConsortiumManagementSession) Disapprove Uses

func (_ConsortiumManagement *ConsortiumManagementSession) Disapprove(id *big.Int) (*types.Transaction, error)

Disapprove is a paid mutator transaction binding the contract method 0x8008df4f.

Solidity: function disapprove(uint256 id) returns()

func (*ConsortiumManagementSession) HealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementSession) HealthEndpoint(operator common.Address) (string, error)

HealthEndpoint is a free data retrieval call binding the contract method 0xb44d5fc7.

Solidity: function healthEndpoint(address operator) constant returns(string)

func (*ConsortiumManagementSession) IsMember Uses

func (_ConsortiumManagement *ConsortiumManagementSession) IsMember(addr common.Address) (bool, error)

IsMember is a free data retrieval call binding the contract method 0xa230c524.

Solidity: function isMember(address addr) constant returns(bool)

func (*ConsortiumManagementSession) Members Uses

func (_ConsortiumManagement *ConsortiumManagementSession) Members() ([]common.Address, error)

Members is a free data retrieval call binding the contract method 0xbdd4d18d.

Solidity: function members() constant returns(address[])

func (*ConsortiumManagementSession) Operators Uses

func (_ConsortiumManagement *ConsortiumManagementSession) Operators(addr common.Address) ([]common.Address, error)

Operators is a free data retrieval call binding the contract method 0x13e7c9d8.

Solidity: function operators(address addr) constant returns(address[])

func (*ConsortiumManagementSession) Proposal Uses

func (_ConsortiumManagement *ConsortiumManagementSession) Proposal() (struct {
    Id          *big.Int
    Proposer    common.Address
    Ptype       uint8
    Member      common.Address
    Capacity    uint8
    Approves    []common.Address
    Disapproves []common.Address
}, error)

Proposal is a free data retrieval call binding the contract method 0x753ec103.

Solidity: function proposal() constant returns(uint256 id, address proposer, uint8 ptype, address member, uint8 capacity, address[] approves, address[] disapproves)

func (*ConsortiumManagementSession) ProposeMemberDeletion Uses

func (_ConsortiumManagement *ConsortiumManagementSession) ProposeMemberDeletion(addr common.Address) (*types.Transaction, error)

ProposeMemberDeletion is a paid mutator transaction binding the contract method 0x555ed8bb.

Solidity: function proposeMemberDeletion(address addr) returns()

func (*ConsortiumManagementSession) ProposeMemberModification Uses

func (_ConsortiumManagement *ConsortiumManagementSession) ProposeMemberModification(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeMemberModification is a paid mutator transaction binding the contract method 0xa03eb838.

Solidity: function proposeMemberModification(address addr, uint8 capacity) returns()

func (*ConsortiumManagementSession) ProposeNewMember Uses

func (_ConsortiumManagement *ConsortiumManagementSession) ProposeNewMember(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeNewMember is a paid mutator transaction binding the contract method 0x0f6d17f9.

Solidity: function proposeNewMember(address addr, uint8 capacity) returns()

func (*ConsortiumManagementSession) RemoveOperator Uses

func (_ConsortiumManagement *ConsortiumManagementSession) RemoveOperator(operator common.Address) (*types.Transaction, error)

RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a.

Solidity: function removeOperator(address operator) returns()

func (*ConsortiumManagementSession) UpdateHealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementSession) UpdateHealthEndpoint(operator common.Address, endpoint string) (*types.Transaction, error)

UpdateHealthEndpoint is a paid mutator transaction binding the contract method 0xe1d1f053.

Solidity: function updateHealthEndpoint(address operator, string endpoint) returns()

type ConsortiumManagementSettleProposal Uses

type ConsortiumManagementSettleProposal struct {
    Id      *big.Int
    Success bool
    Raw     types.Log // Blockchain specific contextual infos
}

ConsortiumManagementSettleProposal represents a SettleProposal event raised by the ConsortiumManagement contract.

type ConsortiumManagementSettleProposalIterator Uses

type ConsortiumManagementSettleProposalIterator struct {
    Event *ConsortiumManagementSettleProposal // Event containing the contract specifics and raw log
    // contains filtered or unexported fields
}

ConsortiumManagementSettleProposalIterator is returned from FilterSettleProposal and is used to iterate over the raw logs and unpacked data for SettleProposal events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementSettleProposalIterator) Close Uses

func (it *ConsortiumManagementSettleProposalIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementSettleProposalIterator) Error Uses

func (it *ConsortiumManagementSettleProposalIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementSettleProposalIterator) Next Uses

func (it *ConsortiumManagementSettleProposalIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementTransactor Uses

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

ConsortiumManagementTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewConsortiumManagementTransactor Uses

func NewConsortiumManagementTransactor(address common.Address, transactor bind.ContractTransactor) (*ConsortiumManagementTransactor, error)

NewConsortiumManagementTransactor creates a new write-only instance of ConsortiumManagement, bound to a specific deployed contract.

func (*ConsortiumManagementTransactor) AddOperator Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) AddOperator(opts *bind.TransactOpts, operator common.Address, endpoint string) (*types.Transaction, error)

AddOperator is a paid mutator transaction binding the contract method 0x2430df89.

Solidity: function addOperator(address operator, string endpoint) returns()

func (*ConsortiumManagementTransactor) Approve Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) Approve(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error)

Approve is a paid mutator transaction binding the contract method 0xb759f954.

Solidity: function approve(uint256 id) returns()

func (*ConsortiumManagementTransactor) Disapprove Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) Disapprove(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error)

Disapprove is a paid mutator transaction binding the contract method 0x8008df4f.

Solidity: function disapprove(uint256 id) returns()

func (*ConsortiumManagementTransactor) ProposeMemberDeletion Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) ProposeMemberDeletion(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error)

ProposeMemberDeletion is a paid mutator transaction binding the contract method 0x555ed8bb.

Solidity: function proposeMemberDeletion(address addr) returns()

func (*ConsortiumManagementTransactor) ProposeMemberModification Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) ProposeMemberModification(opts *bind.TransactOpts, addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeMemberModification is a paid mutator transaction binding the contract method 0xa03eb838.

Solidity: function proposeMemberModification(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactor) ProposeNewMember Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) ProposeNewMember(opts *bind.TransactOpts, addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeNewMember is a paid mutator transaction binding the contract method 0x0f6d17f9.

Solidity: function proposeNewMember(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactor) RemoveOperator Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) RemoveOperator(opts *bind.TransactOpts, operator common.Address) (*types.Transaction, error)

RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a.

Solidity: function removeOperator(address operator) returns()

func (*ConsortiumManagementTransactor) UpdateHealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementTransactor) UpdateHealthEndpoint(opts *bind.TransactOpts, operator common.Address, endpoint string) (*types.Transaction, error)

UpdateHealthEndpoint is a paid mutator transaction binding the contract method 0xe1d1f053.

Solidity: function updateHealthEndpoint(address operator, string endpoint) returns()

type ConsortiumManagementTransactorRaw Uses

type ConsortiumManagementTransactorRaw struct {
    Contract *ConsortiumManagementTransactor // Generic write-only contract binding to access the raw methods on
}

ConsortiumManagementTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*ConsortiumManagementTransactorRaw) Transact Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*ConsortiumManagementTransactorRaw) Transfer Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type ConsortiumManagementTransactorSession Uses

type ConsortiumManagementTransactorSession struct {
    Contract     *ConsortiumManagementTransactor // Generic contract transactor binding to set the session for
    TransactOpts bind.TransactOpts               // Transaction auth options to use throughout this session
}

ConsortiumManagementTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*ConsortiumManagementTransactorSession) AddOperator Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) AddOperator(operator common.Address, endpoint string) (*types.Transaction, error)

AddOperator is a paid mutator transaction binding the contract method 0x2430df89.

Solidity: function addOperator(address operator, string endpoint) returns()

func (*ConsortiumManagementTransactorSession) Approve Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) Approve(id *big.Int) (*types.Transaction, error)

Approve is a paid mutator transaction binding the contract method 0xb759f954.

Solidity: function approve(uint256 id) returns()

func (*ConsortiumManagementTransactorSession) Disapprove Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) Disapprove(id *big.Int) (*types.Transaction, error)

Disapprove is a paid mutator transaction binding the contract method 0x8008df4f.

Solidity: function disapprove(uint256 id) returns()

func (*ConsortiumManagementTransactorSession) ProposeMemberDeletion Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) ProposeMemberDeletion(addr common.Address) (*types.Transaction, error)

ProposeMemberDeletion is a paid mutator transaction binding the contract method 0x555ed8bb.

Solidity: function proposeMemberDeletion(address addr) returns()

func (*ConsortiumManagementTransactorSession) ProposeMemberModification Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) ProposeMemberModification(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeMemberModification is a paid mutator transaction binding the contract method 0xa03eb838.

Solidity: function proposeMemberModification(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactorSession) ProposeNewMember Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) ProposeNewMember(addr common.Address, capacity uint8) (*types.Transaction, error)

ProposeNewMember is a paid mutator transaction binding the contract method 0x0f6d17f9.

Solidity: function proposeNewMember(address addr, uint8 capacity) returns()

func (*ConsortiumManagementTransactorSession) RemoveOperator Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) RemoveOperator(operator common.Address) (*types.Transaction, error)

RemoveOperator is a paid mutator transaction binding the contract method 0xac8a584a.

Solidity: function removeOperator(address operator) returns()

func (*ConsortiumManagementTransactorSession) UpdateHealthEndpoint Uses

func (_ConsortiumManagement *ConsortiumManagementTransactorSession) UpdateHealthEndpoint(operator common.Address, endpoint string) (*types.Transaction, error)

UpdateHealthEndpoint is a paid mutator transaction binding the contract method 0xe1d1f053.

Solidity: function updateHealthEndpoint(address operator, string endpoint) returns()

type ConsortiumManagementUpdateOperatorHealthEndpoint Uses

type ConsortiumManagementUpdateOperatorHealthEndpoint struct {
    Member   common.Address
    Operator common.Address
    Endpoint string
    Raw      types.Log // Blockchain specific contextual infos
}

ConsortiumManagementUpdateOperatorHealthEndpoint represents a UpdateOperatorHealthEndpoint event raised by the ConsortiumManagement contract.

type ConsortiumManagementUpdateOperatorHealthEndpointIterator Uses

type ConsortiumManagementUpdateOperatorHealthEndpointIterator struct {
    Event *ConsortiumManagementUpdateOperatorHealthEndpoint // Event containing the contract specifics and raw log
    // contains filtered or unexported fields
}

ConsortiumManagementUpdateOperatorHealthEndpointIterator is returned from FilterUpdateOperatorHealthEndpoint and is used to iterate over the raw logs and unpacked data for UpdateOperatorHealthEndpoint events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementUpdateOperatorHealthEndpointIterator) Close Uses

func (it *ConsortiumManagementUpdateOperatorHealthEndpointIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementUpdateOperatorHealthEndpointIterator) Error Uses

func (it *ConsortiumManagementUpdateOperatorHealthEndpointIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementUpdateOperatorHealthEndpointIterator) Next Uses

func (it *ConsortiumManagementUpdateOperatorHealthEndpointIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type ConsortiumManagementVote Uses

type ConsortiumManagementVote struct {
    Id      *big.Int
    Voter   common.Address
    Approve bool
    Raw     types.Log // Blockchain specific contextual infos
}

ConsortiumManagementVote represents a Vote event raised by the ConsortiumManagement contract.

type ConsortiumManagementVoteIterator Uses

type ConsortiumManagementVoteIterator struct {
    Event *ConsortiumManagementVote // Event containing the contract specifics and raw log
    // contains filtered or unexported fields
}

ConsortiumManagementVoteIterator is returned from FilterVote and is used to iterate over the raw logs and unpacked data for Vote events raised by the ConsortiumManagement contract.

func (*ConsortiumManagementVoteIterator) Close Uses

func (it *ConsortiumManagementVoteIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*ConsortiumManagementVoteIterator) Error Uses

func (it *ConsortiumManagementVoteIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*ConsortiumManagementVoteIterator) Next Uses

func (it *ConsortiumManagementVoteIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type GetBlockTime Uses

type GetBlockTime func(uint64) (time.Time, error)

GetBlockTime defines a function to get block creation time

type GetCandidates Uses

type GetCandidates func(protocol.StateReader, uint64, bool, bool) ([]*state.Candidate, uint64, error)

GetCandidates returns the current candidates

type GetProbationList Uses

type GetProbationList func(protocol.StateReader, bool) (*vote.ProbationList, uint64, error)

GetProbationList returns current the ProbationList

type GetUnproductiveDelegate Uses

type GetUnproductiveDelegate func(protocol.StateReader) (*vote.UnproductiveDelegate, error)

GetUnproductiveDelegate returns unproductiveDelegate struct which contains a cache of upd info by epochs

type NativeStaking Uses

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

NativeStaking represents native staking struct

func NewNativeStaking Uses

func NewNativeStaking(readContract ReadContract) (*NativeStaking, error)

NewNativeStaking creates a NativeStaking instance

func (*NativeStaking) SetContract Uses

func (ns *NativeStaking) SetContract(contract string)

SetContract sets the contract address

func (*NativeStaking) Votes Uses

func (ns *NativeStaking) Votes(ctx context.Context, ts time.Time, correctGas bool) (*VoteTally, error)

Votes returns the votes on height

type Productivity Uses

type Productivity func(uint64, uint64) (map[string]uint64, error)

Productivity returns the number of produced blocks per producer

type Protocol Uses

type Protocol interface {
    protocol.Protocol
    protocol.ActionValidator
    protocol.GenesisStateCreator
    Delegates(context.Context, protocol.StateReader) (state.CandidateList, error)
    NextDelegates(context.Context, protocol.StateReader) (state.CandidateList, error)
    Candidates(context.Context, protocol.StateReader) (state.CandidateList, error)
    NextCandidates(context.Context, protocol.StateReader) (state.CandidateList, error)
    // CalculateCandidatesByHeight calculates candidate and returns candidates by chain height
    // TODO: remove height, and read it from state reader
    CalculateCandidatesByHeight(context.Context, protocol.StateReader, uint64) (state.CandidateList, error)
    // CalculateUnproductiveDelegates calculates unproductive delegate on current epoch
    CalculateUnproductiveDelegates(context.Context, protocol.StateReader) ([]string, error)
}

Protocol defines the protocol of handling votes

func FindProtocol Uses

func FindProtocol(registry *protocol.Registry) Protocol

FindProtocol finds the registered protocol from registry

func MustGetProtocol Uses

func MustGetProtocol(registry *protocol.Registry) Protocol

MustGetProtocol return a registered protocol from registry

func NewConsortiumCommittee Uses

func NewConsortiumCommittee(indexer *CandidateIndexer, readContract ReadContract, getBlockHash evm.GetBlockHash) (Protocol, error)

NewConsortiumCommittee creates a committee for consorium chain

func NewGovernanceChainCommitteeProtocol Uses

func NewGovernanceChainCommitteeProtocol(
    candidatesIndexer *CandidateIndexer,
    electionCommittee committee.Committee,
    initGravityChainHeight uint64,
    getBlockTime GetBlockTime,
    initialCandidatesInterval time.Duration,
    sh *Slasher,
) (Protocol, error)

NewGovernanceChainCommitteeProtocol creates a Poll Protocol which fetch result from governance chain

func NewLifeLongDelegatesProtocol Uses

func NewLifeLongDelegatesProtocol(delegates []genesis.Delegate) Protocol

NewLifeLongDelegatesProtocol creates a poll protocol with life long delegates

func NewProtocol Uses

func NewProtocol(
    cfg config.Config,
    candidateIndexer *CandidateIndexer,
    readContract ReadContract,
    getCandidates GetCandidates,
    getprobationList GetProbationList,
    getUnproductiveDelegate GetUnproductiveDelegate,
    electionCommittee committee.Committee,
    stakingProto *staking.Protocol,
    getBlockTimeFunc GetBlockTime,
    productivity Productivity,
    getBlockHash evm.GetBlockHash,
) (Protocol, error)

NewProtocol instantiates a rewarding protocol instance.

func NewStakingCommand Uses

func NewStakingCommand(stkV1 Protocol, stkV2 Protocol) (Protocol, error)

NewStakingCommand creates a staking command center to manage staking committee and new native staking

func NewStakingCommittee Uses

func NewStakingCommittee(
    ec committee.Committee,
    gs Protocol,
    readContract ReadContract,
    nativeStakingContractAddress string,
    nativeStakingContractCode string,
    scoreThreshold *big.Int,
) (Protocol, error)

NewStakingCommittee creates a staking committee which fetch result from governance chain and native staking

type ReadContract Uses

type ReadContract func(context.Context, string, []byte, bool) ([]byte, error)

ReadContract defines a callback function to read contract

type Slasher Uses

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

Slasher is the module to slash candidates

func NewSlasher Uses

func NewSlasher(
    gen *genesis.Genesis,
    productivity Productivity,
    getCandidates GetCandidates,
    getProbationList GetProbationList,
    getUnprodDelegate GetUnproductiveDelegate,
    indexer *CandidateIndexer,
    numCandidateDelegates, numDelegates, dardanellesNumSubEpochs, thres, koPeriod, maxKoPeriod uint64,
    koIntensity uint32,
) (*Slasher, error)

NewSlasher returns a new Slasher

func (*Slasher) CalculateProbationList Uses

func (sh *Slasher) CalculateProbationList(
    ctx context.Context,
    sm protocol.StateManager,
    epochNum uint64,
) (*vote.ProbationList, error)

CalculateProbationList calculates probation list according to productivity

func (*Slasher) CreateGenesisStates Uses

func (sh *Slasher) CreateGenesisStates(ctx context.Context, sm protocol.StateManager, indexer *CandidateIndexer) error

CreateGenesisStates creates genesis state for slasher

func (*Slasher) CreatePreStates Uses

func (sh *Slasher) CreatePreStates(ctx context.Context, sm protocol.StateManager, indexer *CandidateIndexer) error

CreatePreStates is to setup probation list

func (*Slasher) GetABPFromIndexer Uses

func (sh *Slasher) GetABPFromIndexer(ctx context.Context, epochStartHeight uint64) (state.CandidateList, error)

GetABPFromIndexer returns active BP list from indexer

func (*Slasher) GetActiveBlockProducers Uses

func (sh *Slasher) GetActiveBlockProducers(ctx context.Context, sr protocol.StateReader, readFromNext bool) (state.CandidateList, error)

GetActiveBlockProducers returns active BP list

func (*Slasher) GetBPFromIndexer Uses

func (sh *Slasher) GetBPFromIndexer(ctx context.Context, epochStartHeight uint64) (state.CandidateList, error)

GetBPFromIndexer returns BP list from indexer

func (*Slasher) GetBlockProducers Uses

func (sh *Slasher) GetBlockProducers(ctx context.Context, sr protocol.StateReader, readFromNext bool) (state.CandidateList, error)

GetBlockProducers returns BP list

func (*Slasher) GetCandidates Uses

func (sh *Slasher) GetCandidates(ctx context.Context, sr protocol.StateReader, readFromNext bool) (state.CandidateList, error)

GetCandidates returns filtered candidate list

func (*Slasher) GetCandidatesFromIndexer Uses

func (sh *Slasher) GetCandidatesFromIndexer(ctx context.Context, epochStartHeight uint64) (state.CandidateList, error)

GetCandidatesFromIndexer returns candidate list from indexer

func (*Slasher) GetProbationList Uses

func (sh *Slasher) GetProbationList(ctx context.Context, sr protocol.StateReader, readFromNext bool) (*vote.ProbationList, error)

GetProbationList returns the probation list at given epoch

func (*Slasher) ReadState Uses

func (sh *Slasher) ReadState(
    ctx context.Context,
    sr protocol.StateReader,
    indexer *CandidateIndexer,
    method []byte,
    args ...[]byte,
) ([]byte, error)

ReadState defines slasher's read methods.

type VoteTally Uses

type VoteTally struct {
    Candidates map[[12]byte]*state.Candidate
    Buckets    []*types.Bucket
}

VoteTally is a map of candidates on native chain

Package poll imports 46 packages (graph) and is imported by 6 packages. Updated 2020-07-07. Refresh now. Tools for package owners.