auditor

package
v0.0.0-...-fa704fd Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WAIT_SECONDS        = 5 * 60
	AUDITOR_RPC_TIMEOUT = 10
)

Variables

This section is empty.

Functions

func CheckSize

func CheckSize(size int) bool

Check if the size value is 2^n

func ParentHash

func ParentHash(leftBytes []byte, rightBytes []byte) []byte

func RequestReportMerkleRoot

func RequestReportMerkleRoot(baseUrl string, timeout uint64, taskId uint64, xwcAddr string, xwcPubKey string, penguinNode string, signature string,
	pathData [][]string) (uint64, uint64, error)

func RequestReportPathData

func RequestReportPathData(baseUrl string, timeout uint64, taskId uint64, xwcAddr string, xwcPubKey string, penguinNode string, signature string,
	pathData [][]string, penguinData string) error

func RequestServerTimestamp

func RequestServerTimestamp(baseUrl string, timeout uint64) (int64, error)

func RequestTask

func RequestTask(baseUrl string, timeout uint64, timestamp int64, xwcAddr string, xwcPubKey string, penguinNode string, signature string) (uint64, error)

Types

type Auditor

type Auditor struct {

	//
	AuditEndpoint string
	// Local store db
	LocalDB *localstore.DB

	// Node address
	PenguinAddress string
	// Signer
	Signer crypto.Signer
	// Signer pubkey (hex)
	SignerPubKey string
	// Payer xwc address
	XwcAcctAddress string
	// contains filtered or unexported fields
}

func CreateNewAuditor

func CreateNewAuditor(endpoint string, localDB *localstore.DB, signer crypto.Signer, logger logging.Logger) *Auditor

func (*Auditor) Run

func (r *Auditor) Run()

type TreeNode

type TreeNode struct {
	PtrLeftSon  *TreeNode
	PtrRightSon *TreeNode
	Data        TreeNodeValue
}

func BuildBTreeFromRetrievalAddresses

func BuildBTreeFromRetrievalAddresses(retrievalAddresses [][]byte) (*TreeNode, error)

func (*TreeNode) GetNodeHash

func (t *TreeNode) GetNodeHash() []byte

func (*TreeNode) GetNodeHashHex

func (t *TreeNode) GetNodeHashHex() string

func (*TreeNode) GetPathWayHashHex

func (t *TreeNode) GetPathWayHashHex(pathway uint64) (string, [][]string, string)

func (*TreeNode) GetRootRelatedHashHex

func (t *TreeNode) GetRootRelatedHashHex() (string, []string)

type TreeNodeValue

type TreeNodeValue *[]byte

Jump to

Keyboard shortcuts

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