Documentation ¶
Index ¶
- Constants
- func ABCIValidatorUpdate(pubkey crypto.PubKey, power int64) abci.ValidatorUpdate
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func ParamKeyTable() paramtypes.KeyTable
- type Keeper
- func (k Keeper) AddNode(ctx sdk.Context, name string, cert string) (id tmbytes.HexBytes, err error)
- func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k *Keeper) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error
- func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error)
- func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- func (k Keeper) CreateValidator(ctx sdk.Context, id tmbytes.HexBytes, name string, certificate string, ...) error
- func (k Keeper) Delegation(context sdk.Context, accAddr sdk.AccAddress, consAddr sdk.ValAddress) staking.DelegationI
- func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
- func (k Keeper) DeleteNode(ctx sdk.Context, id tmbytes.HexBytes)
- func (k Keeper) DeleteValidator(ctx sdk.Context, validator types.Validator)
- func (k Keeper) DeleteValidatorConsAddrIndex(ctx sdk.Context, addr sdk.ConsAddress)
- func (k Keeper) DequeueValidatorsUpdate(ctx sdk.Context, pubkey string)
- func (k Keeper) EnqueueValidatorsUpdate(ctx sdk.Context, validator types.Validator, power int64)
- func (k Keeper) FilterNodeByID(ctx sdk.Context, nodeID string) abci.ResponseQuery
- func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo
- func (k Keeper) GetAllValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
- func (k Keeper) GetLastValidators(ctx sdk.Context) (validators []types.Validator)
- func (k Keeper) GetNode(ctx sdk.Context, id tmbytes.HexBytes) (node types.Node, found bool)
- func (k Keeper) GetNodes(ctx sdk.Context) []types.Node
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k *Keeper) GetRootCert(ctx sdk.Context) (cert string, found bool)
- func (k Keeper) GetValidator(ctx sdk.Context, id tmbytes.HexBytes) (validator types.Validator, found bool)
- func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) (validator types.Validator, found bool)
- func (k Keeper) HasNode(ctx sdk.Context, id tmbytes.HexBytes) bool
- func (k Keeper) HasValidatorName(ctx sdk.Context, name string) bool
- func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32)
- func (k *Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, ...)
- func (k *Keeper) IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, ...)
- func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(types.HistoricalInfo) bool)
- func (k Keeper) IterateUpdateValidators(ctx sdk.Context, fn func(index int64, pubkey string, power int64) (stop bool))
- func (k Keeper) IterateValidators(ctx sdk.Context, ...)
- func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxValidators(context sdk.Context) uint32
- func (k Keeper) RemoveNode(ctx sdk.Context, id tmbytes.HexBytes) error
- func (k Keeper) RemoveValidator(ctx sdk.Context, id tmbytes.HexBytes, operator string) error
- func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi types.HistoricalInfo)
- func (k *Keeper) SetHooks(sh staking.StakingHooks) *Keeper
- func (k Keeper) SetNode(ctx sdk.Context, id tmbytes.HexBytes, node types.Node)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetRootCert(ctx sdk.Context, cert string)
- func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)
- func (k Keeper) SetValidatorConsAddrIndex(ctx sdk.Context, id tmbytes.HexBytes, addr sdk.ConsAddress)
- func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, i int64, i2 int64, dec sdk.Dec)
- func (k *Keeper) TotalBondedTokens(ctx sdk.Context) sdk.Int
- func (k Keeper) TrackHistoricalInfo(ctx sdk.Context)
- func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)
- func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) UpdateValidator(ctx sdk.Context, id tmbytes.HexBytes, name string, certificate string, ...) error
- func (k Keeper) Validator(ctx sdk.Context, valAddr sdk.ValAddress) staking.ValidatorI
- func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) staking.ValidatorI
- func (k Keeper) ValidatorByID(ctx sdk.Context, id tmbytes.HexBytes) staking.ValidatorI
- func (k *Keeper) VerifyCert(ctx sdk.Context, certStr string) (cert ca.Cert, err error)
- func (k Keeper) VerifyCertificate(ctx sdk.Context, certificate string) (crypto.PubKey, error)
- type Querier
- func (q Querier) Node(c context.Context, req *types.QueryNodeRequest) (*types.QueryNodeResponse, error)
- func (q Querier) Nodes(c context.Context, req *types.QueryNodesRequest) (*types.QueryNodesResponse, error)
- func (q Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (q Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
- func (q Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error)
Constants ¶
const (
DefaultParamspace = types.ModuleName
)
Default parameter namespace
Variables ¶
This section is empty.
Functions ¶
func ABCIValidatorUpdate ¶
func ABCIValidatorUpdate(pubkey crypto.PubKey, power int64) abci.ValidatorUpdate
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the node MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
keeper of the node store
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, ps paramtypes.Subspace) *Keeper
func (Keeper) AddNode ¶
AddNode adds a node
func (Keeper) AfterDelegationModified ¶
func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
AfterDelegationModified - call hook if registered
func (*Keeper) AfterUnbondingInitiated ¶
func (Keeper) AfterValidatorBeginUnbonding ¶
func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBeginUnbonding - call hook if registered
func (Keeper) AfterValidatorBonded ¶
func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBonded - call hook if registered
func (Keeper) AfterValidatorCreated ¶
AfterValidatorCreated - call hook if registered
func (Keeper) AfterValidatorRemoved ¶
func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorRemoved - call hook if registered
func (Keeper) ApplyAndReturnValidatorSetUpdates ¶
func (Keeper) BeforeDelegationCreated ¶
func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationCreated - call hook if registered
func (Keeper) BeforeDelegationRemoved ¶
func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationRemoved - call hook if registered
func (Keeper) BeforeDelegationSharesModified ¶
func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationSharesModified - call hook if registered
func (Keeper) BeforeValidatorModified ¶
BeforeValidatorModified - call hook if registered
func (Keeper) BeforeValidatorSlashed ¶
func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
BeforeValidatorSlashed - call hook if registered
func (Keeper) CreateValidator ¶
func (k Keeper) CreateValidator(ctx sdk.Context, id tmbytes.HexBytes, name string, certificate string, pubKey cryptotypes.PubKey, power int64, description string, operator string, ) error
CreateValidator create a new validator
func (Keeper) Delegation ¶
func (k Keeper) Delegation(context sdk.Context, accAddr sdk.AccAddress, consAddr sdk.ValAddress) staking.DelegationI
func (Keeper) DeleteHistoricalInfo ¶
DeleteHistoricalInfo deletes the historical info at a given height
func (Keeper) DeleteNode ¶
DeleteNode deletes the given node
func (Keeper) DeleteValidator ¶
DeleteValidator deletes the validator with id
func (Keeper) DeleteValidatorConsAddrIndex ¶
func (k Keeper) DeleteValidatorConsAddrIndex(ctx sdk.Context, addr sdk.ConsAddress)
DeleteValidatorConsAddrIndex deletes the validator index with pubkey
func (Keeper) DequeueValidatorsUpdate ¶
DequeueValidatorsUpdate dequeue from the validators update queue
func (Keeper) EnqueueValidatorsUpdate ¶
EnqueueValidatorsUpdate enqueue to the validators update queue
func (Keeper) FilterNodeByID ¶
FilterNodeByID implements sdk.PeerFilter
func (Keeper) GetAllHistoricalInfo ¶
func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []types.HistoricalInfo
GetAllHistoricalInfo returns all stored HistoricalInfo objects.
func (Keeper) GetAllValidators ¶
GetAllValidators gets the set of all validators with no limits, used during genesis dump
func (Keeper) GetHistoricalInfo ¶
func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
GetHistoricalInfo gets the historical info at a given height
func (Keeper) GetLastValidators ¶
get the group of the bonded validators
func (Keeper) GetNode ¶
GetNode retrieves the node of the specified ID
func (Keeper) GetNodes ¶
GetNodes gets all nodes
func (Keeper) GetParams ¶
Get all parameteras as types.Params
func (*Keeper) GetRootCert ¶
func (Keeper) GetValidator ¶
func (k Keeper) GetValidator(ctx sdk.Context, id tmbytes.HexBytes) (validator types.Validator, found bool)
GetValidator returns validator with id
func (Keeper) GetValidatorByConsAddr ¶
func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) (validator types.Validator, found bool)
GetValidatorByConsAddr returns validator with pubkey
func (Keeper) HasNode ¶
HasNode returns true if the specified node exists, false otherwise
func (Keeper) HasValidatorName ¶
HasValidatorName returns true or false with name
func (Keeper) HistoricalEntries ¶
HistoricalEntries = number of historical info entries to persist in store
func (*Keeper) IterateBondedValidatorsByPower ¶
func (*Keeper) IterateDelegations ¶
func (k *Keeper) IterateDelegations( ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation staking.DelegationI) (stop bool), )
func (Keeper) IterateHistoricalInfo ¶
IterateHistoricalInfo provides an interator over all stored HistoricalInfo
objects. For each HistoricalInfo object, cb will be called. If the cb returns
true, the iterator will close and stop.
func (Keeper) IterateUpdateValidators ¶
func (k Keeper) IterateUpdateValidators(ctx sdk.Context, fn func(index int64, pubkey string, power int64) (stop bool))
IterateUpdateValidators iterates through the validators update queue
func (Keeper) IterateValidators ¶
func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator staking.ValidatorI) (stop bool))
IterateValidators iterates through the validator set and perform the provided function
func (Keeper) Jail ¶
func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)
Jail disable the validator
func (Keeper) Logger ¶
Logger returns a module-specific logger.
func (Keeper) RemoveNode ¶
RemoveNode removes the specified node
func (Keeper) RemoveValidator ¶
RemoveValidator deletes an existing validator record
func (Keeper) SetHistoricalInfo ¶
SetHistoricalInfo sets the historical info at a given height
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(sh staking.StakingHooks) *Keeper
SetHooks sets the validator hooks
func (Keeper) SetNode ¶
SetNode sets the given node
func (Keeper) SetParams ¶
set the params
func (Keeper) SetValidator ¶
SetValidator sets the main record holding validator details
func (Keeper) SetValidatorConsAddrIndex ¶
func (k Keeper) SetValidatorConsAddrIndex(ctx sdk.Context, id tmbytes.HexBytes, addr sdk.ConsAddress)
SetValidatorConsAddrIndex sets the validator index by pubkey
func (Keeper) Slash ¶
Slash not implement
func (Keeper) TrackHistoricalInfo ¶
TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height
func (Keeper) UnbondingTime ¶
UnbondingTime
func (Keeper) Unjail ¶
func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)
Unjail enable the validator
func (Keeper) UpdateValidator ¶
func (k Keeper) UpdateValidator(ctx sdk.Context, id tmbytes.HexBytes, name string, certificate string, power int64, description string, operator string, ) error
UpdateValidator updates an existing validator record
func (Keeper) Validator ¶
func (k Keeper) Validator(ctx sdk.Context, valAddr sdk.ValAddress) staking.ValidatorI
Validator return the validator imformation by valAddr
func (Keeper) ValidatorByConsAddr ¶
func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) staking.ValidatorI
ValidatorByConsAddr return the validator imformation by consAddr
func (Keeper) ValidatorByID ¶
ValidatorByID return the validator imformation by id
func (*Keeper) VerifyCert ¶
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper
func (Querier) Node ¶
func (q Querier) Node(c context.Context, req *types.QueryNodeRequest) (*types.QueryNodeResponse, error)
Node queries a node by id
func (Querier) Nodes ¶
func (q Querier) Nodes(c context.Context, req *types.QueryNodesRequest) (*types.QueryNodesResponse, error)
Nodes queries all nodes
func (Querier) Params ¶
func (q Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the node module
func (Querier) Validator ¶
func (q Querier) Validator(c context.Context, req *types.QueryValidatorRequest) (*types.QueryValidatorResponse, error)
Validator queries the validator by the given id
func (Querier) Validators ¶
func (q Querier) Validators(c context.Context, req *types.QueryValidatorsRequest) (*types.QueryValidatorsResponse, error)
Validators queries the validators