Documentation
¶
Overview ¶
Package types provides automation functionality for scheduled contract execution
Package types provides event streaming functionality for topic-based event distribution ¶
Package types provides message bus functionality for inter-contract communication ¶
Package types provides orchestration message types for provider-contract communication ¶
Package types provides provider event integration for provider-to-contract communication
Index ¶
- Constants
- Variables
- func BuildAkashQueryPlugin(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) wasmkeeper.QueryPlugins
- func BuildAkashQueryPluginWithOrchestration(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) wasmkeeper.QueryPlugins
- func CombinedPluginOptions(deploymentKeeper interface{}, marketKeeper interface{}, ...) []wasmkeeper.Option
- func CombinedPluginOptionsWithManifest(deploymentKeeper interface{}, marketKeeper interface{}, ...) []wasmkeeper.Option
- func ComputeManifestHash(manifestBytes []byte) []byte
- func ComputeSDLHash(sdl string) []byte
- func CreateAkashMsgEncoder(messageBusKeeper *MessageBusKeeper) *wasmkeeper.MessageEncoders
- func CreateAkashQueryPlugin(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) *wasmkeeper.QueryPlugins
- func CreateAkashQueryPluginWithOrchestration(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) *wasmkeeper.QueryPlugins
- func CreateAkashQueryPluginWithReputation(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) *wasmkeeper.QueryPlugins
- func CustomMessageEncoder(messageBusKeeper *MessageBusKeeper) func(contractAddr sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error)
- func FindStructField[C any](obj interface{}, fieldName string) (C, error)
- func ManifestToAkashFormat(manifestBytes []byte) ([]byte, error)
- func MessageEncoderOption(messageBusKeeper *MessageBusKeeper) wasmkeeper.Option
- func NewReputationWasmAdapter(k *wasmkeeper.Keeper) rtypes.WasmKeeper
- func QueryPluginOption(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) wasmkeeper.Option
- func QueryPluginOptionWithOrchestration(deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, ...) wasmkeeper.Option
- func RESTQueryOrchestrationMessages(h *OrchestrationQueryHandler, ctx sdk.Context) http.HandlerFunc
- type ActiveProviderEndpoint
- type AkashCustomMsgHandler
- type AkashMsg
- type AkashMsgEncoder
- type AkashQuery
- type AkashWasmQuerier
- type App
- func (app *App) GenerateKeys()
- func (app *App) GetCodec() codec.Codec
- func (app *App) GetKVStoreKey() map[string]*storetypes.KVStoreKey
- func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *App) GetMemoryStoreKey() map[string]*storetypes.MemoryStoreKey
- func (app *App) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *App) GetTransientStoreKey() map[string]*storetypes.TransientStoreKey
- func (app *App) InitNormalKeepers(cdc codec.Codec, encodingConfig sdkutil.EncodingConfig, bApp *baseapp.BaseApp, ...)
- func (app *App) InitSpecialKeepers(cdc codec.Codec, legacyAmino *codec.LegacyAmino, bApp *baseapp.BaseApp, ...)
- func (app *App) SetupHooks()
- type AppKeepers
- type AutomationKeeper
- func (k *AutomationKeeper) CancelTask(ctx sdk.Context, taskID uint64, owner string) error
- func (k *AutomationKeeper) ExecutePendingTasks(ctx sdk.Context)
- func (k *AutomationKeeper) GetAllTasks(ctx sdk.Context) []ScheduledTask
- func (k *AutomationKeeper) GetState(ctx sdk.Context) AutomationState
- func (k *AutomationKeeper) GetTasks(ctx sdk.Context, contractAddr string) []ScheduledTask
- func (k *AutomationKeeper) ScheduleBlockTask(ctx sdk.Context, owner string, contractAddr string, executeMsg string, ...) (uint64, error)
- func (k *AutomationKeeper) ScheduleCronTask(ctx sdk.Context, owner string, contractAddr string, executeMsg string, ...) (uint64, error)
- func (k *AutomationKeeper) ScheduleDailyTask(ctx sdk.Context, owner string, contractAddr string, executeMsg string, ...) (uint64, error)
- func (k *AutomationKeeper) ScheduleTask(ctx sdk.Context, owner string, contractAddr string, executeMsg string, ...) (uint64, error)
- func (k *AutomationKeeper) ScheduleTimeTask(ctx sdk.Context, owner string, contractAddr string, executeMsg string, ...) (uint64, error)
- func (k *AutomationKeeper) SetState(ctx sdk.Context, state AutomationState)
- type AutomationState
- type AvailabilityEventInfo
- type AvailabilityInfo
- type BidInfo
- type CLIQueryOrchestrationMessagesRequest
- type CommandAckPayload
- type ContainerStatus
- type CronField
- type CronSchedule
- type DeploymentFailedPayload
- type DeploymentGroup
- type DeploymentReadyPayload
- type DepositAmount
- type ErrorPayload
- type Event
- type EventStreamKeeper
- func (k *EventStreamKeeper) CleanupExpiredEvents(ctx sdk.Context)
- func (k *EventStreamKeeper) DeliverEvents(ctx sdk.Context, contract string) ([]Event, error)
- func (k *EventStreamKeeper) GetState(ctx sdk.Context) EventStreamState
- func (k *EventStreamKeeper) GetTopicSubscribers(ctx sdk.Context, topic string) ([]string, error)
- func (k *EventStreamKeeper) ProcessPendingEvents(ctx sdk.Context, messageBus *MessageBusKeeper)
- func (k *EventStreamKeeper) PublishEvent(ctx sdk.Context, topic string, eventType string, data []byte, publisher string) (string, error)
- func (k *EventStreamKeeper) SetState(ctx sdk.Context, state EventStreamState)
- func (k *EventStreamKeeper) Subscribe(ctx sdk.Context, contract string, topic string) error
- func (k *EventStreamKeeper) Unsubscribe(ctx sdk.Context, contract string, topic string) error
- type EventStreamState
- type ForwardedPort
- type GetPendingMessagesRequest
- type GetPendingMessagesResponse
- type GetSubscriptionsRequest
- type GetSubscriptionsResponse
- type GetTopicSubscribersRequest
- type GetTopicSubscribersResponse
- type GroupSpec
- type HealthAlertPayload
- type HealthRequestPayload
- type HealthResponsePayload
- type HealthStatus
- type LeaseIdentifier
- type LogsRequestPayload
- type LogsResponsePayload
- type ManifestStoreKeeper
- func (k *ManifestStoreKeeper) DeleteManifest(ctx sdk.Context, owner string, dseq uint64)
- func (k *ManifestStoreKeeper) GetManifest(ctx sdk.Context, owner string, dseq uint64) (*StoredManifest, error)
- func (k *ManifestStoreKeeper) HasManifest(ctx sdk.Context, owner string, dseq uint64) bool
- func (k *ManifestStoreKeeper) SetManifest(ctx sdk.Context, owner string, dseq uint64, manifestBytes []byte, sdl string) error
- type MessageBusKeeper
- func (k *MessageBusKeeper) CleanupExpiredMessages(ctx sdk.Context)
- func (k *MessageBusKeeper) DeliverMessages(ctx sdk.Context, contract string) ([]MessageEnvelope, error)
- func (k *MessageBusKeeper) GetPendingMessages(ctx sdk.Context, contract string) ([]MessageEnvelope, error)
- func (k *MessageBusKeeper) GetState(ctx sdk.Context) MessageBusState
- func (k *MessageBusKeeper) GetSubscriptions(ctx sdk.Context, contract string) ([]Subscription, error)
- func (k *MessageBusKeeper) GetTopicSubscribers(ctx sdk.Context, topic string) ([]string, error)
- func (k *MessageBusKeeper) ProcessPendingMessages(ctx sdk.Context)
- func (k *MessageBusKeeper) SendMessage(ctx sdk.Context, envelope MessageEnvelope) (string, error)
- func (k *MessageBusKeeper) SetState(ctx sdk.Context, state MessageBusState)
- func (k *MessageBusKeeper) Subscribe(ctx sdk.Context, contract string, topic string) error
- func (k *MessageBusKeeper) Unsubscribe(ctx sdk.Context, contract string, topic string) error
- type MessageBusMsg
- type MessageBusQuery
- type MessageBusState
- type MessageEnvelope
- type MetricsRequestPayload
- type MetricsResponsePayload
- type MsgAcceptBid
- type MsgAckOrchestrationMessage
- type MsgCloseDeployment
- type MsgCloseGroup
- type MsgCloseLease
- type MsgCreateDeployment
- type MsgCreateLease
- type MsgDepositDeployment
- type MsgReportHealth
- type MsgRequestHealth
- type MsgRequestLogs
- type MsgRequestStatus
- type MsgSendProviderCommand
- type MsgSetDeploymentManifest
- type MsgSetDeploymentManifestInternal
- func (m *MsgSetDeploymentManifestInternal) GetSigners() []sdk.AccAddress
- func (m *MsgSetDeploymentManifestInternal) ProtoMessage()
- func (m *MsgSetDeploymentManifestInternal) Reset()
- func (m *MsgSetDeploymentManifestInternal) String() string
- func (m *MsgSetDeploymentManifestInternal) ValidateBasic() error
- type MsgSetManifestRef
- type MsgSubmitProviderScore
- type OrchestrationKeeper
- func (k *OrchestrationKeeper) CleanupExpiredMessages(ctx sdk.Context)
- func (k *OrchestrationKeeper) CreateDeploymentReadyEvent(ctx sdk.Context, provider string, contract string, leaseID LeaseIdentifier, ...) (string, error)
- func (k *OrchestrationKeeper) CreateHealthAlert(ctx sdk.Context, provider string, contract string, leaseID LeaseIdentifier, ...) (string, error)
- func (k *OrchestrationKeeper) CreateHealthRequest(ctx sdk.Context, from string, leaseID LeaseIdentifier, services []string, ...) (string, error)
- func (k *OrchestrationKeeper) CreateHealthResponse(ctx sdk.Context, from string, to string, leaseID LeaseIdentifier, ...) (string, error)
- func (k *OrchestrationKeeper) CreateStatusRequest(ctx sdk.Context, from string, leaseID LeaseIdentifier, includeContainers bool, ...) (string, error)
- func (k *OrchestrationKeeper) GetMessagesForContract(ctx sdk.Context, contract string) []OrchestrationMessage
- func (k *OrchestrationKeeper) GetMessagesForLease(ctx sdk.Context, leaseID LeaseIdentifier) []OrchestrationMessage
- func (k *OrchestrationKeeper) GetMessagesForProvider(ctx sdk.Context, provider string) []OrchestrationMessage
- func (k *OrchestrationKeeper) GetState(ctx sdk.Context) OrchestrationState
- func (k *OrchestrationKeeper) MarkMessageProcessed(ctx sdk.Context, messageID string) error
- func (k *OrchestrationKeeper) ProcessOrchestrationMessages(ctx sdk.Context)
- func (k *OrchestrationKeeper) QueueLimits() OrchestrationQueueLimits
- func (k *OrchestrationKeeper) SendMessage(ctx sdk.Context, from string, to string, messageType OrchestrationMessageType, ...) (string, error)
- func (k *OrchestrationKeeper) SetState(ctx sdk.Context, state OrchestrationState)
- func (k *OrchestrationKeeper) SignMessage(ctx sdk.Context, msg *OrchestrationMessage) error
- func (k *OrchestrationKeeper) VerifyMessageSignature(ctx sdk.Context, msg *OrchestrationMessage) bool
- type OrchestrationMessage
- type OrchestrationMessageInfo
- type OrchestrationMessageType
- type OrchestrationQueryHandler
- func (h *OrchestrationQueryHandler) HandleCLIQuery(ctx sdk.Context, req CLIQueryOrchestrationMessagesRequest) ([]byte, error)
- func (h *OrchestrationQueryHandler) QueryAllPendingMessages(ctx sdk.Context) QueryOrchestrationMessagesResponse
- func (h *OrchestrationQueryHandler) QueryMessagesForRecipient(ctx sdk.Context, recipient string) QueryOrchestrationMessagesResponse
- func (h *OrchestrationQueryHandler) QueryQueueDepth(ctx sdk.Context, leaseID string) OrchestrationQueueDepthResponse
- type OrchestrationQueueAdapter
- type OrchestrationQueueDepthLease
- type OrchestrationQueueDepthResponse
- type OrchestrationQueueLimits
- type OrchestrationState
- type PlacementSpec
- type PricingSpec
- type ProcessMessagesRequest
- type ProcessMessagesResponse
- type ProviderAggregateInfo
- type ProviderDetails
- type ProviderEvent
- type ProviderEventPublisher
- func (p *ProviderEventPublisher) GetProviderEventSubscribers(ctx sdk.Context, provider string) ([]string, error)
- func (p *ProviderEventPublisher) PublishBidAccepted(ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier) error
- func (p *ProviderEventPublisher) PublishBidSubmitted(ctx sdk.Context, provider string, owner string, dseq uint64, gseq uint32, ...) error
- func (p *ProviderEventPublisher) PublishCapacityChanged(ctx sdk.Context, provider string, availableCPU uint64, availableMemory uint64, ...) error
- func (p *ProviderEventPublisher) PublishDeploymentFailed(ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, ...) error
- func (p *ProviderEventPublisher) PublishDeploymentReady(ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, ...) error
- func (p *ProviderEventPublisher) PublishDeploymentStarted(ctx sdk.Context, provider string, deploymentID string, leaseID string, ...) error
- func (p *ProviderEventPublisher) PublishEvent(ctx sdk.Context, event ProviderEvent) error
- func (p *ProviderEventPublisher) PublishHealthAlert(ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, ...) error
- func (p *ProviderEventPublisher) PublishHealthUpdate(ctx sdk.Context, provider string, leaseID string, status string, ...) error
- func (p *ProviderEventPublisher) PublishLeaseCreated(ctx sdk.Context, provider string, leaseID LeaseIdentifier, price string) error
- func (p *ProviderEventPublisher) RouteProviderEventToContract(ctx sdk.Context, contract string, event ProviderEvent) error
- func (p *ProviderEventPublisher) SetOrchestrationKeeper(keeper *OrchestrationKeeper)
- type ProviderInfo
- type QueryActiveProviderEndpointsRequest
- type QueryActiveProviderEndpointsResponse
- type QueryBidsRequest
- type QueryBidsResponse
- type QueryDeploymentManifestRequest
- type QueryDeploymentManifestResponse
- type QueryDeploymentRequest
- type QueryDeploymentResponse
- type QueryEscrowBalanceRequest
- type QueryEscrowBalanceResponse
- type QueryHealthRequest
- type QueryHealthResponse
- type QueryLeaseMessagesRequest
- type QueryLeaseRequest
- type QueryLeaseResponse
- type QueryManifestRefRequest
- type QueryManifestRefResponse
- type QueryOrchestrationMessagesRequest
- type QueryOrchestrationMessagesResponse
- type QueryOrderRequest
- type QueryOrderResponse
- type QueryProviderRequest
- type QueryProviderResponse
- type QueryProvidersRequest
- type QueryProvidersResponse
- type QueryReputationAvailabilityHistoryRequest
- type QueryReputationAvailabilityHistoryResponse
- type QueryReputationAvailabilityRequest
- type QueryReputationAvailabilityResponse
- type QueryReputationHistoryRequest
- type QueryReputationHistoryResponse
- type QueryReputationParamsRequest
- type QueryReputationParamsResponse
- type QueryReputationProvidersRequest
- type QueryReputationProvidersResponse
- type QueryReputationScoreRequest
- type QueryReputationScoreResponse
- type ResourceAlertPayload
- type ResourceSpec
- type ResourceUsage
- type RestartRequestPayload
- type ScaleRequestPayload
- type ScheduleType
- type ScheduledTask
- type ScoreEntryInfo
- type SendMessageRequest
- type SendMessageResponse
- type ServiceHealth
- type ServiceMetrics
- type ServiceStatus
- type SetLeaseEnvAckPayload
- type SetLeaseEnvRequestPayload
- type StatusRequestPayload
- type StatusResponsePayload
- type StoredManifest
- type SubscribeRequest
- type SubscribeResponse
- type Subscription
- type TaskPriority
- type UnsubscribeRequest
- type UnsubscribeResponse
Constants ¶
const ( // MaxTickGasPerBlock is the total gas budget for all automation ticks in one block MaxTickGasPerBlock uint64 = 50_000_000 // MaxTicksPerBlock limits how many tasks can execute per block MaxTicksPerBlock int = 10 // DefaultAutoTaskGasLimit is the per-task gas limit for auto-discovered tasks. // Raised from 1M to 10M because contract ticks that emit CreateDeployment / // CloseDeployment messages consume hundreds of thousands of gas via WritePerByte. DefaultAutoTaskGasLimit uint64 = 10_000_000 )
const ( // MaxQueueDepthPerLease is the historical default pending-message cap. // P1.3 promotes it into OrchestrationQueueLimits while keeping this // exported constant for callers/tests that referenced the old name. MaxQueueDepthPerLease uint32 = 50 // MaxTotalQueueDepth is the historical default global pending-message cap. MaxTotalQueueDepth uint32 = 500 // MaxMessageBytes is the historical default maximum payload size for any // queued orchestration message. MaxMessageBytes uint64 = 8 * 1024 // AckRequiredTTL is the number of blocks after which unacknowledged messages are flagged AckRequiredTTL uint64 = 50 )
const ( MsgTypeHealthRequest = apiorch.MsgTypeHealthRequest MsgTypeStatusRequest = apiorch.MsgTypeStatusRequest MsgTypeLogsRequest = apiorch.MsgTypeLogsRequest MsgTypeMetricsRequest = apiorch.MsgTypeMetricsRequest MsgTypeScaleRequest = apiorch.MsgTypeScaleRequest MsgTypeRestartRequest = apiorch.MsgTypeRestartRequest MsgTypeStopRequest = apiorch.MsgTypeStopRequest MsgTypeSetLeaseEnvRequest = apiorch.MsgTypeSetLeaseEnvRequest MsgTypeHealthResponse = apiorch.MsgTypeHealthResponse MsgTypeStatusResponse = apiorch.MsgTypeStatusResponse MsgTypeLogsResponse = apiorch.MsgTypeLogsResponse MsgTypeMetricsResponse = apiorch.MsgTypeMetricsResponse MsgTypeCommandAck = apiorch.MsgTypeCommandAck MsgTypeError = apiorch.MsgTypeError MsgTypeSetLeaseEnvAck = apiorch.MsgTypeSetLeaseEnvAck MsgTypeDeploymentReady = apiorch.MsgTypeDeploymentReady MsgTypeDeploymentFailed = apiorch.MsgTypeDeploymentFailed MsgTypeHealthAlert = apiorch.MsgTypeHealthAlert MsgTypeResourceAlert = apiorch.MsgTypeResourceAlert HealthStatusHealthy = apiorch.HealthStatusHealthy HealthStatusDegraded = apiorch.HealthStatusDegraded HealthStatusUnhealthy = apiorch.HealthStatusUnhealthy HealthStatusUnknown = apiorch.HealthStatusUnknown )
const ( ProviderEventDeploymentStarted = "deployment_started" ProviderEventDeploymentReady = "deployment_ready" // Pods are running and ready ProviderEventDeploymentFailed = "deployment_failed" ProviderEventDeploymentStopped = "deployment_stopped" ProviderEventHealthUpdate = "health_update" ProviderEventCapacityChanged = "capacity_changed" ProviderEventNodeDown = "node_down" ProviderEventNodeUp = "node_up" ProviderEventBidSubmitted = "bid_submitted" ProviderEventBidAccepted = "bid_accepted" ProviderEventBidRejected = "bid_rejected" ProviderEventLeaseCreated = "lease_created" // Lease was created for provider ProviderEventManifestReceived = "manifest_received" // Provider received manifest ProviderEventServiceStarted = "service_started" // Individual service started ProviderEventServiceReady = "service_ready" // Individual service ready ProviderEventServiceFailed = "service_failed" // Individual service failed )
ProviderEventType constants
const (
AccountAddressPrefix = "akash"
)
const AutomationStoreKey = "automation"
AutomationStoreKey is the key for automation state storage
const EventStreamStoreKey = "event_stream"
EventStreamStoreKey is the key for event stream state storage
const MessageBusStoreKey = "message_bus"
MessageBusStoreKey is the key for message bus state storage
const OrchestrationStoreKey = "orchestration"
OrchestrationStoreKey is the key for orchestration state storage
Variables ¶
var ( ParseAkashQuery = apiwasm.ParseAkashQuery ParseAkashMsg = apiwasm.ParseAkashMsg DeploymentStateToString = apiwasm.DeploymentStateToString GroupStateToString = apiwasm.GroupStateToString OrderStateToString = apiwasm.OrderStateToString LeaseStateToString = apiwasm.LeaseStateToString BidStateToString = apiwasm.BidStateToString ParseMessageBusQuery = apiwasm.ParseMessageBusQuery ParseMessageBusMsg = apiwasm.ParseMessageBusMsg EncodePageKey = apiwasm.EncodePageKey )
var ErrEmptyFieldName = errors.New("empty field name")
var ManifestStoreKeyPrefix = []byte("manifest_store/")
ManifestStoreKeyPrefix is the prefix for manifest storage
Functions ¶
func BuildAkashQueryPlugin ¶
func BuildAkashQueryPlugin( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, ) wasmkeeper.QueryPlugins
BuildAkashQueryPlugin creates the wasm query plugin for Akash
func BuildAkashQueryPluginWithOrchestration ¶
func BuildAkashQueryPluginWithOrchestration( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, orchestrationKeeper *OrchestrationKeeper, ) wasmkeeper.QueryPlugins
BuildAkashQueryPluginWithOrchestration creates the wasm query plugin with orchestration support
func CombinedPluginOptions ¶
func CombinedPluginOptions(
deploymentKeeper interface{},
marketKeeper interface{},
providerKeeper interface{},
orchestrationKeeper *OrchestrationKeeper,
) []wasmkeeper.Option
CombinedPluginOptions returns both query and message plugins
func CombinedPluginOptionsWithManifest ¶
func CombinedPluginOptionsWithManifest(
deploymentKeeper interface{},
marketKeeper interface{},
providerKeeper interface{},
orchestrationKeeper *OrchestrationKeeper,
manifestStoreKeeper *ManifestStoreKeeper,
) []wasmkeeper.Option
CombinedPluginOptionsWithManifest returns both query and message plugins with manifest store support
func ComputeManifestHash ¶
ComputeManifestHash computes the canonical hash of manifest bytes This is the single source of truth for manifest hashing.
CANONICAL HASH RULE: 1. For JSON manifests: Parse, re-serialize with sorted keys, then SHA256 2. For SDL strings: Direct SHA256 of the raw bytes 3. Provider and chain MUST use the same rule
For contract-owned deployments, the hash validation is bypassed in the provider because contracts cannot pre-compute the exact hash the provider expects.
func ComputeSDLHash ¶
ComputeSDLHash computes the hash of an SDL string This is used for deployment version matching
func CreateAkashMsgEncoder ¶
func CreateAkashMsgEncoder(messageBusKeeper *MessageBusKeeper) *wasmkeeper.MessageEncoders
CreateAkashMsgEncoder creates the message encoder for wasm keeper initialization
func CreateAkashQueryPlugin ¶
func CreateAkashQueryPlugin( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, ) *wasmkeeper.QueryPlugins
CreateAkashQueryPlugin creates the query plugin for wasm keeper initialization
func CreateAkashQueryPluginWithOrchestration ¶
func CreateAkashQueryPluginWithOrchestration( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, orchestrationKeeper *OrchestrationKeeper, ) *wasmkeeper.QueryPlugins
CreateAkashQueryPluginWithOrchestration creates the query plugin with orchestration support
func CreateAkashQueryPluginWithReputation ¶
func CreateAkashQueryPluginWithReputation( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, reputationKeeper *rkeeper.Keeper, orchestrationKeeper *OrchestrationKeeper, ) *wasmkeeper.QueryPlugins
CreateAkashQueryPluginWithReputation is like CreateAkashQueryPlugin but also wires the reputation keeper so the wasm-side AkashQuery::Reputation* routes resolve. This is the constructor used by the akash app at startup. The reputation keeper pointer must be non-nil when wiring; the value can be the zero-value Keeper if the chain has not yet initialized its store.
`orchestrationKeeper` is optional — pass nil if the chain build does not include orchestration. When non-nil the wasm `active_provider_endpoints` query joins each lease with the latest `forwarded_ports` payload published by the owning provider, which is what surfaces tenant container ports on `services[]` / `workload_forwarded_ports[]`.
func CustomMessageEncoder ¶
func CustomMessageEncoder(messageBusKeeper *MessageBusKeeper) func(contractAddr sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error)
CustomMessageEncoder returns the custom message encoder for wasm
func FindStructField ¶
FindStructField if an interface is either a struct or a pointer to a struct and has the defined member field, if error is nil, the given fieldName exists and is accessible with reflect.
func ManifestToAkashFormat ¶
ManifestToAkashFormat converts stored manifest bytes to Akash manifest format This is a simplified version - the actual conversion depends on the manifest structure
func MessageEncoderOption ¶
func MessageEncoderOption(messageBusKeeper *MessageBusKeeper) wasmkeeper.Option
MessageEncoderOption returns the message encoder option for wasm keeper
func NewReputationWasmAdapter ¶
func NewReputationWasmAdapter(k *wasmkeeper.Keeper) rtypes.WasmKeeper
NewReputationWasmAdapter wraps a wasmd keeper into the rtypes.WasmKeeper surface used by x/reputation eligibility. Pass nil to disable the admin-signer relaxation entirely.
func QueryPluginOption ¶
func QueryPluginOption( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, ) wasmkeeper.Option
QueryPluginOption returns the query plugin option for wasm keeper
func QueryPluginOptionWithOrchestration ¶
func QueryPluginOptionWithOrchestration( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, orchestrationKeeper *OrchestrationKeeper, ) wasmkeeper.Option
QueryPluginOptionWithOrchestration returns the query plugin option with orchestration support
func RESTQueryOrchestrationMessages ¶
func RESTQueryOrchestrationMessages(h *OrchestrationQueryHandler, ctx sdk.Context) http.HandlerFunc
RESTQueryOrchestrationMessages is a REST handler for querying orchestration messages This can be registered with the REST router
Types ¶
type ActiveProviderEndpoint ¶
type ActiveProviderEndpoint = apiwasm.ActiveProviderEndpoint
type AkashCustomMsgHandler ¶
type AkashCustomMsgHandler struct {
// contains filtered or unexported fields
}
AkashCustomMsgHandler is the combined handler for custom messages
func NewAkashCustomMsgHandler ¶
func NewAkashCustomMsgHandler(messageBusKeeper *MessageBusKeeper) *AkashCustomMsgHandler
NewAkashCustomMsgHandler creates a new custom message handler
func (*AkashCustomMsgHandler) HandleMsg ¶
func (h *AkashCustomMsgHandler) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, [][]*wasmvmtypes.EventAttribute, error)
HandleMsg processes a custom Akash message from a CosmWasm contract
type AkashMsgEncoder ¶
type AkashMsgEncoder struct {
// contains filtered or unexported fields
}
AkashMsgEncoder handles encoding of custom Akash messages from CosmWasm contracts
func NewAkashMsgEncoder ¶
func NewAkashMsgEncoder(messageBusKeeper *MessageBusKeeper) *AkashMsgEncoder
NewAkashMsgEncoder creates a new Akash message encoder
func NewAkashMsgEncoderWithManifest ¶
func NewAkashMsgEncoderWithManifest(messageBusKeeper *MessageBusKeeper, manifestStoreKeeper *ManifestStoreKeeper) *AkashMsgEncoder
NewAkashMsgEncoderWithManifest creates a new Akash message encoder with manifest store support
func (*AkashMsgEncoder) EncodeCustomMsg ¶
func (e *AkashMsgEncoder) EncodeCustomMsg(contractAddr sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error)
EncodeCustomMsg encodes custom Akash messages to SDK messages
type AkashQuery ¶
type AkashQuery = apiwasm.AkashQuery
type AkashWasmQuerier ¶
type AkashWasmQuerier struct {
// contains filtered or unexported fields
}
AkashWasmQuerier handles custom Akash queries from CosmWasm contracts
func NewAkashWasmQuerier ¶
func NewAkashWasmQuerier( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, ) *AkashWasmQuerier
NewAkashWasmQuerier creates a new Akash wasm querier
func NewAkashWasmQuerierWithOrchestration ¶
func NewAkashWasmQuerierWithOrchestration( deploymentKeeper dkeeper.IKeeper, marketKeeper mkeeper.IKeeper, providerKeeper pkeeper.IKeeper, messageBusKeeper *MessageBusKeeper, orchestrationKeeper *OrchestrationKeeper, ) *AkashWasmQuerier
NewAkashWasmQuerierWithOrchestration creates a new Akash wasm querier with orchestration support
func (*AkashWasmQuerier) CustomQuerier ¶
func (q *AkashWasmQuerier) CustomQuerier() func(ctx sdk.Context, request json.RawMessage) ([]byte, error)
CustomQuerier returns a function that handles custom Akash queries
func (*AkashWasmQuerier) SetOrchestrationKeeper ¶
func (q *AkashWasmQuerier) SetOrchestrationKeeper(keeper *OrchestrationKeeper)
SetOrchestrationKeeper sets the orchestration keeper
func (*AkashWasmQuerier) SetReputationKeeper ¶
func (q *AkashWasmQuerier) SetReputationKeeper(k *rkeeper.Keeper)
SetReputationKeeper sets the reputation keeper. Optional dependency: queries gated on this keeper return a "not initialized" error if it is nil at call time, mirroring the orchestration pattern.
type App ¶
type App struct {
Cdc codec.Codec
Keepers AppKeepers
Configurator module.Configurator
MM *module.Manager
Log log.Logger
// Automation keeper for scheduled contract execution
Automation *AutomationKeeper
// Message bus keeper for inter-contract communication
MessageBus *MessageBusKeeper
// Event stream keeper for topic-based event distribution
EventStream *EventStreamKeeper
// Provider event publisher for provider-to-contract communication
ProviderEvents *ProviderEventPublisher
// Orchestration keeper for provider-contract communication
Orchestration *OrchestrationKeeper
// OrchestrationModule is the x/orchestration module keeper, providing the
// MsgSubmitOrchestrationResponse tx path for providers (roadmap §P0.1).
OrchestrationModule orchestrationkeeper.Keeper
// Manifest store keeper for on-chain manifest storage (provider auto-fetch)
ManifestStore *ManifestStoreKeeper
// Valiporacle keeper for ABCI++ vote-extension oracle pipeline
Valiporacle *vpkeeper.Keeper
// contains filtered or unexported fields
}
func (*App) GenerateKeys ¶
func (app *App) GenerateKeys()
func (*App) GetKVStoreKey ¶
func (app *App) GetKVStoreKey() map[string]*storetypes.KVStoreKey
GetKVStoreKey gets KV Store keys.
func (*App) GetKey ¶
func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*App) GetMemKey ¶
func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*App) GetMemoryStoreKey ¶
func (app *App) GetMemoryStoreKey() map[string]*storetypes.MemoryStoreKey
GetMemoryStoreKey get memory Store keys.
func (*App) GetSubspace ¶
func (app *App) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace gets existing substore from keeper.
func (*App) GetTKey ¶
func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*App) GetTransientStoreKey ¶
func (app *App) GetTransientStoreKey() map[string]*storetypes.TransientStoreKey
GetTransientStoreKey gets Transient Store keys.
func (*App) InitNormalKeepers ¶
func (*App) InitSpecialKeepers ¶
func (app *App) InitSpecialKeepers( cdc codec.Codec, legacyAmino *codec.LegacyAmino, bApp *baseapp.BaseApp, skipUpgradeHeights map[int64]bool, homePath string)
InitSpecialKeepers initiates special keepers (crisis appkeeper, upgradekeeper, params keeper)
func (*App) SetupHooks ¶
func (app *App) SetupHooks()
type AppKeepers ¶
type AppKeepers struct {
Cosmos struct {
Acct authkeeper.AccountKeeper
Authz authzkeeper.Keeper
FeeGrant feegrantkeeper.Keeper
Bank bankkeeper.Keeper
Staking *stakingkeeper.Keeper
Slashing slashingkeeper.Keeper
Mint mintkeeper.Keeper
Distr distrkeeper.Keeper
Gov *govkeeper.Keeper
Upgrade *upgradekeeper.Keeper
Crisis *crisiskeeper.Keeper //nolint: staticcheck
Params paramskeeper.Keeper //nolint: staticcheck
ConsensusParams *consensusparamkeeper.Keeper
IBC *ibckeeper.Keeper
Evidence *evidencekeeper.Keeper
Transfer ibctransferkeeper.Keeper
Wasm wasmkeeper.Keeper
}
Akash struct {
Escrow ekeeper.Keeper
Deployment dkeeper.IKeeper
Take tkeeper.IKeeper
Market mkeeper.IKeeper
Provider pkeeper.IKeeper
Audit akeeper.Keeper
Cert ckeeper.Keeper
Reputation rkeeper.Keeper
}
Modules struct {
TMLight ibctm.LightClientModule
}
}
type AutomationKeeper ¶
type AutomationKeeper struct {
// contains filtered or unexported fields
}
AutomationKeeper manages automation state and execution
func NewAutomationKeeper ¶
func NewAutomationKeeper( storeKey storetypes.StoreKey, wasmKeeper *wasmkeeper.Keeper, logger log.Logger, ) *AutomationKeeper
NewAutomationKeeper creates a new automation keeper
func (*AutomationKeeper) CancelTask ¶
CancelTask cancels a scheduled task
func (*AutomationKeeper) ExecutePendingTasks ¶
func (k *AutomationKeeper) ExecutePendingTasks(ctx sdk.Context)
ExecutePendingTasks runs all tasks due for execution This should be called at EndBlock
func (*AutomationKeeper) GetAllTasks ¶
func (k *AutomationKeeper) GetAllTasks(ctx sdk.Context) []ScheduledTask
GetAllTasks returns all scheduled tasks
func (*AutomationKeeper) GetState ¶
func (k *AutomationKeeper) GetState(ctx sdk.Context) AutomationState
GetState returns the current automation state
func (*AutomationKeeper) GetTasks ¶
func (k *AutomationKeeper) GetTasks(ctx sdk.Context, contractAddr string) []ScheduledTask
GetTasks returns all tasks for a given contract
func (*AutomationKeeper) ScheduleBlockTask ¶
func (k *AutomationKeeper) ScheduleBlockTask( ctx sdk.Context, owner string, contractAddr string, executeMsg string, interval uint64, gasLimit uint64, maxExecutions uint64, priority TaskPriority, ) (uint64, error)
ScheduleBlockTask creates a block-interval scheduled task
func (*AutomationKeeper) ScheduleCronTask ¶
func (k *AutomationKeeper) ScheduleCronTask( ctx sdk.Context, owner string, contractAddr string, executeMsg string, cronExpression string, gasLimit uint64, maxExecutions uint64, priority TaskPriority, ) (uint64, error)
ScheduleCronTask creates a cron-scheduled task
func (*AutomationKeeper) ScheduleDailyTask ¶
func (k *AutomationKeeper) ScheduleDailyTask( ctx sdk.Context, owner string, contractAddr string, executeMsg string, hour uint8, gasLimit uint64, maxExecutions uint64, priority TaskPriority, ) (uint64, error)
ScheduleDailyTask creates a daily-scheduled task
func (*AutomationKeeper) ScheduleTask ¶
func (k *AutomationKeeper) ScheduleTask( ctx sdk.Context, owner string, contractAddr string, executeMsg string, interval uint64, gasLimit uint64, maxExecutions uint64, ) (uint64, error)
ScheduleTask creates a new scheduled task (block-based, for backward compatibility)
func (*AutomationKeeper) ScheduleTimeTask ¶
func (k *AutomationKeeper) ScheduleTimeTask( ctx sdk.Context, owner string, contractAddr string, executeMsg string, intervalSeconds uint64, gasLimit uint64, maxExecutions uint64, priority TaskPriority, ) (uint64, error)
ScheduleTimeTask creates a time-interval scheduled task
func (*AutomationKeeper) SetState ¶
func (k *AutomationKeeper) SetState(ctx sdk.Context, state AutomationState)
SetState saves the automation state
type AutomationState ¶
type AutomationState struct {
Tasks []ScheduledTask `json:"tasks"`
NextTaskID uint64 `json:"next_task_id"`
}
AutomationState stores all scheduled tasks
type AvailabilityEventInfo ¶
type AvailabilityEventInfo = apiwasm.AvailabilityEventInfo
type AvailabilityInfo ¶
type AvailabilityInfo = apiwasm.AvailabilityInfo
type CLIQueryOrchestrationMessagesRequest ¶
type CLIQueryOrchestrationMessagesRequest struct {
Recipient string `json:"recipient,omitempty"`
All bool `json:"all,omitempty"`
}
CLIQueryOrchestrationMessages is a format for CLI queries
type CommandAckPayload ¶
type CommandAckPayload = apiorch.CommandAckPayload
type ContainerStatus ¶
type ContainerStatus = apiorch.ContainerStatus
type CronField ¶
type CronField struct {
IsWildcard bool `json:"is_wildcard"`
Values []int `json:"values"`
Step int `json:"step"`
}
CronField represents a single field in a cron expression
type CronSchedule ¶
type CronSchedule struct {
Minute CronField `json:"minute"`
Hour CronField `json:"hour"`
Day CronField `json:"day"`
Month CronField `json:"month"`
Weekday CronField `json:"weekday"`
}
CronSchedule represents a parsed cron expression
func ParseCronExpression ¶
func ParseCronExpression(expr string) (*CronSchedule, error)
ParseCronExpression parses a cron string into a CronSchedule Format: "minute hour day month weekday" (5 fields)
func (*CronSchedule) NextExecutionTime ¶
func (s *CronSchedule) NextExecutionTime(from time.Time) time.Time
NextExecutionTime calculates the next execution time
func (*CronSchedule) ShouldExecute ¶
func (s *CronSchedule) ShouldExecute(t time.Time) bool
ShouldExecute checks if the cron schedule matches the given time
type DeploymentFailedPayload ¶
type DeploymentFailedPayload = apiorch.DeploymentFailedPayload
type DeploymentGroup ¶
type DeploymentGroup = apiwasm.DeploymentGroup
type DeploymentReadyPayload ¶
type DeploymentReadyPayload = apiorch.DeploymentReadyPayload
type DepositAmount ¶
type DepositAmount = apiwasm.DepositAmount
type ErrorPayload ¶
type ErrorPayload = apiorch.ErrorPayload
type Event ¶
type Event struct {
ID string `json:"id"`
Topic string `json:"topic"`
EventType string `json:"event_type"`
Data []byte `json:"data"`
Publisher string `json:"publisher"` // Contract or module that published
CreatedAt uint64 `json:"created_at"` // Block height
TTL uint64 `json:"ttl"` // Block height when event expires
}
Event represents a published event on a topic
type EventStreamKeeper ¶
type EventStreamKeeper struct {
// contains filtered or unexported fields
}
EventStreamKeeper manages event streaming and topic subscriptions
func NewEventStreamKeeper ¶
func NewEventStreamKeeper( storeKey storetypes.StoreKey, logger log.Logger, ) *EventStreamKeeper
NewEventStreamKeeper creates a new event stream keeper
func (*EventStreamKeeper) CleanupExpiredEvents ¶
func (k *EventStreamKeeper) CleanupExpiredEvents(ctx sdk.Context)
CleanupExpiredEvents removes expired events (called periodically)
func (*EventStreamKeeper) DeliverEvents ¶
DeliverEvents returns all events for topics a contract is subscribed to
func (*EventStreamKeeper) GetState ¶
func (k *EventStreamKeeper) GetState(ctx sdk.Context) EventStreamState
GetState returns the current event stream state
func (*EventStreamKeeper) GetTopicSubscribers ¶
GetTopicSubscribers returns all contracts subscribed to a topic
func (*EventStreamKeeper) ProcessPendingEvents ¶
func (k *EventStreamKeeper) ProcessPendingEvents(ctx sdk.Context, messageBus *MessageBusKeeper)
ProcessPendingEvents processes events and delivers them to subscribers via message bus This should be called at EndBlock after message bus processing
func (*EventStreamKeeper) PublishEvent ¶
func (k *EventStreamKeeper) PublishEvent(ctx sdk.Context, topic string, eventType string, data []byte, publisher string) (string, error)
PublishEvent publishes an event to a topic
func (*EventStreamKeeper) SetState ¶
func (k *EventStreamKeeper) SetState(ctx sdk.Context, state EventStreamState)
SetState saves the event stream state
func (*EventStreamKeeper) Unsubscribe ¶
Unsubscribe removes a contract subscription from a topic
type EventStreamState ¶
type EventStreamState struct {
Events []Event `json:"events"`
Subscribers map[string][]string `json:"subscribers"` // topic -> []contract_address
NextEventID uint64 `json:"next_event_id"`
}
EventStreamState stores all events and topic subscriptions
type ForwardedPort ¶
type ForwardedPort = apiorch.ForwardedPort
type GetPendingMessagesRequest ¶
type GetPendingMessagesRequest = apiwasm.GetPendingMessagesRequest
type GetPendingMessagesResponse ¶
type GetPendingMessagesResponse = apiwasm.GetPendingMessagesResponse
type GetSubscriptionsRequest ¶
type GetSubscriptionsRequest = apiwasm.GetSubscriptionsRequest
type GetSubscriptionsResponse ¶
type GetSubscriptionsResponse = apiwasm.GetSubscriptionsResponse
type GetTopicSubscribersRequest ¶
type GetTopicSubscribersRequest = apiwasm.GetTopicSubscribersRequest
type GetTopicSubscribersResponse ¶
type GetTopicSubscribersResponse = apiwasm.GetTopicSubscribersResponse
type HealthAlertPayload ¶
type HealthAlertPayload = apiorch.HealthAlertPayload
type HealthRequestPayload ¶
type HealthRequestPayload = apiorch.HealthRequestPayload
type HealthResponsePayload ¶
type HealthResponsePayload = apiorch.HealthResponsePayload
type HealthStatus ¶
type HealthStatus = apiorch.HealthStatus
type LeaseIdentifier ¶
type LeaseIdentifier = apiorch.LeaseIdentifier
type LogsRequestPayload ¶
type LogsRequestPayload = apiorch.LogsRequestPayload
type LogsResponsePayload ¶
type LogsResponsePayload = apiorch.LogsResponsePayload
type ManifestStoreKeeper ¶
type ManifestStoreKeeper struct {
// contains filtered or unexported fields
}
ManifestStoreKeeper manages manifest storage on-chain
func NewManifestStoreKeeper ¶
func NewManifestStoreKeeper(storeKey storetypes.StoreKey, cdc codec.BinaryCodec) *ManifestStoreKeeper
NewManifestStoreKeeper creates a new manifest store keeper
func (*ManifestStoreKeeper) DeleteManifest ¶
func (k *ManifestStoreKeeper) DeleteManifest(ctx sdk.Context, owner string, dseq uint64)
DeleteManifest removes a manifest for a deployment
func (*ManifestStoreKeeper) GetManifest ¶
func (k *ManifestStoreKeeper) GetManifest(ctx sdk.Context, owner string, dseq uint64) (*StoredManifest, error)
GetManifest retrieves a manifest for a deployment
func (*ManifestStoreKeeper) HasManifest ¶
HasManifest checks if a manifest exists for a deployment
func (*ManifestStoreKeeper) SetManifest ¶
func (k *ManifestStoreKeeper) SetManifest(ctx sdk.Context, owner string, dseq uint64, manifestBytes []byte, sdl string) error
SetManifest stores a manifest for a deployment
type MessageBusKeeper ¶
type MessageBusKeeper struct {
// contains filtered or unexported fields
}
MessageBusKeeper manages message bus state and routing
func NewMessageBusKeeper ¶
func NewMessageBusKeeper( messageStore storetypes.StoreKey, subscriptionStore storetypes.StoreKey, logger log.Logger, ) *MessageBusKeeper
NewMessageBusKeeper creates a new message bus keeper
func (*MessageBusKeeper) CleanupExpiredMessages ¶
func (k *MessageBusKeeper) CleanupExpiredMessages(ctx sdk.Context)
CleanupExpiredMessages removes expired messages (called periodically)
func (*MessageBusKeeper) DeliverMessages ¶
func (k *MessageBusKeeper) DeliverMessages(ctx sdk.Context, contract string) ([]MessageEnvelope, error)
DeliverMessages returns all pending messages for a contract
func (*MessageBusKeeper) GetPendingMessages ¶
func (k *MessageBusKeeper) GetPendingMessages(ctx sdk.Context, contract string) ([]MessageEnvelope, error)
GetPendingMessages returns all pending messages for a contract (without marking as delivered)
func (*MessageBusKeeper) GetState ¶
func (k *MessageBusKeeper) GetState(ctx sdk.Context) MessageBusState
GetState returns the current message bus state
func (*MessageBusKeeper) GetSubscriptions ¶
func (k *MessageBusKeeper) GetSubscriptions(ctx sdk.Context, contract string) ([]Subscription, error)
GetSubscriptions returns all subscriptions for a contract
func (*MessageBusKeeper) GetTopicSubscribers ¶
GetTopicSubscribers returns all contracts subscribed to a topic
func (*MessageBusKeeper) ProcessPendingMessages ¶
func (k *MessageBusKeeper) ProcessPendingMessages(ctx sdk.Context)
ProcessPendingMessages processes all pending messages and delivers them to subscribers. Topic-based messages are fanned out: for each subscriber, a per-subscriber copy is appended to the message list so that DeliverMessages can pick them up individually.
func (*MessageBusKeeper) SendMessage ¶
func (k *MessageBusKeeper) SendMessage(ctx sdk.Context, envelope MessageEnvelope) (string, error)
SendMessage creates a new message and routes it to the destination
func (*MessageBusKeeper) SetState ¶
func (k *MessageBusKeeper) SetState(ctx sdk.Context, state MessageBusState)
SetState saves the message bus state
func (*MessageBusKeeper) Unsubscribe ¶
Unsubscribe removes a contract subscription from a topic
type MessageBusMsg ¶
type MessageBusMsg = apiwasm.MessageBusMsg
type MessageBusQuery ¶
type MessageBusQuery = apiwasm.MessageBusQuery
type MessageBusState ¶
type MessageBusState struct {
Messages []MessageEnvelope `json:"messages"`
Subscriptions []Subscription `json:"subscriptions"`
NextMessageID uint64 `json:"next_message_id"`
}
MessageBusState stores all messages and subscriptions
type MessageEnvelope ¶
type MessageEnvelope = apiwasm.MessageEnvelope
type MetricsRequestPayload ¶
type MetricsRequestPayload = apiorch.MetricsRequestPayload
type MetricsResponsePayload ¶
type MetricsResponsePayload = apiorch.MetricsResponsePayload
type MsgAcceptBid ¶
type MsgAcceptBid = apiwasm.MsgAcceptBid
type MsgAckOrchestrationMessage ¶
type MsgAckOrchestrationMessage = apiwasm.MsgAckOrchestrationMessage
type MsgCloseDeployment ¶
type MsgCloseDeployment = apiwasm.MsgCloseDeployment
type MsgCloseGroup ¶
type MsgCloseGroup = apiwasm.MsgCloseGroup
type MsgCloseLease ¶
type MsgCloseLease = apiwasm.MsgCloseLease
type MsgCreateDeployment ¶
type MsgCreateDeployment = apiwasm.MsgCreateDeployment
type MsgCreateLease ¶
type MsgCreateLease = apiwasm.MsgCreateLease
type MsgDepositDeployment ¶
type MsgDepositDeployment = apiwasm.MsgDepositDeployment
type MsgReportHealth ¶
type MsgReportHealth = apiwasm.MsgReportHealth
type MsgRequestHealth ¶
type MsgRequestHealth = apiwasm.MsgRequestHealth
type MsgRequestLogs ¶
type MsgRequestLogs = apiwasm.MsgRequestLogs
type MsgRequestStatus ¶
type MsgRequestStatus = apiwasm.MsgRequestStatus
type MsgSendProviderCommand ¶
type MsgSendProviderCommand = apiwasm.MsgSendProviderCommand
type MsgSetDeploymentManifest ¶
type MsgSetDeploymentManifest = apiwasm.MsgSetDeploymentManifest
type MsgSetDeploymentManifestInternal ¶
type MsgSetDeploymentManifestInternal struct {
Owner string `json:"owner"`
DSeq uint64 `json:"dseq"`
Manifest []byte `json:"manifest"`
SDL string `json:"sdl"`
}
MsgSetDeploymentManifestInternal is an internal message for manifest storage This implements sdk.Msg interface so it can be processed by the chain
func (*MsgSetDeploymentManifestInternal) GetSigners ¶
func (m *MsgSetDeploymentManifestInternal) GetSigners() []sdk.AccAddress
func (*MsgSetDeploymentManifestInternal) ProtoMessage ¶
func (m *MsgSetDeploymentManifestInternal) ProtoMessage()
func (*MsgSetDeploymentManifestInternal) Reset ¶
func (m *MsgSetDeploymentManifestInternal) Reset()
func (*MsgSetDeploymentManifestInternal) String ¶
func (m *MsgSetDeploymentManifestInternal) String() string
func (*MsgSetDeploymentManifestInternal) ValidateBasic ¶
func (m *MsgSetDeploymentManifestInternal) ValidateBasic() error
type MsgSetManifestRef ¶
type MsgSetManifestRef struct {
Owner string `json:"owner"`
DSeq uint64 `json:"dseq"`
SDLHash []byte `json:"sdl_hash"` // SHA256 of SDL content
SDL string `json:"sdl"` // Original SDL (for debugging only)
}
MsgSetManifestRef stores only the manifest hash (content-hash model) The full manifest is stored off-chain in a content store
func (*MsgSetManifestRef) GetSigners ¶
func (m *MsgSetManifestRef) GetSigners() []sdk.AccAddress
func (*MsgSetManifestRef) ProtoMessage ¶
func (m *MsgSetManifestRef) ProtoMessage()
func (*MsgSetManifestRef) Reset ¶
func (m *MsgSetManifestRef) Reset()
func (*MsgSetManifestRef) String ¶
func (m *MsgSetManifestRef) String() string
func (*MsgSetManifestRef) ValidateBasic ¶
func (m *MsgSetManifestRef) ValidateBasic() error
type MsgSubmitProviderScore ¶
type MsgSubmitProviderScore = apiwasm.MsgSubmitProviderScore
type OrchestrationKeeper ¶
type OrchestrationKeeper struct {
// contains filtered or unexported fields
}
OrchestrationKeeper manages orchestration messages
func NewOrchestrationKeeper ¶
func NewOrchestrationKeeper( storeKey storetypes.StoreKey, logger log.Logger, limits ...OrchestrationQueueLimits, ) *OrchestrationKeeper
NewOrchestrationKeeper creates a new orchestration keeper
func (*OrchestrationKeeper) CleanupExpiredMessages ¶
func (k *OrchestrationKeeper) CleanupExpiredMessages(ctx sdk.Context)
CleanupExpiredMessages removes expired and old processed messages
func (*OrchestrationKeeper) CreateDeploymentReadyEvent ¶
func (k *OrchestrationKeeper) CreateDeploymentReadyEvent( ctx sdk.Context, provider string, contract string, leaseID LeaseIdentifier, services []string, forwardedPorts []ForwardedPort, startupTime int64, ) (string, error)
CreateDeploymentReadyEvent creates a deployment ready event
func (*OrchestrationKeeper) CreateHealthAlert ¶
func (k *OrchestrationKeeper) CreateHealthAlert( ctx sdk.Context, provider string, contract string, leaseID LeaseIdentifier, service string, prevStatus HealthStatus, newStatus HealthStatus, message string, ) (string, error)
CreateHealthAlert creates a health alert event
func (*OrchestrationKeeper) CreateHealthRequest ¶
func (k *OrchestrationKeeper) CreateHealthRequest( ctx sdk.Context, from string, leaseID LeaseIdentifier, services []string, detailed bool, ) (string, error)
CreateHealthRequest creates a health request message
func (*OrchestrationKeeper) CreateHealthResponse ¶
func (k *OrchestrationKeeper) CreateHealthResponse( ctx sdk.Context, from string, to string, leaseID LeaseIdentifier, correlationID string, overall HealthStatus, services []ServiceHealth, message string, ) (string, error)
CreateHealthResponse creates a health response message
func (*OrchestrationKeeper) CreateStatusRequest ¶
func (k *OrchestrationKeeper) CreateStatusRequest( ctx sdk.Context, from string, leaseID LeaseIdentifier, includeContainers bool, includeResources bool, ) (string, error)
CreateStatusRequest creates a status request message
func (*OrchestrationKeeper) GetMessagesForContract ¶
func (k *OrchestrationKeeper) GetMessagesForContract( ctx sdk.Context, contract string, ) []OrchestrationMessage
GetMessagesForContract returns unprocessed messages for a contract
func (*OrchestrationKeeper) GetMessagesForLease ¶
func (k *OrchestrationKeeper) GetMessagesForLease( ctx sdk.Context, leaseID LeaseIdentifier, ) []OrchestrationMessage
GetMessagesForLease returns unprocessed messages for a lease
func (*OrchestrationKeeper) GetMessagesForProvider ¶
func (k *OrchestrationKeeper) GetMessagesForProvider( ctx sdk.Context, provider string, ) []OrchestrationMessage
GetMessagesForProvider returns unprocessed messages for a provider
func (*OrchestrationKeeper) GetState ¶
func (k *OrchestrationKeeper) GetState(ctx sdk.Context) OrchestrationState
GetState returns the current orchestration state
func (*OrchestrationKeeper) MarkMessageProcessed ¶
func (k *OrchestrationKeeper) MarkMessageProcessed( ctx sdk.Context, messageID string, ) error
MarkMessageProcessed marks a message as processed
func (*OrchestrationKeeper) ProcessOrchestrationMessages ¶
func (k *OrchestrationKeeper) ProcessOrchestrationMessages(ctx sdk.Context)
ProcessOrchestrationMessages processes pending orchestration messages. Called at EndBlock.
func (*OrchestrationKeeper) QueueLimits ¶
func (k *OrchestrationKeeper) QueueLimits() OrchestrationQueueLimits
QueueLimits returns the keeper's effective queue limits.
func (*OrchestrationKeeper) SendMessage ¶
func (k *OrchestrationKeeper) SendMessage( ctx sdk.Context, from string, to string, messageType OrchestrationMessageType, leaseID LeaseIdentifier, payload interface{}, correlationID string, ) (string, error)
SendMessage creates a new orchestration message
func (*OrchestrationKeeper) SetState ¶
func (k *OrchestrationKeeper) SetState(ctx sdk.Context, state OrchestrationState)
SetState saves the orchestration state
func (*OrchestrationKeeper) SignMessage ¶
func (k *OrchestrationKeeper) SignMessage(ctx sdk.Context, msg *OrchestrationMessage) error
SignMessage computes an HMAC-SHA256 signature for a message. The key is derived from the sender's address combined with a chain-level secret. This provides authenticity verification — the provider can verify that a command came from the actual contract/address claimed in the From field.
func (*OrchestrationKeeper) VerifyMessageSignature ¶
func (k *OrchestrationKeeper) VerifyMessageSignature(ctx sdk.Context, msg *OrchestrationMessage) bool
VerifyMessageSignature verifies an orchestration message's HMAC signature. Returns true if the signature is valid, false otherwise.
type OrchestrationMessage ¶
type OrchestrationMessage = apiorch.OrchestrationMessage
type OrchestrationMessageInfo ¶
type OrchestrationMessageInfo = apiwasm.OrchestrationMessageInfo
type OrchestrationMessageType ¶
type OrchestrationMessageType = apiorch.OrchestrationMessageType
type OrchestrationQueryHandler ¶
type OrchestrationQueryHandler struct {
// contains filtered or unexported fields
}
OrchestrationQueryHandler handles REST queries for orchestration messages
func NewOrchestrationQueryHandler ¶
func NewOrchestrationQueryHandler(keeper *OrchestrationKeeper) *OrchestrationQueryHandler
NewOrchestrationQueryHandler creates a new query handler
func (*OrchestrationQueryHandler) HandleCLIQuery ¶
func (h *OrchestrationQueryHandler) HandleCLIQuery(ctx sdk.Context, req CLIQueryOrchestrationMessagesRequest) ([]byte, error)
HandleCLIQuery handles CLI query for orchestration messages
func (*OrchestrationQueryHandler) QueryAllPendingMessages ¶
func (h *OrchestrationQueryHandler) QueryAllPendingMessages(ctx sdk.Context) QueryOrchestrationMessagesResponse
QueryAllPendingMessages returns all pending messages (for debugging)
func (*OrchestrationQueryHandler) QueryMessagesForRecipient ¶
func (h *OrchestrationQueryHandler) QueryMessagesForRecipient(ctx sdk.Context, recipient string) QueryOrchestrationMessagesResponse
QueryMessagesForRecipient returns all pending messages for a recipient (provider or contract)
func (*OrchestrationQueryHandler) QueryQueueDepth ¶
func (h *OrchestrationQueryHandler) QueryQueueDepth(ctx sdk.Context, leaseID string) OrchestrationQueueDepthResponse
QueryQueueDepth returns pending queue depth, optionally filtered by lease.
type OrchestrationQueueAdapter ¶
type OrchestrationQueueAdapter struct {
K *OrchestrationKeeper
}
OrchestrationQueueAdapter wraps the app-level *OrchestrationKeeper so it satisfies orchestrationtypes.OrchestrationQueueKeeper. Lives in this package (not x/orchestration/keeper) to avoid an import cycle: node/app/types already holds the concrete OrchestrationKeeper, and the x/orchestration module cannot import node/app/types because node/app imports the module for wiring.
func (OrchestrationQueueAdapter) Enqueue ¶
func (a OrchestrationQueueAdapter) Enqueue( ctx sdk.Context, from string, to string, messageType string, leaseID orchestrationtypes.QueueLeaseID, payload interface{}, correlationID string, ) (string, error)
Enqueue forwards to OrchestrationKeeper.SendMessage, converting the domain-independent types from x/orchestration/types to the concrete app-level types.
type OrchestrationQueueDepthLease ¶
type OrchestrationQueueDepthLease struct {
LeaseID string `json:"lease_id"`
Count uint32 `json:"count"`
Bytes uint64 `json:"bytes"`
}
OrchestrationQueueDepthLease contains queue depth for one lease.
type OrchestrationQueueDepthResponse ¶
type OrchestrationQueueDepthResponse struct {
TotalPending uint32 `json:"total_pending"`
TotalBytes uint64 `json:"total_bytes"`
ByLease []OrchestrationQueueDepthLease `json:"by_lease"`
Limits OrchestrationQueueLimits `json:"limits"`
}
OrchestrationQueueDepthResponse summarizes pending queue depth. It is used by operator-facing diagnostics and intentionally avoids returning full payload bodies.
type OrchestrationQueueLimits ¶
type OrchestrationQueueLimits struct {
MaxMessagesPerLease uint32 `json:"max_messages_per_lease"`
MaxMessagesTotal uint32 `json:"max_messages_total"`
MaxMessageBytes uint64 `json:"max_message_bytes"`
DefaultTTLBlocks uint64 `json:"default_ttl_blocks"`
}
OrchestrationQueueLimits are operator-visible queue controls for the app-level orchestration queue. Defaults match the pre-P1 constants so existing deployments keep the same behavior.
func DefaultOrchestrationQueueLimits ¶
func DefaultOrchestrationQueueLimits() OrchestrationQueueLimits
DefaultOrchestrationQueueLimits returns the historical queue limits.
type OrchestrationState ¶
type OrchestrationState struct {
Messages []OrchestrationMessage `json:"messages"`
NextMessageID uint64 `json:"next_message_id"`
}
OrchestrationState stores orchestration messages
type PlacementSpec ¶
type PlacementSpec = apiwasm.PlacementSpec
type PricingSpec ¶
type PricingSpec = apiwasm.PricingSpec
type ProcessMessagesRequest ¶
type ProcessMessagesRequest = apiwasm.ProcessMessagesRequest
type ProcessMessagesResponse ¶
type ProcessMessagesResponse = apiwasm.ProcessMessagesResponse
type ProviderAggregateInfo ¶
type ProviderAggregateInfo = apiwasm.ProviderAggregateInfo
type ProviderDetails ¶
type ProviderDetails = apiwasm.ProviderDetails
type ProviderEvent ¶
type ProviderEvent struct {
Provider string `json:"provider"`
EventType string `json:"event_type"` // "deployment_started", "health_update", "capacity_changed", etc.
DeploymentID string `json:"deployment_id,omitempty"` // Optional: dseq or lease ID
LeaseID string `json:"lease_id,omitempty"` // Optional: full lease ID
Data []byte `json:"data"` // Event-specific data (JSON)
Timestamp uint64 `json:"timestamp"` // Unix timestamp
BlockHeight uint64 `json:"block_height"` // Block height when event occurred
}
ProviderEvent represents an event from a provider
type ProviderEventPublisher ¶
type ProviderEventPublisher struct {
// contains filtered or unexported fields
}
ProviderEventPublisher handles publishing provider events to contracts
func NewProviderEventPublisher ¶
func NewProviderEventPublisher( messageBusKeeper *MessageBusKeeper, eventStreamKeeper *EventStreamKeeper, logger log.Logger, ) *ProviderEventPublisher
NewProviderEventPublisher creates a new provider event publisher
func NewProviderEventPublisherWithOrchestration ¶
func NewProviderEventPublisherWithOrchestration( messageBusKeeper *MessageBusKeeper, eventStreamKeeper *EventStreamKeeper, orchestrationKeeper *OrchestrationKeeper, logger log.Logger, ) *ProviderEventPublisher
NewProviderEventPublisherWithOrchestration creates a publisher with orchestration support
func (*ProviderEventPublisher) GetProviderEventSubscribers ¶
func (p *ProviderEventPublisher) GetProviderEventSubscribers( ctx sdk.Context, provider string, ) ([]string, error)
GetProviderEventSubscribers returns contracts subscribed to provider events
func (*ProviderEventPublisher) PublishBidAccepted ¶
func (p *ProviderEventPublisher) PublishBidAccepted( ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, ) error
PublishBidAccepted publishes when a bid is accepted (lease created)
func (*ProviderEventPublisher) PublishBidSubmitted ¶
func (p *ProviderEventPublisher) PublishBidSubmitted( ctx sdk.Context, provider string, owner string, dseq uint64, gseq uint32, oseq uint32, price string, ) error
PublishBidSubmitted publishes when a provider submits a bid
func (*ProviderEventPublisher) PublishCapacityChanged ¶
func (p *ProviderEventPublisher) PublishCapacityChanged( ctx sdk.Context, provider string, availableCPU uint64, availableMemory uint64, availableStorage uint64, ) error
PublishCapacityChanged publishes a capacity change event
func (*ProviderEventPublisher) PublishDeploymentFailed ¶
func (p *ProviderEventPublisher) PublishDeploymentFailed( ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, reason string, stage string, details string, ) error
PublishDeploymentFailed publishes when a deployment fails
func (*ProviderEventPublisher) PublishDeploymentReady ¶
func (p *ProviderEventPublisher) PublishDeploymentReady( ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, services []string, forwardedPorts []ForwardedPort, startupTimeSeconds int64, ) error
PublishDeploymentReady publishes when a deployment's pods are ready This uses the OrchestrationKeeper to send to specific contract
func (*ProviderEventPublisher) PublishDeploymentStarted ¶
func (p *ProviderEventPublisher) PublishDeploymentStarted( ctx sdk.Context, provider string, deploymentID string, leaseID string, data map[string]interface{}, ) error
PublishDeploymentStarted publishes a deployment started event
func (*ProviderEventPublisher) PublishEvent ¶
func (p *ProviderEventPublisher) PublishEvent( ctx sdk.Context, event ProviderEvent, ) error
PublishEvent publishes a provider event to interested contracts
func (*ProviderEventPublisher) PublishHealthAlert ¶
func (p *ProviderEventPublisher) PublishHealthAlert( ctx sdk.Context, provider string, contractAddr string, leaseID LeaseIdentifier, service string, prevStatus HealthStatus, newStatus HealthStatus, message string, ) error
PublishHealthAlert publishes a health status change alert
func (*ProviderEventPublisher) PublishHealthUpdate ¶
func (p *ProviderEventPublisher) PublishHealthUpdate( ctx sdk.Context, provider string, leaseID string, status string, message string, ) error
PublishHealthUpdate publishes a health status update event
func (*ProviderEventPublisher) PublishLeaseCreated ¶
func (p *ProviderEventPublisher) PublishLeaseCreated( ctx sdk.Context, provider string, leaseID LeaseIdentifier, price string, ) error
PublishLeaseCreated publishes when a lease is created for this provider
func (*ProviderEventPublisher) RouteProviderEventToContract ¶
func (p *ProviderEventPublisher) RouteProviderEventToContract( ctx sdk.Context, contract string, event ProviderEvent, ) error
RouteProviderEventToContract routes a provider event directly to a specific contract
func (*ProviderEventPublisher) SetOrchestrationKeeper ¶
func (p *ProviderEventPublisher) SetOrchestrationKeeper(keeper *OrchestrationKeeper)
SetOrchestrationKeeper sets the orchestration keeper
type ProviderInfo ¶
type ProviderInfo = apiwasm.ProviderInfo
type QueryActiveProviderEndpointsRequest ¶
type QueryActiveProviderEndpointsRequest = apiwasm.QueryActiveProviderEndpointsRequest
type QueryActiveProviderEndpointsResponse ¶
type QueryActiveProviderEndpointsResponse = apiwasm.QueryActiveProviderEndpointsResponse
type QueryBidsRequest ¶
type QueryBidsRequest = apiwasm.QueryBidsRequest
type QueryBidsResponse ¶
type QueryBidsResponse = apiwasm.QueryBidsResponse
type QueryDeploymentManifestRequest ¶
type QueryDeploymentManifestRequest = apiwasm.QueryDeploymentManifestRequest
type QueryDeploymentManifestResponse ¶
type QueryDeploymentManifestResponse = apiwasm.QueryDeploymentManifestResponse
type QueryDeploymentRequest ¶
type QueryDeploymentRequest = apiwasm.QueryDeploymentRequest
type QueryDeploymentResponse ¶
type QueryDeploymentResponse = apiwasm.QueryDeploymentResponse
type QueryEscrowBalanceRequest ¶
type QueryEscrowBalanceRequest = apiwasm.QueryEscrowBalanceRequest
type QueryEscrowBalanceResponse ¶
type QueryEscrowBalanceResponse = apiwasm.QueryEscrowBalanceResponse
type QueryHealthRequest ¶
type QueryHealthRequest = apiwasm.QueryHealthRequest
type QueryHealthResponse ¶
type QueryHealthResponse = apiwasm.QueryHealthResponse
type QueryLeaseMessagesRequest ¶
type QueryLeaseMessagesRequest = apiwasm.QueryLeaseMessagesRequest
type QueryLeaseRequest ¶
type QueryLeaseRequest = apiwasm.QueryLeaseRequest
type QueryLeaseResponse ¶
type QueryLeaseResponse = apiwasm.QueryLeaseResponse
type QueryManifestRefRequest ¶
type QueryManifestRefRequest = apiwasm.QueryManifestRefRequest
type QueryManifestRefResponse ¶
type QueryManifestRefResponse = apiwasm.QueryManifestRefResponse
type QueryOrchestrationMessagesRequest ¶
type QueryOrchestrationMessagesRequest = apiwasm.QueryOrchestrationMessagesRequest
type QueryOrchestrationMessagesResponse ¶
type QueryOrchestrationMessagesResponse = apiwasm.QueryOrchestrationMessagesResponse
type QueryOrderRequest ¶
type QueryOrderRequest = apiwasm.QueryOrderRequest
type QueryOrderResponse ¶
type QueryOrderResponse = apiwasm.QueryOrderResponse
type QueryProviderRequest ¶
type QueryProviderRequest = apiwasm.QueryProviderRequest
type QueryProviderResponse ¶
type QueryProviderResponse = apiwasm.QueryProviderResponse
type QueryProvidersRequest ¶
type QueryProvidersRequest = apiwasm.QueryProvidersRequest
type QueryProvidersResponse ¶
type QueryProvidersResponse = apiwasm.QueryProvidersResponse
type QueryReputationAvailabilityHistoryRequest ¶
type QueryReputationAvailabilityHistoryRequest = apiwasm.QueryReputationAvailabilityHistoryRequest
type QueryReputationAvailabilityHistoryResponse ¶
type QueryReputationAvailabilityHistoryResponse = apiwasm.QueryReputationAvailabilityHistoryResponse
type QueryReputationAvailabilityRequest ¶
type QueryReputationAvailabilityRequest = apiwasm.QueryReputationAvailabilityRequest
type QueryReputationAvailabilityResponse ¶
type QueryReputationAvailabilityResponse = apiwasm.QueryReputationAvailabilityResponse
type QueryReputationHistoryRequest ¶
type QueryReputationHistoryRequest = apiwasm.QueryReputationHistoryRequest
type QueryReputationHistoryResponse ¶
type QueryReputationHistoryResponse = apiwasm.QueryReputationHistoryResponse
type QueryReputationParamsRequest ¶
type QueryReputationParamsRequest = apiwasm.QueryReputationParamsRequest
type QueryReputationParamsResponse ¶
type QueryReputationParamsResponse = apiwasm.QueryReputationParamsResponse
type QueryReputationProvidersRequest ¶
type QueryReputationProvidersRequest = apiwasm.QueryReputationProvidersRequest
type QueryReputationProvidersResponse ¶
type QueryReputationProvidersResponse = apiwasm.QueryReputationProvidersResponse
type QueryReputationScoreRequest ¶
type QueryReputationScoreRequest = apiwasm.QueryReputationScoreRequest
type QueryReputationScoreResponse ¶
type QueryReputationScoreResponse = apiwasm.QueryReputationScoreResponse
type ResourceAlertPayload ¶
type ResourceAlertPayload = apiorch.ResourceAlertPayload
type ResourceSpec ¶
type ResourceSpec = apiwasm.ResourceSpec
type ResourceUsage ¶
type ResourceUsage = apiorch.ResourceUsage
type RestartRequestPayload ¶
type RestartRequestPayload = apiorch.RestartRequestPayload
type ScaleRequestPayload ¶
type ScaleRequestPayload = apiorch.ScaleRequestPayload
type ScheduleType ¶
type ScheduleType int
ScheduleType defines how the task is scheduled
const ( // ScheduleTypeBlock executes every N blocks ScheduleTypeBlock ScheduleType = iota // ScheduleTypeTime executes every N seconds (based on block timestamps) ScheduleTypeTime // ScheduleTypeCron executes based on cron expression ScheduleTypeCron // ScheduleTypeDaily executes once per day at specified hour (UTC) ScheduleTypeDaily // ScheduleTypeWeekly executes once per week on specified day and hour (UTC) ScheduleTypeWeekly // ScheduleTypeEvent executes when a matching block event is emitted. ScheduleTypeEvent )
func (ScheduleType) String ¶
func (st ScheduleType) String() string
String returns string representation of schedule type
type ScheduledTask ¶
type ScheduledTask struct {
ID uint64 `json:"id"`
ContractAddress string `json:"contract_address"`
ExecuteMsg string `json:"execute_msg"` // JSON execute message (for Sudo)
// Scheduling configuration
ScheduleType ScheduleType `json:"schedule_type"`
Interval uint64 `json:"interval"` // Blocks or seconds between executions
CronExpression string `json:"cron_expression"` // For cron-type schedules
EventTopic string `json:"event_topic,omitempty"` // For event-triggered schedules
DailyHour uint8 `json:"daily_hour"` // Hour (0-23) for daily schedule
WeeklyDay uint8 `json:"weekly_day"` // Day (0=Sunday) for weekly schedule
// Execution tracking
LastExecuted uint64 `json:"last_executed"` // Last execution block
LastExecutedAt int64 `json:"last_executed_at"` // Last execution timestamp (unix seconds)
NextExecution uint64 `json:"next_execution"` // Next scheduled block (for block-based)
NextExecutionAt int64 `json:"next_execution_at"` // Next execution timestamp (for time-based)
// Ownership and limits
Owner string `json:"owner"` // Who owns this task
GasLimit uint64 `json:"gas_limit"` // Max gas per execution
MaxExecutions uint64 `json:"max_executions"` // 0 = unlimited
ExecutionCount uint64 `json:"execution_count"` // Current count
Enabled bool `json:"enabled"`
// Priority and retry
Priority TaskPriority `json:"priority"`
RetryCount uint64 `json:"retry_count"`
MaxRetries uint64 `json:"max_retries"`
RetryDelay uint64 `json:"retry_delay"` // Blocks to wait before retry
LastError string `json:"last_error"`
}
ScheduledTask represents an automated contract execution task
type ScoreEntryInfo ¶
type ScoreEntryInfo = apiwasm.ScoreEntryInfo
type SendMessageRequest ¶
type SendMessageRequest = apiwasm.SendMessageRequest
type SendMessageResponse ¶
type SendMessageResponse = apiwasm.SendMessageResponse
type ServiceHealth ¶
type ServiceHealth = apiorch.ServiceHealth
type ServiceMetrics ¶
type ServiceMetrics = apiorch.ServiceMetrics
type ServiceStatus ¶
type ServiceStatus = apiorch.ServiceStatus
type SetLeaseEnvAckPayload ¶
type SetLeaseEnvAckPayload = apiorch.SetLeaseEnvAckPayload
type SetLeaseEnvRequestPayload ¶
type SetLeaseEnvRequestPayload = apiorch.SetLeaseEnvRequestPayload
type StatusRequestPayload ¶
type StatusRequestPayload = apiorch.StatusRequestPayload
type StatusResponsePayload ¶
type StatusResponsePayload = apiorch.StatusResponsePayload
type StoredManifest ¶
type StoredManifest struct {
Owner string `json:"owner"`
DSeq uint64 `json:"dseq"`
Manifest []byte `json:"manifest"` // Raw manifest JSON bytes
SDL string `json:"sdl"` // Original SDL YAML (for reference)
Hash []byte `json:"hash"` // Canonical hash of the manifest
Version uint32 `json:"version"` // Version number (for updates)
CreatedAt int64 `json:"created_at"` // Block height when created
UpdatedAt int64 `json:"updated_at"` // Block height when last updated
}
StoredManifest represents a deployment manifest stored on-chain
type SubscribeRequest ¶
type SubscribeRequest = apiwasm.SubscribeRequest
type SubscribeResponse ¶
type SubscribeResponse = apiwasm.SubscribeResponse
type Subscription ¶
type Subscription = apiwasm.Subscription
type TaskPriority ¶
type TaskPriority int
TaskPriority defines execution priority
const ( PriorityLow TaskPriority = 0 PriorityNormal TaskPriority = 1 PriorityHigh TaskPriority = 2 PriorityCritical TaskPriority = 3 )
func (TaskPriority) String ¶
func (p TaskPriority) String() string
String returns string representation of priority
type UnsubscribeRequest ¶
type UnsubscribeRequest = apiwasm.UnsubscribeRequest
type UnsubscribeResponse ¶
type UnsubscribeResponse = apiwasm.UnsubscribeResponse