rdb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RdbPendingTxIds     = "chainkit:pending"              // List: Pending TxId FIFO queue
	RdbUploadingTxIds   = "chainkit:uploading"            // Set: Uploading TxId pool
	RdbCurrentBundledIn = "chainkit:current_bundledin_id" // String: current bundledIn id with 1 hour expiration
	RdbUploadedTxIds    = "chainkit:uploaded_txids"       // Set: Uploaded TxId pool
)
View Source
const (
	// MaxUploadingCount is the maximum number of transactions allowed in uploading state
	MaxUploadingCount = 100000 // 10w
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chainkit added in v0.3.0

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

func NewChainkitDB added in v0.3.0

func NewChainkitDB(redisUrl string) *Chainkit

func (*Chainkit) AddPending added in v0.3.0

func (r *Chainkit) AddPending(txid string) error

addPending adds a txid to pending txids queue (FIFO)

func (*Chainkit) EndUpload added in v0.3.0

func (r *Chainkit) EndUpload() error

func (*Chainkit) GetBundledIn added in v0.3.0

func (r *Chainkit) GetBundledIn() (string, error)

GetBundledIn returns the current bundledIn ID if it exists, or empty string if it doesn't exist

func (*Chainkit) GetUploading added in v0.3.0

func (r *Chainkit) GetUploading() ([]string, error)

func (*Chainkit) IsUploadedBatch added in v0.3.0

func (r *Chainkit) IsUploadedBatch(txids []string) (map[string]bool, error)

isUploadedBatch checks if multiple transaction IDs have already been uploaded Returns a map where key is txid and value is whether it's uploaded

func (*Chainkit) MoveToUploading added in v0.3.0

func (r *Chainkit) MoveToUploading() (int64, error)

func (*Chainkit) SetBundledIn added in v0.3.0

func (r *Chainkit) SetBundledIn(bundledInID string) error

type RDB

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

func New

func New(redisUrl string) *RDB

func (*RDB) Close

func (r *RDB) Close()

func (*RDB) Commit

func (r *RDB) Commit(pid string, nonce int64, msg, assign goarSchema.BundleItem) (err error)

func (*RDB) GetAllProcess

func (r *RDB) GetAllProcess() (processIds []string, curNonces []int64, err error)

func (*RDB) GetAssignByNonce

func (r *RDB) GetAssignByNonce(pid string, nonce int64) (assign *goarSchema.BundleItem, err error)

func (*RDB) GetCache

func (r *RDB) GetCache(pid, key string) (value string, err error)

func (*RDB) GetCheckpointIndex

func (r *RDB) GetCheckpointIndex(pid string) (id string, err error)

func (*RDB) GetMessage

func (r *RDB) GetMessage(msgid string) (msg *goarSchema.BundleItem, err error)

func (*RDB) GetMessageByNonce

func (r *RDB) GetMessageByNonce(pid string, nonce int64) (msg *goarSchema.BundleItem, err error)

func (*RDB) GetNonce

func (r *RDB) GetNonce(pid string) (nonce int64, err error)

func (*RDB) GetResult

func (r *RDB) GetResult(msgid string) (result *vmmSchema.Result, err error)

func (*RDB) GetResults

func (r *RDB) GetResults(pid string, limit int64) (results []vmmSchema.Result, err error)

func (*RDB) IsExist

func (r *RDB) IsExist(pid string) (ok bool, err error)

func (*RDB) RevertSpawn

func (r *RDB) RevertSpawn(pid string) error

func (*RDB) SaveCache

func (r *RDB) SaveCache(pid, key, value string) error

func (*RDB) SaveCheckpointIndex

func (r *RDB) SaveCheckpointIndex(pid, id string) error

func (*RDB) SaveResult

func (r *RDB) SaveResult(result vmmSchema.Result) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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