schema

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MPL-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	NodeVersion  = "v0.4.8"
	GenesisAccId = "0x18b4bA4c118279b3eB60a2DB1E794Bc41AFC1D37"
)
View Source
const (
	StartModeNormal  = "normal"
	StartModeRebuild = "rebuild"
)

Variables

View Source
var (
	GenesisNode = schema.Node{
		AccId: GenesisAccId,
		Name:  "TestGenesisNode",
		Role:  schema.RoleMain,
		Desc:  "Test network genesis node",
		URL:   "https://hymatrix.ai",
	}

	TryAssignSleepTime = []time.Duration{
		0,
		500 * time.Millisecond,
		1 * time.Second,
		3 * time.Second,
		5 * time.Second,
		10 * time.Second,
		20 * time.Second,
		50 * time.Second,
		80 * time.Second,
	}
)
View Source
var (
	ErrInvalidType               = errors.New("err_invalid_type")
	ErrProcessIsRecovering       = errors.New("err_process_is_recovering")
	ErrProcessAlreadyExists      = errors.New("err_process_already_exist")
	ErrProcessNotFound           = errors.New("err_process_not_found")
	ErrSpawnRedirect             = errors.New("err_spwan_redirect")
	ErrMessageRedirect           = errors.New("err_message_redirect")
	ErrDuplicateItem             = errors.New("err_duplicate_item")
	ErrNotFoundNodes             = errors.New("err_not_found_nodes")
	ErrNotFoundCkp               = errors.New("err_not_found_ckp")
	ErrNotFoundMod               = errors.New("err_not_found_mod")
	ErrUnrecognizedSignatureType = errors.New("err_unrecognized_signature_type")
	ErrUnauthorizedNode          = errors.New("err_unauthorized_node")
)

Functions

This section is empty.

Types

type AssignMessage

type AssignMessage struct {
	Pid     string
	AccId   string
	Message schema.Message
	Item    goarSchema.BundleItem
}

type AssignProcess

type AssignProcess struct {
	Pid     string
	AccId   string
	Process schema.Process
	Item    goarSchema.BundleItem
}

type AssignResHandler added in v0.2.0

type AssignResHandler func(AssignmentResult)

type AssignmentResult added in v0.1.1

type AssignmentResult struct {
	Pid        string
	Item       goarSchema.BundleItem
	Assign     hymxSchema.Assignment
	AssignItem goarSchema.BundleItem
	Error      error
}

type IDB

type IDB interface {
	// result
	SaveResult(result vmmSchema.VmmResult) error
	GetResult(msgid string) (result *vmmSchema.VmmResult, err error)
	GetResults(pid string, limit int64) (results []vmmSchema.VmmResult, err error)

	// assignment
	IsExist(pid string) (ok bool, err error)
	GetNonce(pid string) (nonce int64, err error)
	Commit(pid string, nonce int64, msg, assign goarSchema.BundleItem) (err error)

	// get
	GetAllProcess() (pids []string, curNonces []int64, err error)
	GetMessage(msgid string) (msg *goarSchema.BundleItem, err error)
	GetMessageByNonce(pid string, nonce int64) (msg *goarSchema.BundleItem, err error)
	GetAssignByNonce(pid string, nonce int64) (assign *goarSchema.BundleItem, err error)

	// checkpoint
	GetCheckpointIndex(pid string) (id string, err error)
	SaveCheckpointIndex(pid, id string) (err error)

	// cache
	GetCache(pid, key string) (value string, err error)
	SaveCache(pid, key, value string) (err error)
}

type IDBOutbox

type IDBOutbox interface {
	Push(pid, target string, message goarSchema.BundleItem) error
	Peek(pid, target string) (*goarSchema.BundleItem, error)
	Commit(pid, target string, assign goarSchema.BundleItem) error

	Checkpoint(pid string) (string, error)
	Restore(data string) error
}

type Info

type Info struct {
	Protocol    string              `json:"Protocol"`
	Variant     string              `json:"Variant"`
	NodeVersion string              `json:"Node-Version"`
	JoinNetwork bool                `json:"Join-Network"`
	Token       string              `json:"Token"`
	Registry    string              `json:"Registry"`
	Node        registrySchema.Node `json:"Node"`
	VmCount     int64               `json:"Vm-Count"`
}

type ItemHandler added in v0.2.0

type ItemHandler func(ItemMeta) error

type ItemMeta added in v0.2.0

type ItemMeta struct {
	Pid         string
	Signer      string
	FromProcess string
	Instance    interface{}
}

type ResultHandler

type ResultHandler func(vmmSchema.VmmResult)

Jump to

Keyboard shortcuts

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