Documentation ¶
Index ¶
- Constants
- Variables
- func AddressFromKey(key []byte) []byte
- func AppsDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func ErrApplicationJailed(codespace sdk.CodespaceType) sdk.Error
- func ErrApplicationNotJailed(codespace sdk.CodespaceType) sdk.Error
- func ErrApplicationPubKeyExists(codespace sdk.CodespaceType) sdk.Error
- func ErrApplicationPubKeyTypeNotSupported(codespace sdk.CodespaceType, keyType string, supportedTypes []string) sdk.Error
- func ErrApplicationStatus(codespace sdk.CodespaceType) sdk.Error
- func ErrBadApplicationAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrBadStakeAmount(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidNetworkIdentifier(codespace sdk.CodespaceType, err error) sdk.Error
- func ErrMaxApplications(codespace sdk.CodespaceType) sdk.Error
- func ErrMinimumEditStake(codespace sdk.CodespaceType) sdk.Error
- func ErrMinimumStake(codespace sdk.CodespaceType) sdk.Error
- func ErrMissingAppStake(codespace sdk.CodespaceType) sdk.Error
- func ErrNilApplicationAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrNoApplicationForAddress(codespace sdk.CodespaceType) sdk.Error
- func ErrNoApplicationFound(codespace sdk.CodespaceType) sdk.Error
- func ErrNoChains(codespace sdk.CodespaceType) sdk.Error
- func ErrNotEnoughCoins(codespace sdk.CodespaceType) sdk.Error
- func ErrStakeTooLow(codespace sdk.CodespaceType) sdk.Error
- func ErrTooManyChains(Codespace sdk.CodespaceType) sdk.Error
- func InitConfig(applicationCacheSize int64)
- func KeyForAppBurn(address sdk.Address) []byte
- func KeyForAppByAllApps(addr sdk.Address) []byte
- func KeyForAppInStakingSet(app Application) []byte
- func KeyForUnstakingApps(unstakingTime time.Time) []byte
- func MarshalApplication(cdc *codec.Codec, ctx sdk.Ctx, application Application) (result []byte, err error)
- func RegisterCodec(cdc *codec.Codec)
- func ValidateNetworkIdentifier(chain string) sdk.Error
- type Application
- func (a Application) AddStakedTokens(tokens sdk.BigInt) (Application, error)
- func (a Application) ConsensusPower() int64
- func (a Application) Equals(v2 Application) bool
- func (a Application) GetAddress() sdk.Address
- func (a Application) GetChains() []string
- func (a Application) GetConsensusPower() int64
- func (a Application) GetMaxRelays() sdk.BigInt
- func (a Application) GetPublicKey() crypto.PublicKey
- func (a Application) GetStatus() sdk.StakeStatus
- func (a Application) GetTokens() sdk.BigInt
- func (a Application) IsJailed() bool
- func (a Application) IsStaked() bool
- func (a Application) IsUnstaked() bool
- func (a Application) IsUnstaking() bool
- func (a Application) Marshal() ([]byte, error)
- func (a Application) MarshalJSON() ([]byte, error)
- func (a Application) MarshalTo(data []byte) (n int, err error)
- func (a Application) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (a Application) ProtoMessage()
- func (a Application) RemoveStakedTokens(tokens sdk.BigInt) (Application, error)
- func (a *Application) Reset()
- func (a Application) Size() int
- func (a Application) String() string
- func (a Application) ToProto() ProtoApplication
- func (a *Application) Unmarshal(data []byte) (err error)
- func (a *Application) UnmarshalJSON(data []byte) error
- func (a Application) UpdateStatus(newStatus sdk.StakeStatus) Application
- type ApplicationSet
- type Applications
- type ApplicationsPage
- type AuthKeeper
- type CodeType
- type GenesisState
- type JSONApplication
- 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) GetSigners() []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 MsgStake
- func (msg MsgStake) GetFee() sdk.BigInt
- func (msg MsgStake) GetRecipient() sdk.Address
- func (msg MsgStake) GetSignBytes() []byte
- func (msg MsgStake) GetSigners() []sdk.Address
- func (msg MsgStake) IsValidTransfer() sdk.Error
- 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) GetSigners() []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
- func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*Pool) Descriptor() ([]byte, []int)
- func (this *Pool) Equal(that interface{}) bool
- func (m *Pool) Marshal() (dAtA []byte, err error)
- func (m *Pool) MarshalTo(dAtA []byte) (int, error)
- func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Pool) ProtoMessage()
- func (m *Pool) Reset()
- func (m *Pool) Size() (n int)
- func (m *Pool) String() string
- func (m *Pool) Unmarshal(dAtA []byte) error
- func (m *Pool) XXX_DiscardUnknown()
- func (m *Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Pool) XXX_Merge(src proto.Message)
- func (m *Pool) XXX_Size() int
- func (m *Pool) XXX_Unmarshal(b []byte) error
- type PosKeeper
- type ProtoApplication
- func (*ProtoApplication) Descriptor() ([]byte, []int)
- func (this *ProtoApplication) Equal(that interface{}) bool
- func (ae ProtoApplication) FromProto() (Application, error)
- func (m *ProtoApplication) Marshal() (dAtA []byte, err error)
- func (m *ProtoApplication) MarshalTo(dAtA []byte) (int, error)
- func (m *ProtoApplication) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProtoApplication) ProtoMessage()
- func (m *ProtoApplication) Reset()
- func (m *ProtoApplication) Size() (n int)
- func (m *ProtoApplication) String() string
- func (m *ProtoApplication) Unmarshal(dAtA []byte) error
- func (m *ProtoApplication) XXX_DiscardUnknown()
- func (m *ProtoApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProtoApplication) XXX_Merge(src proto.Message)
- func (m *ProtoApplication) XXX_Size() int
- func (m *ProtoApplication) XXX_Unmarshal(b []byte) error
- type QueryAppParams
- type QueryApplicationsWithOpts
- type QueryAppsParams
- type QueryStakedApplicationsParams
- type QueryUnstakingApplicationsParams
- type StakingPool
Constants ¶
const ( EventTypeCompleteUnstaking = "complete_unstaking" EventTypeCreateApplication = "create_application" EventTypeStake = "stake" EventTypeBeginUnstake = "begin_unstake" EventTypeUnstake = "unstake" AttributeKeyApplication = "application" AttributeValueCategory = ModuleName )
pos module event types
const ( StakeFee = 10000 UnstakeFee = 10000 UnjailFee = 10000 )
const ( ModuleName = "application" // name of module 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 ( MsgAppStakeName = "app_stake" MsgAppUnstakeName = "app_begin_unstake" MsgAppUnjailName = "app_unjail" )
const ( // DefaultParamspace for params keeper DefaultParamspace = ModuleName DefaultUnstakingTime = time.Hour * 24 * 7 * 3 DefaultMaxApplications int64 = math.MaxInt64 DefaultMinStake int64 = 1000000 DefaultBaseRelaysPerPOKT int64 = 100 DefaultStabilityAdjustment int64 = 0 DefaultParticipationRateOn bool = false DefaultMaxChains int64 = 15 )
POS params default values
const ( QueryApplications = "applications" QueryApplication = "application" QueryAppStakedPool = "appStakedPool" QueryAppUnstakedPool = "appUnstakedPool" QueryParameters = "parameters" )
query endpoints supported by the staking Querier
const (
NetworkIdentifierLength = 2
)
const (
StakedPoolName = "application_staked_tokens_pool"
)
names used as root for pool module accounts: StakingPool -> "application_staked_tokens_pool"
Variables ¶
var ( ErrInvalidLengthApps = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApps = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApps = fmt.Errorf("proto: unexpected end of group") )
var ( AllApplicationsKey = []byte{0x01} // prefix for each key to a application StakedAppsKey = []byte{0x02} // prefix for each key to a staked application index, sorted by power UnstakingAppsKey = []byte{0x03} // prefix for unstaking application BurnApplicationKey = []byte{0x04} // prefix for awarding applications )
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 ( KeyUnstakingTime = []byte("AppUnstakingTime") KeyMaxApplications = []byte("MaxApplications") KeyApplicationMinStake = []byte("ApplicationStakeMinimum") BaseRelaysPerPOKT = []byte("BaseRelaysPerPOKT") StabilityAdjustment = []byte("StabilityAdjustment") ParticipationRateOn = []byte("ParticipationRateOn") KeyMaximumChains = []byte("MaximumChains") )
Keys for parameter access
var ( AppFeeMap = map[string]int64{ MsgAppStakeName: StakeFee, MsgAppUnstakeName: UnstakeFee, MsgAppUnjailName: UnjailFee, } )
var ApplicationCacheSize int64 = 5
var ModuleCdc *codec.Codec
module wide codec
Functions ¶
func AddressFromKey ¶
Removes the prefix bytes from a key to expose true address
func AppsDescription ¶
func AppsDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func ErrApplicationJailed ¶
func ErrApplicationJailed(codespace sdk.CodespaceType) sdk.Error
func ErrApplicationNotJailed ¶
func ErrApplicationNotJailed(codespace sdk.CodespaceType) sdk.Error
func ErrApplicationPubKeyExists ¶
func ErrApplicationPubKeyExists(codespace sdk.CodespaceType) sdk.Error
func ErrApplicationStatus ¶
func ErrApplicationStatus(codespace sdk.CodespaceType) sdk.Error
func ErrBadApplicationAddr ¶
func ErrBadApplicationAddr(codespace sdk.CodespaceType) sdk.Error
func ErrBadStakeAmount ¶
func ErrBadStakeAmount(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidNetworkIdentifier ¶
func ErrInvalidNetworkIdentifier(codespace sdk.CodespaceType, err error) sdk.Error
func ErrMaxApplications ¶
func ErrMaxApplications(codespace sdk.CodespaceType) sdk.Error
func ErrMinimumEditStake ¶
func ErrMinimumEditStake(codespace sdk.CodespaceType) sdk.Error
func ErrMinimumStake ¶
func ErrMinimumStake(codespace sdk.CodespaceType) sdk.Error
func ErrMissingAppStake ¶
func ErrMissingAppStake(codespace sdk.CodespaceType) sdk.Error
func ErrNilApplicationAddr ¶
func ErrNilApplicationAddr(codespace sdk.CodespaceType) sdk.Error
func ErrNoApplicationForAddress ¶
func ErrNoApplicationForAddress(codespace sdk.CodespaceType) sdk.Error
func ErrNoApplicationFound ¶
func ErrNoApplicationFound(codespace sdk.CodespaceType) sdk.Error
func ErrNoChains ¶
func ErrNoChains(codespace sdk.CodespaceType) sdk.Error
func ErrNotEnoughCoins ¶
func ErrNotEnoughCoins(codespace sdk.CodespaceType) sdk.Error
func ErrStakeTooLow ¶
func ErrStakeTooLow(codespace sdk.CodespaceType) sdk.Error
func ErrTooManyChains ¶
func ErrTooManyChains(Codespace sdk.CodespaceType) sdk.Error
func InitConfig ¶
func InitConfig(applicationCacheSize int64)
func KeyForAppBurn ¶
func KeyForAppByAllApps ¶
generates the key for the application with address
func KeyForAppInStakingSet ¶
func KeyForAppInStakingSet(app Application) []byte
generates the key for a application in the staking set
func KeyForUnstakingApps ¶
generates the key for unstaking applications by the unstakingtime
func MarshalApplication ¶
func MarshalApplication(cdc *codec.Codec, ctx sdk.Ctx, application Application) (result []byte, err error)
unmarshal the application
func RegisterCodec ¶
RegisterCodec registers concrete types on the codec
Types ¶
type Application ¶
type Application struct { Address sdk.Address `json:"address" yaml:"address"` // address of the application; hex encoded in JSON PublicKey crypto.PublicKey `json:"public_key" yaml:"public_key"` // the public key of the application; hex encoded in JSON Jailed bool `json:"jailed" yaml:"jailed"` // has the application been jailed from staked status? Status sdk.StakeStatus `json:"status" yaml:"status"` // application status (staked/unstaking/unstaked) Chains []string `json:"chains" yaml:"chains"` // requested chains StakedTokens sdk.BigInt `json:"tokens" yaml:"tokens"` // tokens staked in the network MaxRelays sdk.BigInt `json:"max_relays" yaml:"max_relays"` // maximum number of relays allowed UnstakingCompletionTime time.Time `json:"unstaking_time" yaml:"unstaking_time"` // if unstaking, min time for the application to complete unstaking }
Application represents a pocket network decentralized application. Applications stake in the network for relay throughput.
func NewApplication ¶
func NewApplication(addr sdk.Address, publicKey crypto.PublicKey, chains []string, tokensToStake sdk.BigInt) Application
NewApplication - initialize a new instance of an application
func UnmarshalApplication ¶
func UnmarshalApplication(cdc *codec.Codec, ctx sdk.Ctx, appBytes []byte) (application Application, err error)
unmarshal the application
func (Application) AddStakedTokens ¶
func (a Application) AddStakedTokens(tokens sdk.BigInt) (Application, error)
AddStakedTokens tokens to staked field for a application
func (Application) ConsensusPower ¶
func (a Application) ConsensusPower() int64
get the consensus-engine power a reduction of 10^6 from application tokens is applied
func (Application) Equals ¶
func (a Application) Equals(v2 Application) bool
compares the vital fields of two application structures
func (Application) GetAddress ¶
func (a Application) GetAddress() sdk.Address
func (Application) GetChains ¶
func (a Application) GetChains() []string
func (Application) GetConsensusPower ¶
func (a Application) GetConsensusPower() int64
func (Application) GetMaxRelays ¶
func (a Application) GetMaxRelays() sdk.BigInt
func (Application) GetPublicKey ¶
func (a Application) GetPublicKey() crypto.PublicKey
func (Application) GetStatus ¶
func (a Application) GetStatus() sdk.StakeStatus
func (Application) GetTokens ¶
func (a Application) GetTokens() sdk.BigInt
func (Application) IsJailed ¶
func (a Application) IsJailed() bool
func (Application) IsStaked ¶
func (a Application) IsStaked() bool
func (Application) IsUnstaked ¶
func (a Application) IsUnstaked() bool
func (Application) IsUnstaking ¶
func (a Application) IsUnstaking() bool
func (Application) Marshal ¶
func (a Application) Marshal() ([]byte, error)
func (Application) MarshalJSON ¶
func (a Application) MarshalJSON() ([]byte, error)
MarshalJSON marshals the application to JSON using raw Hex for the public key
func (Application) MarshalToSizedBuffer ¶
func (a Application) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (Application) ProtoMessage ¶
func (a Application) ProtoMessage()
func (Application) RemoveStakedTokens ¶
func (a Application) RemoveStakedTokens(tokens sdk.BigInt) (Application, error)
RemoveStakedTokens removes tokens from a application
func (*Application) Reset ¶
func (a *Application) Reset()
func (Application) Size ¶
func (a Application) Size() int
func (Application) String ¶
func (a Application) String() string
String returns a human readable string representation of a application.
func (Application) ToProto ¶
func (a Application) ToProto() ProtoApplication
func (*Application) Unmarshal ¶
func (a *Application) Unmarshal(data []byte) (err error)
func (*Application) UnmarshalJSON ¶
func (a *Application) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the application from JSON using raw hex for the public key
func (Application) UpdateStatus ¶
func (a Application) UpdateStatus(newStatus sdk.StakeStatus) Application
UpdateStatus updates the staking status
type ApplicationSet ¶
type ApplicationSet interface { // iterate through applications by address, execute func for each application IterateAndExecuteOverApps(sdk.Ctx, func(index int64, application appexported.ApplicationI) (stop bool)) // iterate through staked applications by address, execute func for each application IterateAndExecuteOverStakedApps(sdk.Ctx, func(index int64, application appexported.ApplicationI) (stop bool)) // get a particular application by address Application(sdk.Ctx, sdk.Address) appexported.ApplicationI // total staked tokens within the application set TotalTokens(sdk.Ctx) sdk.BigInt // jail a application JailApplication(sdk.Ctx, sdk.Address) // unjail a application UnjailApplication(sdk.Ctx, sdk.Address) // MaxApplications returns the maximum amount of staked applications MaxApplications(sdk.Ctx) int64 }
ApplicationSet expected properties for the set of all applications (noalias)
type Applications ¶
type Applications []Application
Applications is a slice of type application.
func (Applications) JSON ¶
func (a Applications) JSON() (out []byte, err error)
marshal structure into JSON encoding
func (Applications) String ¶
func (a Applications) String() (out string)
type ApplicationsPage ¶
type ApplicationsPage struct { Result Applications `json:"result"` Total int `json:"total_pages"` Page int `json:"page"` }
func (ApplicationsPage) String ¶
func (aP ApplicationsPage) String() string
String returns a human readable string representation of a validator page
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 }
AuthKeeper defines the expected supply Keeper (noalias)
type CodeType ¶
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeInvalidApplication CodeType = 101 CodeInvalidInput CodeType = 103 CodeApplicationJailed CodeType = 104 CodeApplicationNotJailed CodeType = 105 CodeMissingSelfDelegation CodeType = 106 CodeInvalidStatus CodeType = 110 CodeMinimumStake CodeType = 111 CodeNotEnoughCoins CodeType = 112 CodeInvalidStakeAmount CodeType = 115 CodeNoChains CodeType = 116 CodeInvalidNetworkID CodeType = 117 CodeTooManyChains CodeType = 118 CodeMaxApplications CodeType = 119 CodeMinimumEditStake CodeType = 120 )
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` Applications Applications `json:"applications" yaml:"applications"` Exported bool `json:"exported" yaml:"exported"` }
GenesisState - all staking state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
type JSONApplication ¶
type JSONApplication struct { Address sdk.Address `json:"address" yaml:"address"` // the hex address of the application PublicKey string `json:"public_key" yaml:"public_key"` // the hex consensus public key of the application Jailed bool `json:"jailed" yaml:"jailed"` // has the application been jailed from staked status? Chains []string `json:"chains" yaml:"chains"` // non native (external) blockchains needed for the application MaxRelays sdk.BigInt `json:"max_relays" yaml:"max_relays"` // maximum number of relays allowed for the application Status sdk.StakeStatus `json:"status" yaml:"status"` // application status (staked/unstaking/unstaked) StakedTokens sdk.BigInt `json:"staked_tokens" yaml:"staked_tokens"` // how many staked tokens UnstakingCompletionTime time.Time `json:"unstaking_time" yaml:"unstaking_time"` // if unstaking, min time for the application to complete unstaking }
this is a helper struct used for JSON de- and encoding only
type MsgBeginUnstake ¶
type MsgBeginUnstake struct {
Address github_com_pokt_network_pocket_core_types.Address `` /* 155-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) GetSigners ¶
func (msg MsgBeginUnstake) GetSigners() []sdk.Address
GetSigners 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 for staking an application
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 { PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pubkey" yaml:"pubkey"` 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 */ }
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 MsgStake ¶
type MsgStake struct { PubKey crypto.PublicKey `json:"pubkey" yaml:"pubkey"` Chains []string `json:"chains" yaml:"chains"` Value sdk.BigInt `json:"value" yaml:"value"` }
func (MsgStake) GetRecipient ¶
func (MsgStake) GetSignBytes ¶
GetSignBytes returns the message bytes to sign over.
func (MsgStake) GetSigners ¶
GetSigners return address(es) that must sign over msg.GetSignBytes()
func (MsgStake) IsValidTransfer ¶
func (*MsgStake) MarshalToSizedBuffer ¶
func (MsgStake) ProtoMessage ¶
func (msg MsgStake) ProtoMessage()
func (MsgStake) ToProto ¶
func (msg MsgStake) ToProto() MsgProtoStake
func (MsgStake) ValidateBasic ¶
ValidateBasic quick validity check for staking an application
func (*MsgStake) XXX_MessageName ¶
type MsgUnjail ¶
type MsgUnjail struct {
AppAddr github_com_pokt_network_pocket_core_types.Address `` /* 131-byte string literal not displayed */
}
func (*MsgUnjail) Descriptor ¶
func (MsgUnjail) GetRecipient ¶
func (MsgUnjail) GetSignBytes ¶
GetSignBytes returns the message bytes to sign over.
func (MsgUnjail) GetSigners ¶
GetSigners return address(es) that must sign over msg.GetSignBytes()
func (*MsgUnjail) MarshalToSizedBuffer ¶
func (*MsgUnjail) ProtoMessage ¶
func (*MsgUnjail) ProtoMessage()
func (MsgUnjail) Route ¶
---------------------------------------------------------------------------------------------------------------------- Route provides router key for msg
func (MsgUnjail) ValidateBasic ¶
ValidateBasic quick validity check for staking an application
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 { UnstakingTime time.Duration `json:"unstaking_time" yaml:"unstaking_time"` // duration of unstaking MaxApplications int64 `json:"max_applications" yaml:"max_applications"` // maximum number of applications AppStakeMin int64 `json:"app_stake_minimum" yaml:"app_stake_minimum"` // minimum amount needed to stake as an application BaseRelaysPerPOKT int64 `json:"base_relays_per_pokt" yaml:"base_relays_per_pokt"` // base relays per POKT coin staked StabilityAdjustment int64 `json:"stability_adjustment" yaml:"stability_adjustment"` // the stability adjustment from the governance ParticipationRateOn bool `json:"participation_rate_on" yaml:"participation_rate_on"` // the participation rate affects the amount minted based on staked ratio MaxChains int64 `json:"maximum_chains" yaml:"maximum_chains"` // the maximum number of chains an app can stake for }
Params defines the high level settings for pos module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() types.ParamSetPairs
Implements params.ParamSet
type PocketKeeper ¶
type PocketKeeper interface {
// clear the cache of validators for sessions and relays
ClearSessionCache()
}
type Pool ¶
type Pool struct {
Tokens github_com_pokt_network_pocket_core_types.BigInt `protobuf:"bytes,1,opt,name=tokens,proto3,customtype=github.com/pokt-network/pocket-core/types.BigInt" json:"tokens"`
}
Pool - tracking bonded and not-bonded token supply of the bond denomination
func (*Pool) Description ¶
func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*Pool) Descriptor ¶
func (*Pool) ProtoMessage ¶
func (*Pool) ProtoMessage()
func (*Pool) XXX_DiscardUnknown ¶
func (m *Pool) XXX_DiscardUnknown()
func (*Pool) XXX_Unmarshal ¶
type ProtoApplication ¶
type ProtoApplication struct { Address github_com_pokt_network_pocket_core_types.Address `` /* 131-byte string literal not displayed */ PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` Status github_com_pokt_network_pocket_core_types.StakeStatus `` /* 133-byte string literal not displayed */ Chains []string `protobuf:"bytes,5,rep,name=chains,proto3" json:"chains" yaml:"chains"` StakedTokens github_com_pokt_network_pocket_core_types.BigInt `` /* 154-byte string literal not displayed */ MaxRelays github_com_pokt_network_pocket_core_types.BigInt `` /* 156-byte string literal not displayed */ UnstakingCompletionTime time.Time `` /* 141-byte string literal not displayed */ }
Application defines the total amount of bond shares and their exchange rate to coins. Slashing results in a decrease in the exchange rate, allowing correct calculation of future undelegations without iterating over delegators. When coins are delegated to this validator, the validator is credited with a delegation whose number of bond shares is based on the amount of coins delegated divided by the current exchange rate. Voting power can be calculated as total bonded shares multiplied by exchange rate.
func (*ProtoApplication) Descriptor ¶
func (*ProtoApplication) Descriptor() ([]byte, []int)
func (*ProtoApplication) Equal ¶
func (this *ProtoApplication) Equal(that interface{}) bool
func (ProtoApplication) FromProto ¶
func (ae ProtoApplication) FromProto() (Application, error)
func (*ProtoApplication) Marshal ¶
func (m *ProtoApplication) Marshal() (dAtA []byte, err error)
func (*ProtoApplication) MarshalToSizedBuffer ¶
func (m *ProtoApplication) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProtoApplication) ProtoMessage ¶
func (*ProtoApplication) ProtoMessage()
func (*ProtoApplication) Reset ¶
func (m *ProtoApplication) Reset()
func (*ProtoApplication) Size ¶
func (m *ProtoApplication) Size() (n int)
func (*ProtoApplication) String ¶
func (m *ProtoApplication) String() string
func (*ProtoApplication) Unmarshal ¶
func (m *ProtoApplication) Unmarshal(dAtA []byte) error
func (*ProtoApplication) XXX_DiscardUnknown ¶
func (m *ProtoApplication) XXX_DiscardUnknown()
func (*ProtoApplication) XXX_Marshal ¶
func (m *ProtoApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProtoApplication) XXX_Merge ¶
func (m *ProtoApplication) XXX_Merge(src proto.Message)
func (*ProtoApplication) XXX_Size ¶
func (m *ProtoApplication) XXX_Size() int
func (*ProtoApplication) XXX_Unmarshal ¶
func (m *ProtoApplication) XXX_Unmarshal(b []byte) error
type QueryAppParams ¶
func NewQueryAppParams ¶
func NewQueryAppParams(applicationAddr sdk.Address) QueryAppParams
type QueryApplicationsWithOpts ¶
type QueryApplicationsWithOpts struct { Page int `json:"page"` Limit int `json:"per_page"` StakingStatus sdk.StakeStatus `json:"staking_status"` Blockchain string `json:"blockchain"` }
func (QueryApplicationsWithOpts) IsValid ¶
func (opts QueryApplicationsWithOpts) IsValid(app Application) bool
type QueryAppsParams ¶
type QueryAppsParams struct {
Page, Limit int
}
func NewQueryApplicationsParams ¶
func NewQueryApplicationsParams(page, limit int) QueryAppsParams
type QueryStakedApplicationsParams ¶
type QueryStakedApplicationsParams struct {
Page, Limit int
}
type QueryUnstakingApplicationsParams ¶
type QueryUnstakingApplicationsParams struct {
Page, Limit int
}
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.