schema

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MPL-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ModuleFormatToken    = "hymx.core.token.0.0.0"
	ModuleFormatRegistry = "hymx.core.registry.0.0.0"

	AccountTypeAR  = "arweave"
	AccountTypeEVM = "evm"
)

Variables

View Source
var (
	ErrRegistryAlreadyCreated = errors.New("err_registry_already_created")
	ErrTokenAlreadyCreated    = errors.New("err_token_already_created")
	ErrInvalidModuleFormat    = errors.New("err_invalid_module_format")
	ErrInvalidNonce           = errors.New("err_invalid_nonce")
	ErrSequenceTooLow         = errors.New("err_sequence_too_low")
	ErrSpawnProcessFailed     = errors.New("err_spawn_process_failed")
	ErrProcessAlreadyExists   = errors.New("err_process_already_exist")
	ErrProcessNotFound        = errors.New("err_process_not_found")
	ErrProcessEnvNotFound     = errors.New("err_process_env_not_found")
	ErrRegistryNotNound       = errors.New("err_registry_not_found")
	ErrMissingParam           = errors.New("err_missing_param")
	ErrInvalidAccid           = errors.New("err_invalid_accid")
	ErrFactoryAlreadyMounted  = errors.New("err_factory_already_mounted")
)

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	Pid string
	Res chan Snapshot
}

type Env

type Env struct {
	Meta Meta `json:"Meta"`

	Id    string `json:"Id"`
	AccId string `json:"Acc-Id"`

	Process schema.Process `json:"Process"`
	Module  schema.Module  `json:"Module"`

	Nonce    int64 `json:"Nonce"`    // inbox nonce
	Sequence int64 `json:"Sequence"` // outbox sequence

	ReceivedSeq map[string]int64 `json:"Received-Sequence"` // Received msg from other address/process, addr -> sequence number
}

type Meta

type Meta struct {
	// from item
	ItemId string `json:"Item-Id"`
	Pid    string `json:"Pid"`
	AccId  string `json:"Acc-Id"`
	// from message
	Action      string `json:"Action"`
	FromProcess string `json:"From-Process"`
	PushedFor   string `json:"Pushed-For"`
	Sequence    int64  `json:"Sequence"`
	// from assignment
	Nonce     int64 `json:"Nonce"`
	Timestamp int64 `json:"Timestamp"`
	// input params
	Params map[string]string `json:"Params"`
	Data   string            `json:"Data"`

	DryRun           bool  `json:"-"`
	RecoveryMaxNonce int64 `json:"-"`
}

type Outbox

type Outbox struct {
	Type string
	To   string
	From string
	Data string
	Tags []goarSchema.Tag
}

type ResMessage

type ResMessage struct {
	Sequence string           `json:"Sequence"`
	Target   string           `json:"Target"`
	Data     string           `json:"Data,omitempty"`
	Tags     []goarSchema.Tag `json:"Tags"`
}

type ResSpawn

type ResSpawn struct {
	Sequence string           `json:"Sequence"`
	Data     string           `json:"Data,omitempty"`
	Tags     []goarSchema.Tag `json:"Tags"`
}

type Result

type Result struct {
	Nonce       string            `json:"Nonce"`
	Timestamp   string            `json:"Timestamp"`
	ItemId      string            `json:"Item-Id"`
	FromProcess string            `json:"From-Process"` // FromProcess is the source process (Pid) that produced this Result
	PushedFor   string            `json:"Pushed-For"`
	Messages    []*ResMessage     `json:"Messages"`
	Spawns      []*ResSpawn       `json:"Spawns"`
	Assignments []interface{}     `json:"Assignments"`
	Output      interface{}       `json:"Output"`
	Data        string            `json:"Data"`
	Cache       map[string]string `json:"Cache,omitempty"` // Cache contains the generated cache entries for users to read and query latest state
	DryRun      bool              `json:"-"`
	Error       string            `json:"Error"`
}

type Snapshot

type Snapshot struct {
	Env    Env    `json:"Env"`
	Data   string `json:"Data"`
	Outbox string `json:"Outbox"`
	Err    error  `json:"-"`
}

type Vm

type Vm interface {
	Apply(from string, meta Meta) (res *Result, err error)
	Checkpoint() (data string, err error)
	Restore(data string) error
	Close() error
}

type VmSpawnFunc

type VmSpawnFunc func(Env) (Vm, error)

Jump to

Keyboard shortcuts

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