appdata

package
v0.0.0-...-6b2b62e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package appdata provides storage for chestnut.

Package appdata provides storage for chestnut.

Index

Constants

View Source
const (
	GRP_PREFIX           = "grp_"
	CNT_PREFIX    string = "cnt_"
	SDR_PREFIX    string = "sdr_"
	SEQ_PREFIX    string = "seq_"
	TRX_PREFIX    string = "trx_"
	SED_PREFIX    string = "sed_"
	STATUS_PREFIX string = "stu_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppDb

type AppDb struct {
	Db storage.ChestnutStorage

	DataPath string
	// contains filtered or unexported fields
}

func NewAppDb

func NewAppDb() *AppDb

func (*AppDb) AddMetaByTrx

func (appdb *AppDb) AddMetaByTrx(blockId string, groupid string, trxs []*chestnutpb.Trx) error

func (*AppDb) Close

func (appdb *AppDb) Close()

func (*AppDb) GetGroupContentBySenders

func (appdb *AppDb) GetGroupContentBySenders(groupid string, senders []string, starttrx string, num int, reverse bool) ([]string, error)

func (*AppDb) GetGroupStatus

func (appdb *AppDb) GetGroupStatus(groupid, name string) (string, error)

func (*AppDb) GetSeqId

func (appdb *AppDb) GetSeqId(seqkey string) (uint64, error)

func (*AppDb) Rebuild

func (appdb *AppDb) Rebuild(vertag string, chainDb *badger.DB) error

func (*AppDb) Release

func (appdb *AppDb) Release() error

func (*AppDb) SetGroupSeed

func (appdb *AppDb) SetGroupSeed(seed *chestnutpb.GroupSeed) error

type AppSync

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

func NewAppSyncAgent

func NewAppSyncAgent(apiroot string, nodename string, appdb *AppDb, dbmgr *storage.DbMgr) *AppSync

func (*AppSync) GetGroups

func (appsync *AppSync) GetGroups() []*chestnutpb.GroupItem

func (*AppSync) ParseBlockTrx

func (appsync *AppSync) ParseBlockTrx(groupid string, block *chestnutpb.Block) ([]*chestnutpb.Block, error)

func (*AppSync) RunSync

func (appsync *AppSync) RunSync(groupid string, lastBlockedId string, newBlockId string)

func (*AppSync) Start

func (appsync *AppSync) Start(interval int)

Jump to

Keyboard shortcuts

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