Documentation ¶
Index ¶
- Constants
- Variables
- func AddToIndex(scids []string) (err error)
- func CheckOwner(scid string) bool
- func DeleteStorage(bucket, key string)
- func EndPoint()
- func GetAssetUrl(w int, scid string) (url string)
- func GetStorage(bucket, key string, out interface{})
- func InitLogrusLog(level logrus.Level)
- func IsConnected() bool
- func NewBoltDB(dbType, dbPath string) *storage.BboltStore
- func NewGravDB(dbType, dbPath string) *storage.GravitonStore
- func Scan(config bool) bool
- func StartGnomon(tag, dbtype string, filters []string, upper, lower int, custom func())
- func State(config bool, scan func(map[string]string))
- func StorageExists(bucket, key string) (found bool, err error)
- func StoreBolt(bucket, key string, store interface{}) (err error)
- func ToolTip(offset float32, can fyne.Canvas) *toolTip
- type Gnomes
- type Gnomon
- func (g *Gnomon) AddSCIDToIndex(scids map[string]*structures.FastSyncImport) error
- func (g *Gnomon) Checked(b bool)
- func (g *Gnomon) ControlPanel(w fyne.Window) *fyne.Container
- func (g *Gnomon) DBStorageType() string
- func (g *Gnomon) GetAllOwnersAndSCIDs() map[string]string
- func (g *Gnomon) GetAllSCIDVariableDetails(scid string) []*structures.SCIDVariable
- func (g *Gnomon) GetChainHeight() (height int64)
- func (g *Gnomon) GetFastsync() structures.FastSyncConfig
- func (g *Gnomon) GetLastHeight() (height int64)
- func (g *Gnomon) GetLiveSCIDValuesByKey(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64, err error)
- func (g *Gnomon) GetParallel() int
- func (g *Gnomon) GetSCIDKeysByValue(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64)
- func (g *Gnomon) GetSCIDValuesByKey(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64)
- func (g *Gnomon) GetSearchFilters() []string
- func (g *Gnomon) HasChecked() bool
- func (g *Gnomon) HasIndex(u uint64) bool
- func (g *Gnomon) IndexContains() map[string]string
- func (g *Gnomon) IndexCount() uint64
- func (g *Gnomon) Initialized(b bool)
- func (g *Gnomon) IsClosing() bool
- func (g *Gnomon) IsInitialized() bool
- func (g *Gnomon) IsReady() bool
- func (g *Gnomon) IsRunning() bool
- func (g *Gnomon) IsScanning() bool
- func (g *Gnomon) IsStarting() bool
- func (g *Gnomon) IsStatus(status string) bool
- func (g *Gnomon) IsSynced() bool
- func (g *Gnomon) IsWriting() bool
- func (g *Gnomon) Scanning(b bool)
- func (g *Gnomon) SetDBStorageType(s string)
- func (g *Gnomon) SetFastsync(enabled, force bool, diff int64)
- func (g *Gnomon) SetParallel(i int)
- func (g *Gnomon) SetSearchFilters(filters []string)
- func (g *Gnomon) Status() (status string)
- func (g *Gnomon) Stop(tag string)
- func (g *Gnomon) Synced(b bool)
- func (g *Gnomon) Writing(b bool)
- func (g *Gnomon) ZeroIndexCount()
- type SC
- type SCHeaders
Constants ¶
const ( NFA_SEARCH_FILTER = `` /* 977-byte string literal not displayed */ G45_search_filter = `STORE("type", "G45-NFT")` )
Variables ¶
var Indicator indicator
Gnomon GUI indicator
Functions ¶
func GetAssetUrl ¶
Get a requested NFA url
- w of 0 returns "fileURL"
- w of 1 returns "iconURLHdr"
- w of 2 returns "coverURLHdr"
func InitLogrusLog ¶
Initialize logrus logger matching Gnomon log
func NewBoltDB ¶
func NewBoltDB(dbType, dbPath string) *storage.BboltStore
Create a new bbolt DB with dReams tag for Gnomon storage
- If dbType is not boltdb, will return nil boltdb
func NewGravDB ¶
func NewGravDB(dbType, dbPath string) *storage.GravitonStore
Create a new graviton DB for Gnomon storage
- If dbType is boltdb, will return nil gravdb
func StartGnomon ¶
Start Gnomon indexer with or without search filters
- End point from rpc.Daemon.Rpc
- tag for log print
- dbtype defines gravdb or boltdb
- custom func() is for adding specific SCID to index on Gnomon start, gnomes.Fast.Enabled false will bypass
- lower defines the lower limit of indexed SCIDs from Gnomon search filters before custom adds
- upper defines the higher limit when custom indexed SCIDs exist already
func State ¶
State checks and maintains Gnomon state (synced/scanning/checked), it will scan connected wallet once synced, then ensure sync
- Hold out checking if app is configuring
- Pass scan func for initial Gnomon sync
func StorageExists ¶
Check if data exists in boltdb
Types ¶
type Gnomes ¶
type Gnomes interface { Status() string IsStatus(status string) bool IsStarting() bool DBStorageType() string SetDBStorageType(s string) GetLastHeight() int64 GetChainHeight() int64 Stop(tag string) IsWriting() bool Writing(b bool) IsClosing() bool Initialized(b bool) IsInitialized() bool Scanning(b bool) IsScanning() bool Checked(b bool) HasChecked() bool IndexContains() map[string]string IndexCount() uint64 ZeroIndexCount() HasIndex(u uint64) bool Synced(b bool) IsSynced() bool IsRunning() bool IsReady() bool SetFastsync(enabled, force bool, diff int64) GetFastsync() structures.FastSyncConfig SetParallel(i int) GetParallel() int SetSearchFilters(filters []string) GetSearchFilters() []string GetAllOwnersAndSCIDs() map[string]string GetSCIDValuesByKey(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64) GetSCIDKeysByValue(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64) GetAllSCIDVariableDetails(scid string) []*structures.SCIDVariable AddSCIDToIndex(scids map[string]*structures.FastSyncImport) error GetLiveSCIDValuesByKey(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64, err error) ControlPanel(w fyne.Window) *fyne.Container }
Gnomes exposes methods of Gnomon
type Gnomon ¶
type Gnomon struct { DBType string Para int Fast structures.FastSyncConfig Start bool Init bool Sync bool Syncing bool Check bool SCIDS uint64 Indexer *indexer.Indexer sync.RWMutex }
Gnomon contains params and Indexer for running Gnomon package
func (*Gnomon) AddSCIDToIndex ¶
func (g *Gnomon) AddSCIDToIndex(scids map[string]*structures.FastSyncImport) error
Method of Gnomon Indexer.AddSCIDToIndex()
func (*Gnomon) ControlPanel ¶
func (g *Gnomon) ControlPanel(w fyne.Window) *fyne.Container
UI control panel to set Gnomon vars
func (*Gnomon) GetAllOwnersAndSCIDs ¶
Method of Gnomon GetAllOwnersAndSCIDs() where DB type is defined by Indexer.DBType
- Default is boltdb
func (*Gnomon) GetAllSCIDVariableDetails ¶
func (g *Gnomon) GetAllSCIDVariableDetails(scid string) []*structures.SCIDVariable
Method of Gnomon GetAllSCIDVariableDetails() where DB type is defined by Indexer.DBType
- Default is boltdb
func (*Gnomon) GetChainHeight ¶
Get Indexer.ChainHeight
func (*Gnomon) GetFastsync ¶
func (g *Gnomon) GetFastsync() structures.FastSyncConfig
Get Gnomon structures.FastSyncConfig
func (*Gnomon) GetLastHeight ¶
Get Indexer.LastIndexedHeight
func (*Gnomon) GetLiveSCIDValuesByKey ¶
func (g *Gnomon) GetLiveSCIDValuesByKey(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64, err error)
Method of Gnomon Indexer.GetSCIDValuesByKey()
func (*Gnomon) GetSCIDKeysByValue ¶
func (g *Gnomon) GetSCIDKeysByValue(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64)
Method of Gnomon GetSCIDKeysByValue() where DB type is defined by Indexer.DBType
- Default is boltdb
func (*Gnomon) GetSCIDValuesByKey ¶
func (g *Gnomon) GetSCIDValuesByKey(scid string, key interface{}) (valuesstring []string, valuesuint64 []uint64)
Method of Gnomon GetSCIDValuesByKey() where DB type is defined by Indexer.DBType
- Default is boltdb
func (*Gnomon) GetSearchFilters ¶
Get Indexer search filters
func (*Gnomon) IndexContains ¶
Set Gnomes.SCIDS index count and return GetAllOwnersAndSCIDs()
func (*Gnomon) SetFastsync ¶
Set Gnomon structures.FastSyncConfig, skip recheck and no code default false
func (*Gnomon) SetSearchFilters ¶
Set Indexer search filters