aivm

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "aivm"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AIAgent

type AIAgent struct {
	ID           ids.ShortID `json:"id"`
	Name         string      `json:"name"`
	Capabilities []string    `json:"capabilities"`
	Subnet       ids.ID      `json:"subnet"`
	Endpoint     string      `json:"endpoint"`
	PublicKey    []byte      `json:"publicKey"`
}

AIAgent represents an AI agent or model provider

type AITask

type AITask struct {
	ID          ids.ID      `json:"id"`
	Requester   ids.ShortID `json:"requester"`
	TaskType    string      `json:"taskType"`
	Parameters  []byte      `json:"parameters"`
	Status      TaskStatus  `json:"status"`
	Result      []byte      `json:"result,omitempty"`
	ProofOfWork []byte      `json:"proofOfWork,omitempty"`
	Fee         uint64      `json:"fee"`
	CreatedAt   int64       `json:"createdAt"`
	CompletedAt int64       `json:"completedAt,omitempty"`
}

AITask represents an AI computation task

type Block

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

Block represents a block in the AI Chain

func (*Block) Accept

func (b *Block) Accept() error

Accept implements the block.Block interface

func (*Block) Bytes

func (b *Block) Bytes() []byte

Bytes implements the block.Block interface

func (*Block) Height

func (b *Block) Height() uint64

Height implements the block.Block interface

func (*Block) ID

func (b *Block) ID() string

ID implements the block.Block interface

func (*Block) Parent

func (b *Block) Parent() ids.ID

Parent implements the block.Block interface

func (*Block) Reject

func (b *Block) Reject() error

Reject implements the block.Block interface

func (*Block) Status

func (b *Block) Status() choices.Status

Status implements the block.Block interface

func (*Block) Time

func (b *Block) Time() uint64

Time implements the block.Block interface

func (*Block) Verify

func (b *Block) Verify(ctx context.Context) error

Verify implements the block.Block interface

type Factory

type Factory struct{}

Factory creates new instances of the AI VM

func (*Factory) New

func (f *Factory) New(log.Logger) (interface{}, error)

New returns a new instance of the AI VM

type GPUProvider

type GPUProvider struct {
	NodeID       ids.NodeID `json:"nodeId"`
	GPUCount     int        `json:"gpuCount"`
	GPUType      string     `json:"gpuType"`
	MemoryGB     int        `json:"memoryGB"`
	Available    bool       `json:"available"`
	PricePerHour uint64     `json:"pricePerHour"`
}

GPUProvider represents a GPU compute provider

type TaskResult

type TaskResult struct {
	TaskID      ids.ID      `json:"taskId"`
	ExecutorID  ids.ShortID `json:"executorId"`
	Result      []byte      `json:"result"`
	Proof       []byte      `json:"proof"`
	ComputeTime uint64      `json:"computeTime"`
}

TaskResult represents the result of an AI task

type TaskStatus

type TaskStatus uint8

TaskStatus represents the status of an AI task

const (
	TaskPending TaskStatus = iota
	TaskAssigned
	TaskProcessing
	TaskCompleted
	TaskFailed
)

type VM

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

VM implements the chain.ChainVM interface for the AI Chain (A-Chain) This chain is specialized for AI computation and agent coordination

func (*VM) AppGossip

func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error

AppGossip implements the core.AppHandler interface

func (*VM) AppRequest

func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte) error

AppRequest implements the core.AppHandler interface

func (*VM) AppRequestFailed

func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, appErr *core.AppError) error

AppRequestFailed implements the core.AppHandler interface

func (*VM) AppResponse

func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error

AppResponse implements the core.AppHandler interface

func (*VM) BuildBlock

func (vm *VM) BuildBlock(ctx context.Context) (chain.Block, error)

BuildBlock implements the chain.ChainVM interface

func (*VM) Connected

func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error

Connected implements the validators.Connector interface

func (*VM) CreateHandlers

func (vm *VM) CreateHandlers(context.Context) (map[string]interface{}, error)

CreateHandlers implements the core.VM interface

func (*VM) CreateStaticHandlers

func (vm *VM) CreateStaticHandlers(context.Context) (map[string]interface{}, error)

CreateStaticHandlers implements the core.VM interface

func (*VM) CrossChainAppRequest

func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, msg []byte) error

CrossChainAppRequest implements the core.VM interface

func (*VM) CrossChainAppRequestFailed

func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, appErr *core.AppError) error

CrossChainAppRequestFailed implements the core.VM interface

func (*VM) CrossChainAppResponse

func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, msg []byte) error

CrossChainAppResponse implements the core.VM interface

func (*VM) Disconnected

func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error

Disconnected implements the validators.Connector interface

func (*VM) GetBlock

func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (chain.Block, error)

GetBlock implements the chain.ChainVM interface

func (*VM) GetBlockIDAtHeight

func (vm *VM) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)

GetBlockIDAtHeight implements the chain.ChainVM interface

func (*VM) HealthCheck

func (vm *VM) HealthCheck(context.Context) (any, error)

HealthCheck implements the health.Checker interface

func (*VM) Initialize

func (vm *VM) Initialize(
	ctx context.Context,
	chainCtx *core.Context,
	db interface{},
	genesisBytes []byte,
	upgradeBytes []byte,
	configBytes []byte,
	toEngine chan<- core.Message,
	fxs []*core.Fx,
	appSender core.AppSender,
) error

Initialize implements the core.VM interface

func (*VM) LastAccepted

func (vm *VM) LastAccepted(context.Context) (ids.ID, error)

LastAccepted implements the chain.ChainVM interface

func (*VM) ParseBlock

func (vm *VM) ParseBlock(ctx context.Context, blockBytes []byte) (chain.Block, error)

ParseBlock implements the chain.ChainVM interface

func (*VM) SetPreference

func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error

SetPreference implements the chain.ChainVM interface

func (*VM) SetState

func (vm *VM) SetState(ctx context.Context, state core.State) error

SetState implements the core.VM interface

func (*VM) Shutdown

func (vm *VM) Shutdown(context.Context) error

Shutdown implements the core.VM interface

func (*VM) Version

func (vm *VM) Version(context.Context) (string, error)

Version implements the core.VM interface

Jump to

Keyboard shortcuts

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