api

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashTask added in v0.24.0

func HashTask(req *CreateTaskReq, cfg *project.Config) ([32]byte, [32]byte, string, []any, error)

func Run

func Run(p *db.DB, projectManager *project.Manager,
	addr, sequencerAddr, proverAddr string) error

this func will block caller

Types

type CreateTaskReq

type CreateTaskReq struct {
	Nonce          uint64 `json:"nonce"                       binding:"required"`
	ProjectID      string `json:"projectID"                   binding:"required"`
	ProjectVersion string `json:"projectVersion,omitempty"`
	Payload        []byte `json:"payload"                     binding:"required"`
	Signature      string `json:"signature,omitempty"         binding:"required"`
}

func (CreateTaskReq) MarshalJSON added in v0.24.0

func (ct CreateTaskReq) MarshalJSON() ([]byte, error)

func (*CreateTaskReq) UnmarshalJSON added in v0.24.0

func (ct *CreateTaskReq) UnmarshalJSON(data []byte) error

type CreateTaskResp

type CreateTaskResp struct {
	TaskID string `json:"taskID"`
}

type QueryTaskResp

type QueryTaskResp struct {
	ProjectID string      `json:"projectID"`
	TaskID    string      `json:"taskID"`
	States    []*StateLog `json:"states"`
}

type StateLog

type StateLog struct {
	State    string    `json:"state"`
	Time     time.Time `json:"time"`
	Comment  string    `json:"comment,omitempty"`
	Error    string    `json:"error,omitempty"`
	Tx       string    `json:"transaction_hash,omitempty"`
	ProverID string    `json:"prover_id,omitempty"`
}

Jump to

Keyboard shortcuts

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