auditor

package
v0.0.0-...-c9321c3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//WAIT_SECONDS = 5 * 60
	WAIT_SECONDS        = 10
	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, chainID int64) (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, chainID int64) 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, chainID int64) (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

	// chain identity for eth like chain
	ChainID int64
	// contains filtered or unexported fields
}

func CreateNewAuditor

func CreateNewAuditor(endpoint string, localDB *localstore.DB, signer crypto.Signer, chainID int64, 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