indexer

package
v0.0.0-...-ce6788a Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 29 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Connected bool = false

Functions

func InitLog

func InitLog(args map[string]interface{}, console io.Writer)

Types

type Client

type Client struct {
	WS  *websocket.Conn
	RPC *jrpc2.Client
	sync.RWMutex
}

func (*Client) Connect

func (client *Client) Connect(endpoint string) (err error)

func (*Client) GetSCVariables

func (client *Client) GetSCVariables(scid string, topoheight int64, keysuint64 []uint64, keysstring []string, keysbytes [][]byte, codeonly bool) (variables []*structures.SCIDVariable, code string, balances map[string]uint64, err error)

Gets SC variable details

func (*Client) GetTxPool

func (client *Client) GetTxPool() (txlist []string, err error)

DERO.GetTxPool rpc call for returning current mempool txns

type Indexer

type Indexer struct {
	LastIndexedHeight int64
	ChainHeight       int64
	SearchFilter      []string
	SFSCIDExclusion   []string
	GravDBBackend     *storage.GravitonStore
	BBSBackend        *storage.BboltStore
	DBType            string
	Closing           bool
	RPC               *Client
	Endpoint          string
	RunMode           string
	MBLLookup         bool
	ValidatedSCs      []string
	CloseOnDisconnect bool
	Fastsync          bool
	sync.RWMutex
}

func NewIndexer

func NewIndexer(Graviton_backend *storage.GravitonStore, Bbs_backend *storage.BboltStore, dbtype string, search_filter []string, last_indexedheight int64, endpoint string, runmode string, mbllookup bool, closeondisconnect bool, fastsync bool, sfscidexclusion []string) *Indexer

func (*Indexer) AddSCIDToIndex

func (indexer *Indexer) AddSCIDToIndex(scidstoadd map[string]*structures.FastSyncImport) (err error)

Manually add/inject a SCID to be indexed. Checks validity and then stores within owner tree (no signer addr) and stores a set of current variables.

func (*Indexer) Close

func (ind *Indexer) Close()

Close cleanly the indexer

func (*Indexer) ConvertSCIDKeys

func (indexer *Indexer) ConvertSCIDKeys(variables []*structures.SCIDVariable) (keysstring []string, keysuint64 []uint64)

Converts returned SCIDVariables KEY values who's values equates to a given interface{} (string/uint64)

func (*Indexer) ConvertSCIDValues

func (indexer *Indexer) ConvertSCIDValues(variables []*structures.SCIDVariable) (valuesstring []string, valuesuint64 []uint64)

Converts returned SCIDVariables VALUE values who's values equates to a given interface{} (string/uint64)

func (*Indexer) DiffSCIDVariables

func (indexer *Indexer) DiffSCIDVariables(varset1 []*structures.SCIDVariable, varset2 []*structures.SCIDVariable, scid string, height int64) (diffset []*structures.SCIDVariable, err error)

Compares k/v pairs of two array sets of *structures.SCIDVariable

func (*Indexer) GetSCIDKeysByValue

func (indexer *Indexer) GetSCIDKeysByValue(variables []*structures.SCIDVariable, scid string, val interface{}, height int64) (keysstring []string, keysuint64 []uint64, err error)

Gets SC variable keys at given topoheight who's value equates to a given interface{} (string/uint64)

func (*Indexer) GetSCIDValuesByKey

func (indexer *Indexer) GetSCIDValuesByKey(variables []*structures.SCIDVariable, scid string, key interface{}, height int64) (valuesstring []string, valuesuint64 []uint64, err error)

Gets SC values by key at given topoheight who's key equates to a given interface{} (string/uint64)

func (*Indexer) IndexTxn

func (indexer *Indexer) IndexTxn(blTxns *structures.BlockTxns, noStore bool) (bl_sctxs []structures.SCTXParse, regTxCount int64, burnTxCount int64, normTxCount int64, err error)

func (*Indexer) InterpretSC

func (indexer *Indexer) InterpretSC(scid string, code string)

func (*Indexer) StartDaemonMode

func (indexer *Indexer) StartDaemonMode(blockParallelNum int)

func (*Indexer) StartWalletMode

func (indexer *Indexer) StartWalletMode(runType string)

Potential future item - may be removed as primary srevice of Gnomon is against daemon and not wallet due to security

func (*Indexer) ValidateSCSignature

func (indexer *Indexer) ValidateSCSignature(code string, key string) (validated bool, signer string, err error)

Validates that a stored signature results in the code deployed to a SC - currently allowing any 'key' to be passed through, however intended key is 'signature' or similar

type SCIDToIndexStage

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

Jump to

Keyboard shortcuts

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