dbagent

package
v0.0.0-...-910d698 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBAgent

type DBAgent interface {
	Close()
	GetLatestBlockHash() (string, int)
	RemoveObject(hash string) bool
	AddBlockHeader(hash string, h *blockchain.BlockHeader) int64
	GetBlockHeader(hash string, h *blockchain.BlockHeader) int64
	AddTransaction(t *blockchain.Transaction) int64
	GetTransaction(hash string, t *blockchain.Transaction) int64
	AddBlock(b *blockchain.Block) int64
	GetBlock(hash string, b *blockchain.Block) int64
	ShowAllObjets() bool
	GetDBDataSize() uint64
	GetDBStatus() *DBStatus
	GetTransactionwithUniform(num int, hashes *[]RemoverbleObj) bool
	GetTransactionwithExponential(num int, hashes *[]RemoverbleObj) bool
	DeleteNoAccedObjects()
	UpdateDBNetworkQuery(fromqc int, toqc int, totalqc int)
	UpdateDBNetworkDelay(addtime int, hop int)
	ProofStorage(tidx [32]byte, timestamp int64, tsc int) []byte
	ProofStorage2()
}

func NewDBAgent

func NewDBAgent(path string) DBAgent

type DBStatus

type DBStatus struct {
	Timestamp         time.Time
	ID                int
	TotalBlocks       int
	TotalTransactoins int
	Headers           int
	Blocks            int
	Transactions      int
	Size              int
	TotalQuery        int // the number of query including local storage
	QueryFrom         int // the number of received query
	QueryTo           int // the number of send query
	TotalDelay        int
	Hop0              int
	Hop1              int
	Hop2              int
	Hop3              int
}

type RemoverbleObj

type RemoverbleObj struct {
	HashType int // blockheader == 0 otherwise transaction
	Hash     string
}

type StorageBLTR

type StorageBLTR struct {
	Blockhash string

	Transactionhash string
	ACTime          int64
	AFLever         int
	// contains filtered or unexported fields
}

type StorageObj

type StorageObj struct {
	Type      string
	Hash      string
	Timestamp int64
	Data      interface{}
}

Jump to

Keyboard shortcuts

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