Documentation ¶
Index ¶
- Constants
- Variables
- func ActiveNodeAtKey(at time.Time, address hub.NodeAddress) []byte
- func ActiveNodeForProviderKey(p hub.ProvAddress, n hub.NodeAddress) []byte
- func ActiveNodeKey(address hub.NodeAddress) []byte
- func AddressFromStatusNodeAtKey(key []byte) hub.NodeAddress
- func AddressFromStatusNodeForProviderKey(key []byte) hub.NodeAddress
- func AddressFromStatusNodeKey(key []byte) hub.NodeAddress
- func GetActiveNodeAtKeyPrefix(at time.Time) []byte
- func GetActiveNodeForProviderKeyPrefix(address hub.ProvAddress) []byte
- func GetInactiveNodeAtKeyPrefix(at time.Time) []byte
- func GetInactiveNodeForProviderKeyPrefix(address hub.ProvAddress) []byte
- func InactiveNodeAtKey(at time.Time, address hub.NodeAddress) []byte
- func InactiveNodeForProviderKey(p hub.ProvAddress, n hub.NodeAddress) []byte
- func InactiveNodeKey(address hub.NodeAddress) []byte
- func NodeKey(address hub.NodeAddress) []byte
- func ParamsKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type GenesisState
- type MsgRegister
- type MsgSetStatus
- type MsgUpdate
- type Node
- type Nodes
- type Params
- type QueryNodeParams
- type QueryNodesForProviderParams
- type QueryNodesParams
Constants ¶
View Source
const ( AttributeKeyProvider = "provider" AttributeKeyAddress = "address" AttributeKeyStatus = "status" )
View Source
const ( ModuleName = "node" QuerierRoute = ModuleName )
View Source
const ( QueryNode = "Node" QueryNodes = "Nodes" QueryNodesForProvider = "NodesForProvider" )
View Source
const (
DefaultInactiveDuration = 5 * time.Minute
)
Variables ¶
View Source
var ( ErrorMarshal = errors.Register(ModuleName, 101, "error occurred while marshalling") ErrorUnmarshal = errors.Register(ModuleName, 102, "error occurred while unmarshalling") ErrorUnknownMsgType = errors.Register(ModuleName, 103, "unknown message type") ErrorUnknownQueryType = errors.Register(ModuleName, 104, "unknown query type") ErrorInvalidField = errors.Register(ModuleName, 105, "invalid field") ErrorProviderDoesNotExist = errors.Register(ModuleName, 106, "provider does not exist") ErrorDuplicateNode = errors.Register(ModuleName, 107, "duplicate node") ErrorNodeDoesNotExist = errors.Register(ModuleName, 108, "node does not exist") )
View Source
var ( EventTypeSet = fmt.Sprintf("%s:set", ModuleName) EventTypeUpdate = fmt.Sprintf("%s:update", ModuleName) EventTypeSetStatus = fmt.Sprintf("%s:set_status", ModuleName) )
View Source
var ( ParamsSubspace = ModuleName RouterKey = ModuleName StoreKey = ModuleName )
View Source
var ( NodeKeyPrefix = []byte{0x00} ActiveNodeKeyPrefix = []byte{0x10} InactiveNodeKeyPrefix = []byte{0x11} ActiveNodeForProviderKeyPrefix = []byte{0x20} InactiveNodeForProviderKeyPrefix = []byte{0x21} ActiveNodeAtKeyPrefix = []byte{0x30} InactiveNodeAtKeyPrefix = []byte{0x31} )
View Source
var ( EventModuleName = sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, ModuleName), ) )
View Source
var (
KeyInactiveDuration = []byte("InactiveDuration")
)
View Source
var (
ModuleCdc *codec.Codec
)
Functions ¶
func ActiveNodeAtKey ¶
func ActiveNodeAtKey(at time.Time, address hub.NodeAddress) []byte
func ActiveNodeForProviderKey ¶ added in v0.4.0
func ActiveNodeForProviderKey(p hub.ProvAddress, n hub.NodeAddress) []byte
func ActiveNodeKey ¶ added in v0.4.0
func ActiveNodeKey(address hub.NodeAddress) []byte
func AddressFromStatusNodeAtKey ¶ added in v0.4.0
func AddressFromStatusNodeAtKey(key []byte) hub.NodeAddress
func AddressFromStatusNodeForProviderKey ¶ added in v0.4.0
func AddressFromStatusNodeForProviderKey(key []byte) hub.NodeAddress
func AddressFromStatusNodeKey ¶ added in v0.4.0
func AddressFromStatusNodeKey(key []byte) hub.NodeAddress
func GetActiveNodeForProviderKeyPrefix ¶ added in v0.4.0
func GetActiveNodeForProviderKeyPrefix(address hub.ProvAddress) []byte
func GetInactiveNodeAtKeyPrefix ¶ added in v0.4.0
func GetInactiveNodeForProviderKeyPrefix ¶ added in v0.4.0
func GetInactiveNodeForProviderKeyPrefix(address hub.ProvAddress) []byte
func InactiveNodeAtKey ¶ added in v0.4.0
func InactiveNodeAtKey(at time.Time, address hub.NodeAddress) []byte
func InactiveNodeForProviderKey ¶ added in v0.4.0
func InactiveNodeForProviderKey(p hub.ProvAddress, n hub.NodeAddress) []byte
func InactiveNodeKey ¶ added in v0.4.0
func InactiveNodeKey(address hub.NodeAddress) []byte
func NodeKey ¶
func NodeKey(address hub.NodeAddress) []byte
func ParamsKeyTable ¶
func RegisterCodec ¶
Types ¶
type GenesisState ¶
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(nodes Nodes, params Params) GenesisState
type MsgRegister ¶
type MsgRegister struct { From sdk.AccAddress `json:"from"` Provider hub.ProvAddress `json:"provider,omitempty"` Price sdk.Coins `json:"price,omitempty"` RemoteURL string `json:"remote_url"` }
MsgRegister is for registering a node.
func NewMsgRegister ¶
func NewMsgRegister(from sdk.AccAddress, provider hub.ProvAddress, price sdk.Coins, remoteURL string) MsgRegister
func (MsgRegister) GetSignBytes ¶
func (m MsgRegister) GetSignBytes() []byte
func (MsgRegister) GetSigners ¶
func (m MsgRegister) GetSigners() []sdk.AccAddress
func (MsgRegister) Route ¶
func (m MsgRegister) Route() string
func (MsgRegister) Type ¶
func (m MsgRegister) Type() string
func (MsgRegister) ValidateBasic ¶
func (m MsgRegister) ValidateBasic() error
type MsgSetStatus ¶
type MsgSetStatus struct { From hub.NodeAddress `json:"from"` Status hub.Status `json:"status"` }
MsgSetStatus is for updating the status of a node.
func NewMsgSetStatus ¶
func NewMsgSetStatus(from hub.NodeAddress, status hub.Status) MsgSetStatus
func (MsgSetStatus) GetSignBytes ¶
func (m MsgSetStatus) GetSignBytes() []byte
func (MsgSetStatus) GetSigners ¶
func (m MsgSetStatus) GetSigners() []sdk.AccAddress
func (MsgSetStatus) Route ¶
func (m MsgSetStatus) Route() string
func (MsgSetStatus) Type ¶
func (m MsgSetStatus) Type() string
func (MsgSetStatus) ValidateBasic ¶
func (m MsgSetStatus) ValidateBasic() error
type MsgUpdate ¶
type MsgUpdate struct { From hub.NodeAddress `json:"from"` Provider hub.ProvAddress `json:"provider,omitempty"` Price sdk.Coins `json:"price,omitempty"` RemoteURL string `json:"remote_url,omitempty"` }
MsgUpdate is for updating the information of a node.
func NewMsgUpdate ¶
func NewMsgUpdate(from hub.NodeAddress, provider hub.ProvAddress, price sdk.Coins, remoteURL string) MsgUpdate
func (MsgUpdate) GetSignBytes ¶
func (MsgUpdate) GetSigners ¶
func (m MsgUpdate) GetSigners() []sdk.AccAddress
func (MsgUpdate) ValidateBasic ¶
type Node ¶
type Node struct { Address hub.NodeAddress `json:"address"` Provider hub.ProvAddress `json:"provider,omitempty"` Price sdk.Coins `json:"price,omitempty"` RemoteURL string `json:"remote_url"` Status hub.Status `json:"status"` StatusAt time.Time `json:"status_at"` }
func (Node) BytesForCoin ¶ added in v0.3.2
type Params ¶
func DefaultParams ¶
func DefaultParams() Params
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
type QueryNodeParams ¶
type QueryNodeParams struct {
Address hub.NodeAddress `json:"address"`
}
func NewQueryNodeParams ¶
func NewQueryNodeParams(address hub.NodeAddress) QueryNodeParams
type QueryNodesForProviderParams ¶
type QueryNodesForProviderParams struct { Address hub.ProvAddress `json:"address"` Status hub.Status `json:"status"` Skip int `json:"skip"` Limit int `json:"limit"` }
func NewQueryNodesForProviderParams ¶
func NewQueryNodesForProviderParams(address hub.ProvAddress, status hub.Status, skip, limit int) QueryNodesForProviderParams
type QueryNodesParams ¶
type QueryNodesParams struct { Status hub.Status `json:"status"` Skip int `json:"skip"` Limit int `json:"limit"` }
func NewQueryNodesParams ¶
func NewQueryNodesParams(status hub.Status, skip, limit int) QueryNodesParams
Click to show internal directories.
Click to hide internal directories.