Documentation ¶
Index ¶
- type Config
- type Election
- func (e *Election) CancelProxy() (common.Hash, error)
- func (e *Election) CancelVote() (common.Hash, error)
- func (e *Election) QueryCandidates() ([]byte, error)
- func (e *Election) QueryRestVNTBounty() (*big.Int, error)
- func (e *Election) QueryStake() ([]byte, error)
- func (e *Election) QueryVote() ([]byte, error)
- func (e *Election) RegisterWitness(nodeName, nodeUrl, website string) (common.Hash, error)
- func (e *Election) SetProxy(addr string) (common.Hash, error)
- func (e *Election) Stake(stakeCnt string) (common.Hash, error)
- func (e *Election) StartProxy() (common.Hash, error)
- func (e *Election) StopProxy() (common.Hash, error)
- func (e *Election) UnregisterWitness() (common.Hash, error)
- func (e *Election) Unstake() (common.Hash, error)
- func (e *Election) Vote(witnessAddr []string) (common.Hash, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Account information Sender common.Address `json:sender` Password string `json:password` KeystoreDir string `json:keystoreDir` // Network information RpcUrl string `json:rpcUrl` // ip:port, example: localhost:8080 ChainID int `json:chainID` }
Config contains accounts information and RPC information of a vnt node.
type Election ¶
type Election struct {
// contains filtered or unexported fields
}
Election creates transactions and sends to hubble network nodes using RPC. It checks conditions before creating transaction, signs the transaction with your account and password.
func NewElection ¶
NewElection returns a Election, or an error if initializing Election failed.
func (*Election) CancelProxy ¶
CancelProxy returns tx hash of cancel setting vote proxy if passed condition check and tx has been send, or an error if failed.
func (*Election) CancelVote ¶
CancelVote returns tx hash of cancellation vote for witness if passed condition check and tx has been send, or an error if failed.
func (*Election) QueryCandidates ¶
QueryCandidates returns a witnesses list in json format, or an error if failed.
func (*Election) QueryRestVNTBounty ¶
QueryRestVNTBounty returns a integer of the rest vnt bounty in wei, or an error if failed.
func (*Election) QueryStake ¶
QueryStake returns stake information of the account in json format, or an error if failed.
func (*Election) QueryVote ¶
QueryVote returns vote information of the account in json format, or an error if failed.
func (*Election) RegisterWitness ¶
RegisterWitness returns tx hash of registering witness if passed condition check and tx has been send, or an error if failed.
func (*Election) SetProxy ¶
SetProxy returns tx hash of setting vote proxy if passed condition check and tx has been send, or an error if failed.
func (*Election) Stake ¶
Stake returns a tx hash of staking VNT if passed condition check and tx has been send, or an error if failed.
func (*Election) StartProxy ¶
StartProxy returns tx hash of becoming a vote proxy if passed condition check and tx has been send, or an error if failed.
func (*Election) StopProxy ¶
StopProxy returns tx hash of back to a normal voter if passed condition check and tx has been send, or an error if failed.
func (*Election) UnregisterWitness ¶
UnregisterWitness returns tx hash of unregistering witness if passed condition check and tx has been send, or an error if failed.