module

package
v0.0.0-dev.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ConsensusVersion = 1

ConsensusVersion defines the current module consensus version.

Variables

This section is empty.

Functions

func GetParticipantEmissionsForTopic

func GetParticipantEmissionsForTopic(
	ctx sdk.Context,
	am AppModule,
	topicId keeper.TOPIC_ID,
	topicStake *Uint,
	cumulativeEmission *Uint,
	totalStake *Uint) (rewards map[string]*Uint, err error)

******************************************************** * PUBLIC EXPORTED READ-ONLY FUNCTIONS * ******************************************************** For a given topic: given the sum total of all stake in that topic, given the amount of new tokens scheduled to be emitted this epoch, given the total amount of stake in the network, return the amount of new tokens to be emitted to each partipicant in that topic

Types

type AppModule

type AppModule struct {
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) AutoCLIOptions

func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions

AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements AppModule/ConsensusVersion.

func (AppModule) DefaultGenesis

func (AppModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the module.

func (AppModule) EndBlock

func (am AppModule) EndBlock(ctx context.Context) error

EndBlock returns the end blocker for the emissions module.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the exported genesis state as raw bytes for the circuit module.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage)

InitGenesis performs genesis initialization for the state module. It returns no validator updates.

func (AppModule) IsAppModule

func (am AppModule) IsAppModule()

IsAppModule implements the appmodule.AppModule interface.

func (AppModule) IsOnePerModuleType

func (am AppModule) IsOnePerModuleType()

IsOnePerModuleType implements the depinject.OnePerModuleType interface.

func (AppModule) Name

func (AppModule) Name() string

Name returns the state module's name.

func (AppModule) RegisterGRPCGatewayRoutes

func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the state module.

func (AppModule) RegisterInterfaces

func (AppModule) RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces registers interfaces and implementations of the state module.

func (AppModule) RegisterLegacyAminoCodec

func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the state module's types on the LegacyAmino codec. New modules do not need to support Amino.

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries.

func (AppModule) ValidateGenesis

func (AppModule) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the circuit module.

type BlocklessRequest

type BlocklessRequest struct {
	FunctionID string `json:"function_id"`
	Method     string `json:"method"`
	TopicID    string `json:"topic,omitempty"`
	Config     Config `json:"config"`
}

type Config

type Config struct {
	Environment []EnvVar `json:"env_vars,omitempty"`
	Stdin       *string  `json:"stdin,omitempty"`
	NodeCount   int      `json:"number_of_nodes,omitempty"`
	Timeout     int      `json:"timeout,omitempty"`
}

type EnvVar

type EnvVar struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type Float

type Float = big.Float

type InferenceItem

type InferenceItem struct {
	Worker    string `json:"worker"`
	Inference string `json:"inference"`
}

type LatestInferences

type LatestInferences struct {
	Timestamp  string          `json:"timestamp"`
	Inferences []InferenceItem `json:"inferences"`
}

type ModuleInputs

type ModuleInputs struct {
	depinject.In

	Cdc           codec.Codec
	StoreService  store.KVStoreService
	AddressCodec  address.Codec
	AccountKeeper keeper.AccountKeeper
	BankKeeper    keeper.BankKeeper

	Config *modulev1.Module
}

type ModuleOutputs

type ModuleOutputs struct {
	depinject.Out

	Module appmodule.AppModule
	Keeper keeper.Keeper
}

func ProvideModule

func ProvideModule(in ModuleInputs) ModuleOutputs

type Number

type Number interface {
	*Float | *cosmosMath.Uint
}

type Uint

type Uint = cosmosMath.Uint

type WeightInferencePayload

type WeightInferencePayload struct {
	Inferences    []LatestInferences `json:"inferences"`
	LatestWeights map[string]string  `json:"latest_weights"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL