conn

package
v0.0.0-...-d8b8add Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Id      string `json:"id"`
	Label   string `json:"label"`
	Balance string `json:"balance"`
}

type BlockCacheEvent

type BlockCacheEvent struct {
	Fork         bool
	Size         float64 `json:"block_size"`
	Gas          float64 `json:"block_gas"`
	GasLimit     float64 `json:"block_gas_limit"`
	Usage        float64 `json:"block_usage"`
	Interval     uint64
	Timestamp    uint64
	Miner        string
	Transactions []*TxEvent
	// contains filtered or unexported fields
}

func (*BlockCacheEvent) Hash

func (blockEvent *BlockCacheEvent) Hash() string

func (*BlockCacheEvent) Number

func (blockEvent *BlockCacheEvent) Number() *big.Int

func (*BlockCacheEvent) ParentHash

func (blockEvent *BlockCacheEvent) ParentHash() string

func (*BlockCacheEvent) SetFork

func (blockEvent *BlockCacheEvent) SetFork(fork bool)

type Cache

type Cache struct {
	Stats    map[string]*Stats
	Tracking *Tracking
	// contains filtered or unexported fields
}

func NewCache

func NewCache(client *ethclient.Client, configFile string, backupFile string, restore bool, backupFrequency int64) *Cache

func (*Cache) Apply

func (cache *Cache) Apply(event ingest.BlockEvent)

func (*Cache) Revert

func (cache *Cache) Revert(event ingest.BlockEvent)

func (*Cache) SetReady

func (cache *Cache) SetReady()

type Event

type Event struct {
	Stats

	Label string `json:"label"`
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(key string, rules []*Rule) *Event

type Field

type Field string
const (
	FROM    Field = "from"
	TO      Field = "to"
	VALUE   Field = "value"
	DEPLOY  Field = "deploy"
	UNKNOWN Field = ""
)

type Miner

type Miner struct {
	Stats
	Id           string `json:"id"`
	Label        string `json:"label"`
	CurrentBlock string `json:"currentBlock"`
}

func NewMiner

func NewMiner(key string, id string) *Miner

type Operator

type Operator string
const (
	EQ   Operator = "="
	LT   Operator = "<="
	GT   Operator = ">="
	NONE Operator = ""
)

type Processor

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

func NewProcessor

func NewProcessor(client *ethclient.Client) *Processor

func (*Processor) NewBlockEvent

func (processor *Processor) NewBlockEvent(number *big.Int, parentHash string, hash string) ingest.BlockEvent

func (*Processor) Process

func (processor *Processor) Process(block *types.Block, event ingest.BlockEvent)

type Rule

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

type Stats

type Stats struct {
	Current     *big.Int `json:"-"`
	Count       string   `json:"count"`
	Interval    uint64   `json:"interval"`
	Timestamp   uint64   `json:"timestamp"`
	BlockNumber string   `json:"block"`
}

func NewStats

func NewStats() *Stats

type Tracking

type Tracking struct {
	Events   []*Event   `json:"events"`
	Miners   []*Miner   `json:"miners"`
	Balances []*Balance `json:"balances"`
}

type TxEvent

type TxEvent struct {
	Sender     string
	Receiver   string
	Value      *big.Int
	FunctionId string
	Events     []string
	Deploy     string
}

Jump to

Keyboard shortcuts

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