Documentation ¶
Index ¶
- Constants
- Variables
- func AddressForValidatorByNetworkIDKey(key, networkID []byte) sdk.Address
- func AddressFromKey(key []byte) []byte
- func ErrBadDelegationAmount(codespace sdk.CodespaceType) sdk.Error
- func ErrBadDenom(codespace sdk.CodespaceType) sdk.Error
- func ErrBadSendAmount(codespace sdk.CodespaceType) sdk.Error
- func ErrCantHandleEvidence(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidNetworkIdentifier(codespace sdk.CodespaceType, err error) sdk.Error
- func ErrInvalidServiceURL(codespace sdk.CodespaceType, err error) sdk.Error
- func ErrMinimumEditStake(codespace sdk.CodespaceType) sdk.Error
- func ErrMinimumStake(codespace sdk.CodespaceType) sdk.Error
- func ErrMissingSelfDelegation(codespace sdk.CodespaceType) sdk.Error
- func ErrNilValidatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrNoChains(codespace sdk.CodespaceType) sdk.Error
- func ErrNoServiceURL(codespace sdk.CodespaceType) sdk.Error
- func ErrNoSigningInfoFound(codespace sdk.CodespaceType, consAddr sdk.Address) sdk.Error
- func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
- func ErrNoValidatorFound(codespace sdk.CodespaceType) sdk.Error
- func ErrNotEnoughCoins(codespace sdk.CodespaceType) sdk.Error
- func ErrSelfDelegationTooLowToUnjail(codespace sdk.CodespaceType) sdk.Error
- func ErrStateConversion(codespace sdk.CodespaceType, err error) sdk.Error
- func ErrTooManyChains(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorNotJailed(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorPubKeyExists(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorPubKeyTypeNotSupported(codespace sdk.CodespaceType, keyType string, supportedTypes []string) sdk.Error
- func ErrValidatorStatus(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorTombstoned(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorWaitingToUnstake(codespace sdk.CodespaceType) sdk.Error
- func GetValMissedBlockKey(v sdk.Address, i int64) []byte
- func GetValMissedBlockPrefixKey(v sdk.Address) []byte
- func GetValidatorSigningInfoAddress(key []byte) (addr sdk.Address, err error)
- func InitConfig(validatorCacheSize int64)
- func KeyForUnstakingValidators(unstakingTime time.Time) []byte
- func KeyForValByAllVals(addr sdk.Address) []byte
- func KeyForValWaitingToBeginUnstaking(addr sdk.Address) []byte
- func KeyForValidatorAward(address sdk.Address) []byte
- func KeyForValidatorBurn(address sdk.Address) []byte
- func KeyForValidatorByNetworkID(addr sdk.Address, networkID []byte) []byte
- func KeyForValidatorInStakingSet(validator Validator) []byte
- func KeyForValidatorPrevStateStateByPower(address sdk.Address) []byte
- func KeyForValidatorSigningInfo(v sdk.Address) []byte
- func KeyForValidatorsByNetworkID(networkID []byte) []byte
- func RegisterCodec(cdc *codec.Codec)
- func ValidateNetworkIdentifier(chain string) sdk.Error
- func ValidateServiceURL(u string) sdk.Error
- type AuthKeeper
- type CodeType
- type GenesisState
- type JSONValidator
- type MissedBlock
- type MsgBeginUnstake
- func (*MsgBeginUnstake) Descriptor() ([]byte, []int)
- func (this *MsgBeginUnstake) Equal(that interface{}) bool
- func (msg MsgBeginUnstake) GetFee() sdk.BigInt
- func (msg MsgBeginUnstake) GetRecipient() sdk.Address
- func (msg MsgBeginUnstake) GetSignBytes() []byte
- func (msg MsgBeginUnstake) GetSigner() sdk.Address
- func (m *MsgBeginUnstake) Marshal() (dAtA []byte, err error)
- func (m *MsgBeginUnstake) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgBeginUnstake) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgBeginUnstake) ProtoMessage()
- func (m *MsgBeginUnstake) Reset()
- func (msg MsgBeginUnstake) Route() string
- func (m *MsgBeginUnstake) Size() (n int)
- func (m *MsgBeginUnstake) String() string
- func (msg MsgBeginUnstake) Type() string
- func (m *MsgBeginUnstake) Unmarshal(dAtA []byte) error
- func (msg MsgBeginUnstake) ValidateBasic() sdk.Error
- func (m *MsgBeginUnstake) XXX_DiscardUnknown()
- func (m *MsgBeginUnstake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgBeginUnstake) XXX_Merge(src proto.Message)
- func (*MsgBeginUnstake) XXX_MessageName() string
- func (m *MsgBeginUnstake) XXX_Size() int
- func (m *MsgBeginUnstake) XXX_Unmarshal(b []byte) error
- type MsgProtoStake
- func (*MsgProtoStake) Descriptor() ([]byte, []int)
- func (this *MsgProtoStake) Equal(that interface{}) bool
- func (m *MsgProtoStake) Marshal() (dAtA []byte, err error)
- func (m *MsgProtoStake) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgProtoStake) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgProtoStake) ProtoMessage()
- func (m *MsgProtoStake) Reset()
- func (m *MsgProtoStake) Size() (n int)
- func (m *MsgProtoStake) String() string
- func (m *MsgProtoStake) Unmarshal(dAtA []byte) error
- func (m *MsgProtoStake) XXX_DiscardUnknown()
- func (m *MsgProtoStake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgProtoStake) XXX_Merge(src proto.Message)
- func (*MsgProtoStake) XXX_MessageName() string
- func (m *MsgProtoStake) XXX_Size() int
- func (m *MsgProtoStake) XXX_Unmarshal(b []byte) error
- type MsgSend
- func (*MsgSend) Descriptor() ([]byte, []int)
- func (this *MsgSend) Equal(that interface{}) bool
- func (msg MsgSend) GetFee() sdk.BigInt
- func (m *MsgSend) GetFromAddress() github_com_pokt_network_pocket_core_types.Address
- func (msg MsgSend) GetRecipient() sdk.Address
- func (msg MsgSend) GetSignBytes() []byte
- func (msg MsgSend) GetSigner() sdk.Address
- func (m *MsgSend) GetToAddress() github_com_pokt_network_pocket_core_types.Address
- func (m *MsgSend) Marshal() (dAtA []byte, err error)
- func (m *MsgSend) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSend) ProtoMessage()
- func (m *MsgSend) Reset()
- func (msg MsgSend) Route() string
- func (m *MsgSend) Size() (n int)
- func (m *MsgSend) String() string
- func (msg MsgSend) Type() string
- func (m *MsgSend) Unmarshal(dAtA []byte) error
- func (msg MsgSend) ValidateBasic() sdk.Error
- func (m *MsgSend) XXX_DiscardUnknown()
- func (m *MsgSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSend) XXX_Merge(src proto.Message)
- func (*MsgSend) XXX_MessageName() string
- func (m *MsgSend) XXX_Size() int
- func (m *MsgSend) XXX_Unmarshal(b []byte) error
- type MsgStake
- func (msg MsgStake) GetFee() sdk.BigInt
- func (msg MsgStake) GetRecipient() sdk.Address
- func (msg MsgStake) GetSignBytes() []byte
- func (msg MsgStake) GetSigner() sdk.Address
- func (msg *MsgStake) Marshal() ([]byte, error)
- func (msg *MsgStake) MarshalTo(data []byte) (n int, err error)
- func (msg *MsgStake) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (msg *MsgStake) ProtoMessage()
- func (msg *MsgStake) Reset()
- func (msg MsgStake) Route() string
- func (msg *MsgStake) Size() int
- func (msg MsgStake) String() string
- func (msg MsgStake) ToProto() MsgProtoStake
- func (msg MsgStake) Type() string
- func (msg *MsgStake) Unmarshal(data []byte) error
- func (msg MsgStake) ValidateBasic() sdk.Error
- func (msg *MsgStake) XXX_MessageName() string
- type MsgUnjail
- func (*MsgUnjail) Descriptor() ([]byte, []int)
- func (this *MsgUnjail) Equal(that interface{}) bool
- func (msg MsgUnjail) GetFee() sdk.BigInt
- func (msg MsgUnjail) GetRecipient() sdk.Address
- func (msg MsgUnjail) GetSignBytes() []byte
- func (msg MsgUnjail) GetSigner() sdk.Address
- func (m *MsgUnjail) Marshal() (dAtA []byte, err error)
- func (m *MsgUnjail) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgUnjail) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgUnjail) ProtoMessage()
- func (m *MsgUnjail) Reset()
- func (msg MsgUnjail) Route() string
- func (m *MsgUnjail) Size() (n int)
- func (m *MsgUnjail) String() string
- func (msg MsgUnjail) Type() string
- func (m *MsgUnjail) Unmarshal(dAtA []byte) error
- func (msg MsgUnjail) ValidateBasic() sdk.Error
- func (m *MsgUnjail) XXX_DiscardUnknown()
- func (m *MsgUnjail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgUnjail) XXX_Merge(src proto.Message)
- func (*MsgUnjail) XXX_MessageName() string
- func (m *MsgUnjail) XXX_Size() int
- func (m *MsgUnjail) XXX_Unmarshal(b []byte) error
- type Params
- type PocketKeeper
- type Pool
- type PrevStatePowerMapping
- type ProtoValidator
- func (*ProtoValidator) Descriptor() ([]byte, []int)
- func (this *ProtoValidator) Equal(that interface{}) bool
- func (v ProtoValidator) FromProto() (Validator, error)
- func (m *ProtoValidator) Marshal() (dAtA []byte, err error)
- func (m *ProtoValidator) MarshalTo(dAtA []byte) (int, error)
- func (m *ProtoValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProtoValidator) ProtoMessage()
- func (m *ProtoValidator) Reset()
- func (m *ProtoValidator) Size() (n int)
- func (m *ProtoValidator) String() string
- func (m *ProtoValidator) Unmarshal(dAtA []byte) error
- func (m *ProtoValidator) XXX_DiscardUnknown()
- func (m *ProtoValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProtoValidator) XXX_Merge(src proto.Message)
- func (m *ProtoValidator) XXX_Size() int
- func (m *ProtoValidator) XXX_Unmarshal(b []byte) error
- type QueryAccountBalanceParams
- type QueryAccountParams
- type QuerySigningInfoParams
- type QuerySigningInfosParams
- type QueryStakedValidatorsParams
- type QueryUnstakedValidatorsParams
- type QueryUnstakingValidatorsParams
- type QueryValidatorParams
- type QueryValidatorsParams
- type StakingPool
- type Validator
- func (v Validator) ABCIValidatorUpdate() abci.ValidatorUpdate
- func (v Validator) AddStakedTokens(tokens sdk.BigInt) (Validator, error)
- func (v Validator) ConsensusPower() int64
- func (v Validator) Equals(v2 Validator) bool
- func (v Validator) GetAddress() sdk.Address
- func (v Validator) GetChains() []string
- func (v Validator) GetConsensusPower() int64
- func (v Validator) GetPublicKey() crypto.PublicKey
- func (v Validator) GetServiceURL() string
- func (v Validator) GetStatus() sdk.StakeStatus
- func (v Validator) GetTokens() sdk.BigInt
- func (v Validator) HasChain(netID string) bool
- func (v Validator) IsJailed() bool
- func (v Validator) IsStaked() bool
- func (v Validator) IsUnstaked() bool
- func (v Validator) IsUnstaking() bool
- func (v Validator) Marshal() ([]byte, error)
- func (v Validator) MarshalJSON() ([]byte, error)
- func (v Validator) MarshalTo(data []byte) (n int, err error)
- func (v Validator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (v Validator) ProtoMessage()
- func (v Validator) RemoveStakedTokens(tokens sdk.BigInt) (Validator, error)
- func (v *Validator) Reset()
- func (v Validator) Size() int
- func (v Validator) String() string
- func (v Validator) ToProto() ProtoValidator
- func (v *Validator) Unmarshal(data []byte) error
- func (v *Validator) UnmarshalJSON(data []byte) error
- func (v Validator) UpdateStatus(newStatus sdk.StakeStatus) Validator
- type ValidatorSet
- type ValidatorSigningInfo
- func (*ValidatorSigningInfo) Descriptor() ([]byte, []int)
- func (this *ValidatorSigningInfo) Equal(that interface{}) bool
- func (m *ValidatorSigningInfo) GetAddress() github_com_pokt_network_pocket_core_types.Address
- func (m *ValidatorSigningInfo) GetIndex() int64
- func (m *ValidatorSigningInfo) GetJailedBlocksCounter() int64
- func (m *ValidatorSigningInfo) GetJailedUntil() time.Time
- func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64
- func (m *ValidatorSigningInfo) GetStartHeight() int64
- func (m *ValidatorSigningInfo) Marshal() (dAtA []byte, err error)
- func (m *ValidatorSigningInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *ValidatorSigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ValidatorSigningInfo) ProtoMessage()
- func (m *ValidatorSigningInfo) Reset()
- func (i *ValidatorSigningInfo) ResetSigningInfo()
- func (m *ValidatorSigningInfo) Size() (n int)
- func (i ValidatorSigningInfo) String() string
- func (m *ValidatorSigningInfo) Unmarshal(dAtA []byte) error
- func (m *ValidatorSigningInfo) XXX_DiscardUnknown()
- func (m *ValidatorSigningInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidatorSigningInfo) XXX_Merge(src proto.Message)
- func (m *ValidatorSigningInfo) XXX_Size() int
- func (m *ValidatorSigningInfo) XXX_Unmarshal(b []byte) error
- type Validators
- type ValidatorsPage
Constants ¶
const ( EventTypeCompleteUnstaking = "complete_unstaking" EventTypeCreateValidator = "create_validator" EventTypeStake = "stake" EventTypeBeginUnstake = "begin_unstake" EventTypeWaitingToBeginUnstaking = "waiting_to_begin_unstaking" EventTypeUnstake = "unstake" EventTypeProposerReward = "proposer_reward" EventTypeDAOAllocation = "dao_allocation" EventTypeSlash = "slash" EventTypeJail = "jail" EventTypeLiveness = "liveness" AttributeKeyAddress = "address" AttributeKeyHeight = "height" AttributeKeyPower = "power" AttributeKeyReason = "reason" AttributeKeyJailed = "jailed" AttributeKeyMissedBlocks = "missed_blocks" AttributeValueDoubleSign = "double_sign" AttributeValueMissingSignature = "missing_signature" AttributeKeyValidator = "validator" AttributeValueCategory = ModuleName )
pos module event types
const ( StakeFee = 10000 UnstakeFee = 10000 UnjailFee = 10000 SendFee = 10000 )
const ( ModuleName = "pos" // nodes module is called 'pos' for proof of stake StoreKey = ModuleName // StoreKey is the string store representation TStoreKey = "transient_" + ModuleName // TStoreKey is the string transient store representation QuerierRoute = ModuleName // QuerierRoute is the querier route for the staking module RouterKey = ModuleName // RouterKey is the msg router key for the staking module )
const ( MsgStakeName = "stake_validator" MsgUnstakeName = "begin_unstake_validator" MsgUnjailName = "unjail_validator" MsgSendName = "send" )
const ( // DefaultParamspace for params keeper DefaultRelaysToTokensMultiplier int64 = 1000 DefaultParamspace = ModuleName DefaultUnstakingTime = time.Hour * 24 * 7 * 3 DefaultMaxValidators int64 = 5000 DefaultMinStake int64 = 1000000 DefaultMaxEvidenceAge = 60 * 2 * time.Second DefaultSignedBlocksWindow = int64(100) DefaultDowntimeJailDuration = 60 * 10 * time.Second DefaultSessionBlocktime = 25 DefaultProposerAllocation = 1 DefaultDAOAllocation = 10 DefaultMaxChains = 15 DefaultMaxJailedBlocks = 1000 )
POS params default values
const ( QueryValidators = "validators" QueryValidator = "validator" QueryStakedPool = "stakedPool" QueryUnstakedPool = "unstakedPool" QueryParameters = "parameters" QueryTotalSupply = "total_supply" QuerySigningInfo = "signingInfo" QuerySigningInfos = "signingInfos" QueryAccountBalance = "account_balance" QueryAccount = "account" )
query endpoints supported by the staking Querier
const (
NetworkIdentifierLength = 2
)
const (
StakedPoolName = "staked_tokens_pool"
)
names used as root for pool module accounts: - StakingPool -> "staked_tokens_pool"
Variables ¶
var ( ProposerKey = []byte{0x01} // key for the proposer address used for rewards ValidatorSigningInfoKey = []byte{0x11} // Prefix for signing info used in slashing ValidatorMissedBlockBitArrayKey = []byte{0x12} // Prefix for missed block bit array used in slashing AllValidatorsKey = []byte{0x21} // prefix for each key to a validator StakedValidatorsByNetIDKey = []byte{0x22} // prefix for validators staked by networkID StakedValidatorsKey = []byte{0x23} // prefix for each key to a staked validator index, sorted by power PrevStateValidatorsPowerKey = []byte{0x31} // prefix for the key to the validators of the prevState state PrevStateTotalPowerKey = []byte{0x32} // prefix for the total power of the prevState state UnstakingValidatorsKey = []byte{0x41} // prefix for unstaking validator AwardValidatorKey = []byte{0x51} // prefix for awarding validators BurnValidatorKey = []byte{0x52} // prefix for awarding validators WaitingToBeginUnstakingKey = []byte{0x43} // prefix for waiting validators )
var ( ErrInvalidLengthMsg = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMsg = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMsg = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthNodes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowNodes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupNodes = fmt.Errorf("proto: unexpected end of group") )
var ( KeyUnstakingTime = []byte("UnstakingTime") KeyMaxValidators = []byte("MaxValidators") KeyStakeDenom = []byte("StakeDenom") KeyStakeMinimum = []byte("StakeMinimum") KeyMaxEvidenceAge = []byte("MaxEvidenceAge") KeySignedBlocksWindow = []byte("SignedBlocksWindow") KeyMinSignedPerWindow = []byte("MinSignedPerWindow") KeyDowntimeJailDuration = []byte("DowntimeJailDuration") KeySlashFractionDoubleSign = []byte("SlashFractionDoubleSign") KeySlashFractionDowntime = []byte("SlashFractionDowntime") KeyRelaysToTokensMultiplier = []byte("RelaysToTokensMultiplier") KeySessionBlock = []byte("BlocksPerSession") KeyDAOAllocation = []byte("DAOAllocation") KeyProposerAllocation = []byte("ProposerPercentage") KeyMaxChains = []byte("MaximumChains") KeyMaxJailedBlocks = []byte("MaxJailedBlocks") DoubleSignJailEndTime = time.Unix(253402300799, 0) // forever DefaultMinSignedPerWindow = sdk.NewDecWithPrec(5, 1) DefaultSlashFractionDoubleSign = sdk.NewDec(1).Quo(sdk.NewDec(20)) DefaultSlashFractionDowntime = sdk.NewDec(1).Quo(sdk.NewDec(100)) )
- Keys for parameter access
var ModuleCdc *codec.Codec // generic sealed codec to be used throughout this module
var ( NodeFeeMap = map[string]int64{ MsgStakeName: StakeFee, MsgUnstakeName: UnstakeFee, MsgUnjailName: UnjailFee, MsgSendName: SendFee, } )
var ValidatorCacheSize int64 = 5
Functions ¶
func AddressFromKey ¶
Removes the prefix bytes from a key to expose true address
func ErrBadDelegationAmount ¶
func ErrBadDelegationAmount(codespace sdk.CodespaceType) sdk.Error
func ErrBadDenom ¶
func ErrBadDenom(codespace sdk.CodespaceType) sdk.Error
func ErrBadSendAmount ¶
func ErrBadSendAmount(codespace sdk.CodespaceType) sdk.Error
func ErrCantHandleEvidence ¶
func ErrCantHandleEvidence(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidNetworkIdentifier ¶
func ErrInvalidNetworkIdentifier(codespace sdk.CodespaceType, err error) sdk.Error
func ErrInvalidServiceURL ¶
func ErrInvalidServiceURL(codespace sdk.CodespaceType, err error) sdk.Error
func ErrMinimumEditStake ¶
func ErrMinimumEditStake(codespace sdk.CodespaceType) sdk.Error
func ErrMinimumStake ¶
func ErrMinimumStake(codespace sdk.CodespaceType) sdk.Error
func ErrMissingSelfDelegation ¶
func ErrMissingSelfDelegation(codespace sdk.CodespaceType) sdk.Error
func ErrNilValidatorAddr ¶
func ErrNilValidatorAddr(codespace sdk.CodespaceType) sdk.Error
func ErrNoChains ¶
func ErrNoChains(codespace sdk.CodespaceType) sdk.Error
func ErrNoServiceURL ¶
func ErrNoServiceURL(codespace sdk.CodespaceType) sdk.Error
func ErrNoSigningInfoFound ¶
func ErrNoValidatorForAddress ¶
func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
func ErrNoValidatorFound ¶
func ErrNoValidatorFound(codespace sdk.CodespaceType) sdk.Error
func ErrNotEnoughCoins ¶
func ErrNotEnoughCoins(codespace sdk.CodespaceType) sdk.Error
func ErrSelfDelegationTooLowToUnjail ¶
func ErrSelfDelegationTooLowToUnjail(codespace sdk.CodespaceType) sdk.Error
func ErrStateConversion ¶
func ErrStateConversion(codespace sdk.CodespaceType, err error) sdk.Error
func ErrTooManyChains ¶
func ErrTooManyChains(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorJailed ¶
func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorNotJailed ¶
func ErrValidatorNotJailed(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorPubKeyExists ¶
func ErrValidatorPubKeyExists(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorStatus ¶
func ErrValidatorStatus(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorTombstoned ¶
func ErrValidatorTombstoned(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorWaitingToUnstake ¶
func ErrValidatorWaitingToUnstake(codespace sdk.CodespaceType) sdk.Error
func GetValMissedBlockKey ¶
generates the key for missing val who missed block through consensus addr
func GetValMissedBlockPrefixKey ¶
generates the prefix key for missing val who missed block through consensus addr
func GetValidatorSigningInfoAddress ¶
extract the address from a validator signing info key
func InitConfig ¶
func InitConfig(validatorCacheSize int64)
func KeyForUnstakingValidators ¶
generates the key for unstaking validators by the unstakingtime
func KeyForValByAllVals ¶
generates the key for the validator with address
func KeyForValidatorAward ¶
generates the award key for a validator in the current state
func KeyForValidatorBurn ¶
func KeyForValidatorInStakingSet ¶
generates the key for a validator in the staking set
func KeyForValidatorPrevStateStateByPower ¶
generates the key for a validator in the prevState state
func KeyForValidatorSigningInfo ¶
generates the key for validator signing information by consensus addr
func ValidateServiceURL ¶
Types ¶
type AuthKeeper ¶
type AuthKeeper interface { // get total supply of tokens GetSupply(ctx sdk.Ctx) authexported.SupplyI // set total supply of tokens SetSupply(ctx sdk.Ctx, supply authexported.SupplyI) // get the address of a module account GetModuleAddress(name string) sdk.Address // get the module account structure GetModuleAccount(ctx sdk.Ctx, moduleName string) authexported.ModuleAccountI // set module account structure SetModuleAccount(sdk.Ctx, authexported.ModuleAccountI) // send coins to/from module accounts SendCoinsFromModuleToModule(ctx sdk.Ctx, senderModule, recipientModule string, amt sdk.Coins) sdk.Error // send coins from module to validator SendCoinsFromModuleToAccount(ctx sdk.Ctx, senderModule string, recipientAddr sdk.Address, amt sdk.Coins) sdk.Error // send coins from validator to module SendCoinsFromAccountToModule(ctx sdk.Ctx, senderAddr sdk.Address, recipientModule string, amt sdk.Coins) sdk.Error // mint coins MintCoins(ctx sdk.Ctx, moduleName string, amt sdk.Coins) sdk.Error // burn coins BurnCoins(ctx sdk.Ctx, name string, amt sdk.Coins) sdk.Error // iterate accounts IterateAccounts(ctx sdk.Ctx, process func(authexported.Account) (stop bool)) // get coins GetCoins(ctx sdk.Ctx, addr sdk.Address) sdk.Coins // set coins SetCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) sdk.Error // has coins HasCoins(ctx sdk.Ctx, addr sdk.Address, amt sdk.Coins) bool // send coins SendCoins(ctx sdk.Ctx, fromAddr sdk.Address, toAddr sdk.Address, amt sdk.Coins) sdk.Error // get account GetAccount(ctx sdk.Ctx, addr sdk.Address) authexported.Account }
AuthKeeper defines the expected supply Keeper (noalias)
type CodeType ¶
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeInvalidValidator CodeType = 101 CodeInvalidDelegation CodeType = 102 CodeInvalidInput CodeType = 103 CodeValidatorJailed CodeType = 104 CodeValidatorNotJailed CodeType = 105 CodeMissingSelfDelegation CodeType = 106 CodeMissingSigningInfo CodeType = 108 CodeBadSend CodeType = 109 CodeInvalidStatus CodeType = 110 CodeMinimumStake CodeType = 111 CodeNotEnoughCoins CodeType = 112 CodeValidatorTombstoned CodeType = 113 CodeCantHandleEvidence CodeType = 114 CodeNoChains CodeType = 115 CodeNoServiceURL CodeType = 116 CodeWaitingValidator CodeType = 117 CodeInvalidServiceURL CodeType = 118 CodeInvalidNetworkIdentifier CodeType = 119 CodeTooManyChains CodeType = 120 CodeStateConvertError CodeType = 121 CodeMinimumEditStake CodeType = 122 )
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` PrevStateTotalPower sdk.BigInt `json:"prevState_total_power" yaml:"prevState_total_power"` PrevStateValidatorPowers []PrevStatePowerMapping `json:"prevState_validator_powers" yaml:"prevState_validator_powers"` Validators []Validator `json:"validators" yaml:"validators"` Exported bool `json:"exported" yaml:"exported"` SigningInfos map[string]ValidatorSigningInfo `json:"signing_infos" yaml:"signing_infos"` MissedBlocks map[string][]MissedBlock `json:"missed_blocks" yaml:"missed_blocks"` PreviousProposer sdk.Address `json:"previous_proposer" yaml:"previous_proposer"` }
GenesisState - all staking state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
type JSONValidator ¶
type JSONValidator struct { Address sdk.Address `json:"address" yaml:"address"` // address of the validator; hex encoded in JSON PublicKey string `json:"public_key" yaml:"public_key"` // the consensus public key of the validator; hex encoded in JSON Jailed bool `json:"jailed" yaml:"jailed"` // has the validator been jailed from staked status? Status sdk.StakeStatus `json:"status" yaml:"status"` // validator status (staked/unstaking/unstaked) Chains []string `json:"chains" yaml:"chains"` // validator non native blockchains ServiceURL string `json:"service_url" yaml:"service_url"` // url where the pocket service api is hosted StakedTokens sdk.BigInt `json:"tokens" yaml:"tokens"` // tokens staked in the network UnstakingCompletionTime time.Time `json:"unstaking_time" yaml:"unstaking_time"` // if unstaking, min time for the validator to complete unstaking }
type MissedBlock ¶
type MissedBlock struct { Index int64 `json:"index" yaml:"index"` Missed bool `json:"missed" yaml:"missed"` }
MissedBlock
type MsgBeginUnstake ¶
type MsgBeginUnstake struct {
Address github_com_pokt_network_pocket_core_types.Address `` /* 151-byte string literal not displayed */
}
func (*MsgBeginUnstake) Descriptor ¶
func (*MsgBeginUnstake) Descriptor() ([]byte, []int)
func (*MsgBeginUnstake) Equal ¶
func (this *MsgBeginUnstake) Equal(that interface{}) bool
func (MsgBeginUnstake) GetFee ¶
func (msg MsgBeginUnstake) GetFee() sdk.BigInt
GetFee get fee for msg
func (MsgBeginUnstake) GetRecipient ¶
func (msg MsgBeginUnstake) GetRecipient() sdk.Address
func (MsgBeginUnstake) GetSignBytes ¶
func (msg MsgBeginUnstake) GetSignBytes() []byte
GetSignBytes returns the message bytes to sign over.
func (MsgBeginUnstake) GetSigner ¶
func (msg MsgBeginUnstake) GetSigner() sdk.Address
GetSigners return address(es) that must sign over msg.GetSignBytes()
func (*MsgBeginUnstake) Marshal ¶
func (m *MsgBeginUnstake) Marshal() (dAtA []byte, err error)
func (*MsgBeginUnstake) MarshalToSizedBuffer ¶
func (m *MsgBeginUnstake) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgBeginUnstake) ProtoMessage ¶
func (*MsgBeginUnstake) ProtoMessage()
func (*MsgBeginUnstake) Reset ¶
func (m *MsgBeginUnstake) Reset()
func (MsgBeginUnstake) Route ¶
func (msg MsgBeginUnstake) Route() string
Route provides router key for msg
func (*MsgBeginUnstake) Size ¶
func (m *MsgBeginUnstake) Size() (n int)
func (*MsgBeginUnstake) String ¶
func (m *MsgBeginUnstake) String() string
func (*MsgBeginUnstake) Unmarshal ¶
func (m *MsgBeginUnstake) Unmarshal(dAtA []byte) error
func (MsgBeginUnstake) ValidateBasic ¶
func (msg MsgBeginUnstake) ValidateBasic() sdk.Error
ValidateBasic quick validity check, stateless
func (*MsgBeginUnstake) XXX_DiscardUnknown ¶
func (m *MsgBeginUnstake) XXX_DiscardUnknown()
func (*MsgBeginUnstake) XXX_Marshal ¶
func (m *MsgBeginUnstake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgBeginUnstake) XXX_Merge ¶
func (m *MsgBeginUnstake) XXX_Merge(src proto.Message)
func (*MsgBeginUnstake) XXX_MessageName ¶
func (*MsgBeginUnstake) XXX_MessageName() string
func (*MsgBeginUnstake) XXX_Size ¶
func (m *MsgBeginUnstake) XXX_Size() int
func (*MsgBeginUnstake) XXX_Unmarshal ¶
func (m *MsgBeginUnstake) XXX_Unmarshal(b []byte) error
type MsgProtoStake ¶
type MsgProtoStake struct { Publickey []byte `protobuf:"bytes,1,opt,name=Publickey,proto3" json:"public_key" yaml:"public_key"` Chains []string `protobuf:"bytes,2,rep,name=Chains,proto3" json:"chains" yaml:"chains"` Value github_com_pokt_network_pocket_core_types.BigInt `` /* 126-byte string literal not displayed */ ServiceUrl string `protobuf:"bytes,4,opt,name=ServiceUrl,proto3" json:"service_url" yaml:"service_url"` }
func (*MsgProtoStake) Descriptor ¶
func (*MsgProtoStake) Descriptor() ([]byte, []int)
func (*MsgProtoStake) Equal ¶
func (this *MsgProtoStake) Equal(that interface{}) bool
func (*MsgProtoStake) Marshal ¶
func (m *MsgProtoStake) Marshal() (dAtA []byte, err error)
func (*MsgProtoStake) MarshalToSizedBuffer ¶
func (m *MsgProtoStake) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgProtoStake) ProtoMessage ¶
func (*MsgProtoStake) ProtoMessage()
func (*MsgProtoStake) Reset ¶
func (m *MsgProtoStake) Reset()
func (*MsgProtoStake) Size ¶
func (m *MsgProtoStake) Size() (n int)
func (*MsgProtoStake) String ¶
func (m *MsgProtoStake) String() string
func (*MsgProtoStake) Unmarshal ¶
func (m *MsgProtoStake) Unmarshal(dAtA []byte) error
func (*MsgProtoStake) XXX_DiscardUnknown ¶
func (m *MsgProtoStake) XXX_DiscardUnknown()
func (*MsgProtoStake) XXX_Marshal ¶
func (m *MsgProtoStake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgProtoStake) XXX_Merge ¶
func (m *MsgProtoStake) XXX_Merge(src proto.Message)
func (*MsgProtoStake) XXX_MessageName ¶
func (*MsgProtoStake) XXX_MessageName() string
func (*MsgProtoStake) XXX_Size ¶
func (m *MsgProtoStake) XXX_Size() int
func (*MsgProtoStake) XXX_Unmarshal ¶
func (m *MsgProtoStake) XXX_Unmarshal(b []byte) error
type MsgSend ¶
type MsgSend struct { FromAddress github_com_pokt_network_pocket_core_types.Address `` /* 145-byte string literal not displayed */ ToAddress github_com_pokt_network_pocket_core_types.Address `` /* 139-byte string literal not displayed */ Amount github_com_pokt_network_pocket_core_types.BigInt `` /* 129-byte string literal not displayed */ }
func (*MsgSend) Descriptor ¶
func (*MsgSend) GetFromAddress ¶
func (m *MsgSend) GetFromAddress() github_com_pokt_network_pocket_core_types.Address
func (MsgSend) GetRecipient ¶
func (MsgSend) GetSignBytes ¶
GetSignBytes returns the message bytes to sign over.
func (*MsgSend) GetToAddress ¶
func (m *MsgSend) GetToAddress() github_com_pokt_network_pocket_core_types.Address
func (*MsgSend) MarshalToSizedBuffer ¶
func (*MsgSend) ProtoMessage ¶
func (*MsgSend) ProtoMessage()
func (MsgSend) ValidateBasic ¶
ValidateBasic quick validity check, stateless
func (*MsgSend) XXX_DiscardUnknown ¶
func (m *MsgSend) XXX_DiscardUnknown()
func (*MsgSend) XXX_Marshal ¶
func (*MsgSend) XXX_MessageName ¶
func (*MsgSend) XXX_Unmarshal ¶
type MsgStake ¶
type MsgStake struct { PublicKey crypto.PublicKey `json:"public_key" yaml:"public_key"` Chains []string `json:"chains" yaml:"chains"` Value sdk.BigInt `json:"value" yaml:"value"` ServiceUrl string `json:"service_url" yaml:"service_url"` }
MsgStake - struct for staking transactions
func (MsgStake) GetRecipient ¶
func (MsgStake) GetSignBytes ¶
GetSignBytes returns the message bytes to sign over.
func (*MsgStake) MarshalToSizedBuffer ¶
func (*MsgStake) ProtoMessage ¶
func (msg *MsgStake) ProtoMessage()
func (MsgStake) ValidateBasic ¶
ValidateBasic quick validity check, stateless
func (*MsgStake) XXX_MessageName ¶
type MsgUnjail ¶
type MsgUnjail struct {
ValidatorAddr github_com_pokt_network_pocket_core_types.Address `` /* 137-byte string literal not displayed */
}
func (*MsgUnjail) Descriptor ¶
func (MsgUnjail) GetRecipient ¶
func (MsgUnjail) GetSignBytes ¶
GetSignBytes returns the message bytes to sign over.
func (*MsgUnjail) MarshalToSizedBuffer ¶
func (*MsgUnjail) ProtoMessage ¶
func (*MsgUnjail) ProtoMessage()
func (MsgUnjail) ValidateBasic ¶
ValidateBasic quick validity check, stateless
func (*MsgUnjail) XXX_DiscardUnknown ¶
func (m *MsgUnjail) XXX_DiscardUnknown()
func (*MsgUnjail) XXX_Marshal ¶
func (*MsgUnjail) XXX_MessageName ¶
func (*MsgUnjail) XXX_Unmarshal ¶
type Params ¶
type Params struct { RelaysToTokensMultiplier int64 `json:"relays_to_tokens_multiplier" yaml:"relays_to_tokens_multiplier"` UnstakingTime time.Duration `json:"unstaking_time" yaml:"unstaking_time"` // how much time must pass between the begin_unstaking_tx and the node going to -> unstaked status MaxValidators int64 `json:"max_validators" yaml:"max_validators"` // maximum number of validators in the network at any given block StakeDenom string `json:"stake_denom" yaml:"stake_denom"` // the monetary denomination of the coins in the network `uPOKT` or `uAtom` or `Wei` StakeMinimum int64 `json:"stake_minimum" yaml:"stake_minimum"` // minimum amount of `uPOKT` needed to stake in the network as a node SessionBlockFrequency int64 `json:"session_block_frequency" yaml:"session_block_frequency"` // how many blocks are in a session (pocket network unit) DAOAllocation int64 `json:"dao_allocation" yaml:"dao_allocation"` ProposerAllocation int64 `json:"proposer_allocation" yaml:"proposer_allocation"` MaximumChains int64 `json:"maximum_chains" yaml:"maximum_chains"` MaxJailedBlocks int64 `json:"max_jailed_blocks" yaml:"max_jailed_blocks"` MaxEvidenceAge time.Duration `json:"max_evidence_age" yaml:"max_evidence_age"` // maximum age of tendermint evidence that is still valid (currently not implemented in Cosmos or Pocket-Core) SignedBlocksWindow int64 `json:"signed_blocks_window" yaml:"signed_blocks_window"` // window of time in blocks (unit) used for signature verification -> specifically in not signing (missing) blocks MinSignedPerWindow sdk.BigDec `json:"min_signed_per_window" yaml:"min_signed_per_window"` // minimum number of blocks the node must sign per window DowntimeJailDuration time.Duration `json:"downtime_jail_duration" yaml:"downtime_jail_duration"` // minimum amount of time node must spend in jail after missing blocks SlashFractionDoubleSign sdk.BigDec `json:"slash_fraction_double_sign" yaml:"slash_fraction_double_sign"` // the factor of which a node is slashed for a double sign SlashFractionDowntime sdk.BigDec `json:"slash_fraction_downtime" yaml:"slash_fraction_downtime"` // the factor of which a node is slashed for missing blocks }
Params defines the high level settings for pos module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() sdk.ParamSetPairs
Implements sdk.ParamSet
type PocketKeeper ¶
type PocketKeeper interface {
// clear the cache of validators for sessions and relays
ClearSessionCache()
}
type PrevStatePowerMapping ¶
PrevState validator power, needed for validator set update logic
type ProtoValidator ¶
type ProtoValidator struct { Address github_com_pokt_network_pocket_core_types.Address `` /* 131-byte string literal not displayed */ PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"public_key" yaml:"public_key"` Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` Chains []string `protobuf:"bytes,5,rep,name=Chains,proto3" json:"chains"` ServiceURL string `protobuf:"bytes,6,opt,name=ServiceURL,proto3" json:"service_url"` StakedTokens github_com_pokt_network_pocket_core_types.BigInt `protobuf:"bytes,7,opt,name=StakedTokens,proto3,customtype=github.com/pokt-network/pocket-core/types.BigInt" json:"tokens"` UnstakingCompletionTime time.Time `protobuf:"bytes,8,opt,name=UnstakingCompletionTime,proto3,stdtime" json:"unstaking_time" yaml:"unstaking_time"` }
func (*ProtoValidator) Descriptor ¶
func (*ProtoValidator) Descriptor() ([]byte, []int)
func (*ProtoValidator) Equal ¶
func (this *ProtoValidator) Equal(that interface{}) bool
func (ProtoValidator) FromProto ¶
func (v ProtoValidator) FromProto() (Validator, error)
FromProto converts the Protobuf structure to Validator
func (*ProtoValidator) Marshal ¶
func (m *ProtoValidator) Marshal() (dAtA []byte, err error)
func (*ProtoValidator) MarshalToSizedBuffer ¶
func (m *ProtoValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProtoValidator) ProtoMessage ¶
func (*ProtoValidator) ProtoMessage()
func (*ProtoValidator) Reset ¶
func (m *ProtoValidator) Reset()
func (*ProtoValidator) Size ¶
func (m *ProtoValidator) Size() (n int)
func (*ProtoValidator) String ¶
func (m *ProtoValidator) String() string
func (*ProtoValidator) Unmarshal ¶
func (m *ProtoValidator) Unmarshal(dAtA []byte) error
func (*ProtoValidator) XXX_DiscardUnknown ¶
func (m *ProtoValidator) XXX_DiscardUnknown()
func (*ProtoValidator) XXX_Marshal ¶
func (m *ProtoValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProtoValidator) XXX_Merge ¶
func (m *ProtoValidator) XXX_Merge(src proto.Message)
func (*ProtoValidator) XXX_Size ¶
func (m *ProtoValidator) XXX_Size() int
func (*ProtoValidator) XXX_Unmarshal ¶
func (m *ProtoValidator) XXX_Unmarshal(b []byte) error
type QueryAccountParams ¶
type QuerySigningInfoParams ¶
func NewQuerySigningInfoParams ¶
func NewQuerySigningInfoParams(consAddr sdk.Address) QuerySigningInfoParams
type QuerySigningInfosParams ¶
type QuerySigningInfosParams struct {
Page, Limit int
}
func NewQuerySigningInfosParams ¶
func NewQuerySigningInfosParams(page, limit int) QuerySigningInfosParams
type QueryStakedValidatorsParams ¶
type QueryStakedValidatorsParams struct {
Page, Limit int
}
func NewQueryStakedValidatorsParams ¶
func NewQueryStakedValidatorsParams(page, limit int) QueryStakedValidatorsParams
type QueryUnstakedValidatorsParams ¶
type QueryUnstakedValidatorsParams struct {
Page, Limit int
}
func NewQueryUnstakedValidatorsParams ¶
func NewQueryUnstakedValidatorsParams(page, limit int) QueryUnstakedValidatorsParams
type QueryUnstakingValidatorsParams ¶
type QueryUnstakingValidatorsParams struct {
Page, Limit int
}
func NewQueryUnstakingValidatorsParams ¶
func NewQueryUnstakingValidatorsParams(page, limit int) QueryUnstakingValidatorsParams
type QueryValidatorParams ¶
func NewQueryValidatorParams ¶
func NewQueryValidatorParams(validatorAddr sdk.Address) QueryValidatorParams
type QueryValidatorsParams ¶
type QueryValidatorsParams struct { StakingStatus sdk.StakeStatus `json:"staking_status"` JailedStatus int `json:"jailed_status"` Blockchain string `json:"blockchain"` Page int `json:"page"` Limit int `json:"per_page"` }
func (QueryValidatorsParams) IsValid ¶
func (opts QueryValidatorsParams) IsValid(val Validator) bool
"IsValid" - Checks that the validator is valid for the options passed
type StakingPool ¶
type StakingPool Pool
Tokens - tracking staked token supply
func (StakingPool) String ¶
func (bp StakingPool) String() string
String returns a human readable string representation of a pool.
type Validator ¶
type Validator struct { Address sdk.Address `json:"address" yaml:"address"` // address of the validator; hex encoded in JSON PublicKey crypto.PublicKey `json:"public_key" yaml:"public_key"` // the consensus public key of the validator; hex encoded in JSON Jailed bool `json:"jailed" yaml:"jailed"` // has the validator been jailed from staked status? Status sdk.StakeStatus `json:"status" yaml:"status"` // validator status (staked/unstaking/unstaked) Chains []string `json:"chains" yaml:"chains"` // validator non native blockchains ServiceURL string `json:"service_url" yaml:"service_url"` // url where the pocket service api is hosted StakedTokens sdk.BigInt `json:"tokens" yaml:"tokens"` // tokens staked in the network UnstakingCompletionTime time.Time `json:"unstaking_time" yaml:"unstaking_time"` // if unstaking, min time for the validator to complete unstaking }
func NewValidator ¶
func NewValidator(addr sdk.Address, consPubKey crypto.PublicKey, chains []string, serviceURL string, tokensToStake sdk.BigInt) Validator
NewValidator - initialize a new validator
func UnmarshalValidator ¶
MUST decode the validator from the bytes
func (Validator) ABCIValidatorUpdate ¶
func (v Validator) ABCIValidatorUpdate() abci.ValidatorUpdate
ABCIValidatorUpdate returns an abci.ValidatorUpdate from a staking validator type with the full validator power
func (Validator) AddStakedTokens ¶
AddStakedTokens tokens to staked field for a validator
func (Validator) ConsensusPower ¶
get the consensus-engine power a reduction of 10^6 from validator tokens is applied
func (Validator) GetAddress ¶
func (Validator) GetConsensusPower ¶
func (Validator) GetPublicKey ¶
func (Validator) GetServiceURL ¶
func (Validator) GetStatus ¶
func (v Validator) GetStatus() sdk.StakeStatus
func (Validator) IsUnstaked ¶
func (Validator) IsUnstaking ¶
func (Validator) MarshalJSON ¶
MarshalJSON marshals the validator to JSON using Hex
func (Validator) MarshalToSizedBuffer ¶
func (Validator) ProtoMessage ¶
func (v Validator) ProtoMessage()
func (Validator) RemoveStakedTokens ¶
RemoveStakedTokens removes tokens from a validator
func (Validator) ToProto ¶
func (v Validator) ToProto() ProtoValidator
ToProto converts the validator to Protobuf compatible structure
func (*Validator) UnmarshalJSON ¶
UnmarshalJSON unmarshals the validator from JSON using Hex
func (Validator) UpdateStatus ¶
func (v Validator) UpdateStatus(newStatus sdk.StakeStatus) Validator
UpdateStatus updates the staking status
type ValidatorSet ¶
type ValidatorSet interface { // iterate through validators by address, execute func for each validator IterateAndExecuteOverVals(sdk.Ctx, func(index int64, validator posexported.ValidatorI) (stop bool)) // iterate through staked validators by address, execute func for each validator IterateAndExecuteOverStakedVals(sdk.Ctx, func(index int64, validator posexported.ValidatorI) (stop bool)) // iterate through the validator set of the prevState block by address, execute func for each validator IterateAndExecuteOverPrevStateVals(sdk.Ctx, func(index int64, validator posexported.ValidatorI) (stop bool)) // get a particular validator by address Validator(sdk.Ctx, sdk.Address) posexported.ValidatorI // total staked tokens within the validator set TotalTokens(sdk.Ctx) sdk.BigInt // jail a validator JailValidator(sdk.Ctx, sdk.Address) // unjail a validator UnjailValidator(sdk.Ctx, sdk.Address) // MaxValidators returns the maximum amount of staked validators MaxValidators(sdk.Ctx) int64 }
ValidatorSet expected properties for the set of all validators (noalias)
type ValidatorSigningInfo ¶
type ValidatorSigningInfo struct { Address github_com_pokt_network_pocket_core_types.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/pokt-network/pocket-core/types.Address" json:"address"` // height at which validator was first a candidate OR was unjailed StartHeight int64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height" yaml:"start_height"` // index offset into signed block bit array Index int64 `protobuf:"varint,3,opt,name=Index,proto3" json:"index_offset" yaml:"index_offset"` // timestamp validator cannot be unjailed until JailedUntil time.Time `protobuf:"bytes,4,opt,name=jailed_until,json=jailedUntil,proto3,stdtime" json:"jailed_until" yaml:"jailed_until"` // missed blocks counter (to avoid scanning the array every time) MissedBlocksCounter int64 `` /* 140-byte string literal not displayed */ JailedBlocksCounter int64 `` /* 140-byte string literal not displayed */ }
ValidatorSigningInfo defines the signing info for a validator
func (*ValidatorSigningInfo) Descriptor ¶
func (*ValidatorSigningInfo) Descriptor() ([]byte, []int)
func (*ValidatorSigningInfo) Equal ¶
func (this *ValidatorSigningInfo) Equal(that interface{}) bool
func (*ValidatorSigningInfo) GetAddress ¶
func (m *ValidatorSigningInfo) GetAddress() github_com_pokt_network_pocket_core_types.Address
func (*ValidatorSigningInfo) GetIndex ¶
func (m *ValidatorSigningInfo) GetIndex() int64
func (*ValidatorSigningInfo) GetJailedBlocksCounter ¶
func (m *ValidatorSigningInfo) GetJailedBlocksCounter() int64
func (*ValidatorSigningInfo) GetJailedUntil ¶
func (m *ValidatorSigningInfo) GetJailedUntil() time.Time
func (*ValidatorSigningInfo) GetMissedBlocksCounter ¶
func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64
func (*ValidatorSigningInfo) GetStartHeight ¶
func (m *ValidatorSigningInfo) GetStartHeight() int64
func (*ValidatorSigningInfo) Marshal ¶
func (m *ValidatorSigningInfo) Marshal() (dAtA []byte, err error)
func (*ValidatorSigningInfo) MarshalTo ¶
func (m *ValidatorSigningInfo) MarshalTo(dAtA []byte) (int, error)
func (*ValidatorSigningInfo) MarshalToSizedBuffer ¶
func (m *ValidatorSigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ValidatorSigningInfo) ProtoMessage ¶
func (*ValidatorSigningInfo) ProtoMessage()
func (*ValidatorSigningInfo) Reset ¶
func (m *ValidatorSigningInfo) Reset()
func (*ValidatorSigningInfo) ResetSigningInfo ¶
func (i *ValidatorSigningInfo) ResetSigningInfo()
func (*ValidatorSigningInfo) Size ¶
func (m *ValidatorSigningInfo) Size() (n int)
func (ValidatorSigningInfo) String ¶
func (i ValidatorSigningInfo) String() string
Return human readable signing info
func (*ValidatorSigningInfo) Unmarshal ¶
func (m *ValidatorSigningInfo) Unmarshal(dAtA []byte) error
func (*ValidatorSigningInfo) XXX_DiscardUnknown ¶
func (m *ValidatorSigningInfo) XXX_DiscardUnknown()
func (*ValidatorSigningInfo) XXX_Marshal ¶
func (m *ValidatorSigningInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidatorSigningInfo) XXX_Merge ¶
func (m *ValidatorSigningInfo) XXX_Merge(src proto.Message)
func (*ValidatorSigningInfo) XXX_Size ¶
func (m *ValidatorSigningInfo) XXX_Size() int
func (*ValidatorSigningInfo) XXX_Unmarshal ¶
func (m *ValidatorSigningInfo) XXX_Unmarshal(b []byte) error
type Validators ¶
type Validators []Validator
Validators is a collection of Validator
func (Validators) String ¶
func (v Validators) String() (out string)
type ValidatorsPage ¶
type ValidatorsPage struct { Result Validators `json:"result"` Total int `json:"total_pages"` Page int `json:"page"` }
func (ValidatorsPage) String ¶
func (vP ValidatorsPage) String() string
String returns a human readable string representation of a validator page