Documentation ¶
Index ¶
- Variables
- func NewDefaultRelayMiningDifficulty(ctx context.Context, logger log.Logger, serviceId string, numRelays uint64) types.RelayMiningDifficulty
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AllServices(ctx context.Context, req *types.QueryAllServicesRequest) (*types.QueryAllServicesResponse, error)
- func (k Keeper) GetAllRelayMiningDifficulty(ctx context.Context) (list []types.RelayMiningDifficulty)
- func (k Keeper) GetAllServices(ctx context.Context) (services []sharedtypes.Service)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetParams(ctx context.Context) (params types.Params)
- func (k Keeper) GetRelayMiningDifficulty(ctx context.Context, serviceId string) (difficulty types.RelayMiningDifficulty, found bool)
- func (k Keeper) GetService(ctx context.Context, serviceId string) (service sharedtypes.Service, found bool)
- func (k Keeper) Logger() log.Logger
- func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RelayMiningDifficulty(ctx context.Context, req *types.QueryGetRelayMiningDifficultyRequest) (*types.QueryGetRelayMiningDifficultyResponse, error)
- func (k Keeper) RelayMiningDifficultyAll(ctx context.Context, req *types.QueryAllRelayMiningDifficultyRequest) (*types.QueryAllRelayMiningDifficultyResponse, error)
- func (k Keeper) RemoveRelayMiningDifficulty(ctx context.Context, serviceId string)
- func (k Keeper) RemoveService(ctx context.Context, serviceId string)
- func (k Keeper) Service(ctx context.Context, req *types.QueryGetServiceRequest) (*types.QueryGetServiceResponse, error)
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k Keeper) SetRelayMiningDifficulty(ctx context.Context, relayMiningDifficulty types.RelayMiningDifficulty)
- func (k Keeper) SetService(ctx context.Context, service sharedtypes.Service)
- func (k Keeper) UpdateRelayMiningDifficulty(ctx context.Context, relaysPerServiceMap map[string]uint64) (difficultyPerServiceMap map[string]types.RelayMiningDifficulty, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // TargetNumRelays is the target number of relays we want the network to mine for // a specific service across all applications & suppliers per session. // This number determines the total number of leafs to be created across in // the off-chain SMTs, across all suppliers, for each service. // It indirectly drives the off-chain resource requirements of the network // in additional to playing a critical role in Relay Mining. // TODO_MAINNET(#542): Make this a governance parameter and figure out the correct value. TargetNumRelays = uint64(10e4) )
Functions ¶
func NewDefaultRelayMiningDifficulty ¶ added in v0.0.10
func NewDefaultRelayMiningDifficulty( ctx context.Context, logger log.Logger, serviceId string, numRelays uint64, ) types.RelayMiningDifficulty
NewDefaultRelayMiningDifficulty is a helper that creates a new RelayMiningDifficulty structure if one is not available. It is often used to set the default when a service's difficulty is being initialized for the first time.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, logger log.Logger, authority string, bankKeeper types.BankKeeper, ) Keeper
func (Keeper) AllServices ¶
func (k Keeper) AllServices(ctx context.Context, req *types.QueryAllServicesRequest) (*types.QueryAllServicesResponse, error)
AllServices queries all services.
func (Keeper) GetAllRelayMiningDifficulty ¶ added in v0.0.10
func (k Keeper) GetAllRelayMiningDifficulty(ctx context.Context) (list []types.RelayMiningDifficulty)
GetAllRelayMiningDifficulty returns all relayMiningDifficulty
func (Keeper) GetAllServices ¶ added in v0.0.4
func (k Keeper) GetAllServices(ctx context.Context) (services []sharedtypes.Service)
GetAllServices returns all services
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetRelayMiningDifficulty ¶ added in v0.0.10
func (k Keeper) GetRelayMiningDifficulty( ctx context.Context, serviceId string, ) (difficulty types.RelayMiningDifficulty, found bool)
GetRelayMiningDifficulty returns a relayMiningDifficulty from its index
func (Keeper) GetService ¶
func (k Keeper) GetService( ctx context.Context, serviceId string, ) (service sharedtypes.Service, found bool)
GetService returns a service from its index
func (Keeper) Params ¶
func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RelayMiningDifficulty ¶ added in v0.0.10
func (k Keeper) RelayMiningDifficulty(ctx context.Context, req *types.QueryGetRelayMiningDifficultyRequest) (*types.QueryGetRelayMiningDifficultyResponse, error)
func (Keeper) RelayMiningDifficultyAll ¶ added in v0.0.10
func (k Keeper) RelayMiningDifficultyAll(ctx context.Context, req *types.QueryAllRelayMiningDifficultyRequest) (*types.QueryAllRelayMiningDifficultyResponse, error)
func (Keeper) RemoveRelayMiningDifficulty ¶ added in v0.0.10
RemoveRelayMiningDifficulty removes a relayMiningDifficulty from the store
func (Keeper) RemoveService ¶
RemoveService removes a service from the store
func (Keeper) Service ¶
func (k Keeper) Service(ctx context.Context, req *types.QueryGetServiceRequest) (*types.QueryGetServiceResponse, error)
Service returns the requested service if it exists.
func (Keeper) SetRelayMiningDifficulty ¶ added in v0.0.10
func (k Keeper) SetRelayMiningDifficulty(ctx context.Context, relayMiningDifficulty types.RelayMiningDifficulty)
SetRelayMiningDifficulty set a specific relayMiningDifficulty in the store from its index
func (Keeper) SetService ¶
func (k Keeper) SetService(ctx context.Context, service sharedtypes.Service)
SetService set a specific service in the store from its index
func (Keeper) UpdateRelayMiningDifficulty ¶ added in v0.0.10
func (k Keeper) UpdateRelayMiningDifficulty( ctx context.Context, relaysPerServiceMap map[string]uint64, ) (difficultyPerServiceMap map[string]types.RelayMiningDifficulty, err error)
UpdateRelayMiningDifficulty updates the on-chain relay mining difficulty based on the amount of on-chain relays for each service, given a map of serviceId->numRelays.