indexer

package
v0.0.0-...-20e0bfc Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Connected bool = false

Functions

This section is empty.

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) (variables []*structures.SCIDVariable, code string, balances map[string]uint64)

Gets SC variable details

type Indexer

type Indexer struct {
	LastIndexedHeight int64
	ChainHeight       int64
	SearchFilter      string
	Backend           *storage.GravitonStore
	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, search_filter string, last_indexedheight int64, endpoint string, runmode string, mbllookup bool, closeondisconnect bool, fastsync bool) *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) GetSCIDKeysByValue

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

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)

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

func (*Indexer) StartDaemonMode

func (indexer *Indexer) StartDaemonMode()

func (*Indexer) StartWalletMode

func (indexer *Indexer) StartWalletMode(runType string)

func (*Indexer) ValidateSCSignature

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

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

Jump to

Keyboard shortcuts

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