database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema = `` /* 1459-byte string literal not displayed */

Functions

This section is empty.

Types

type BlockEntry

type BlockEntry struct {
	Id         int
	Created_At sql.NullTime

	Reorg_Key string
	Origin    string
	NodeUri   string

	BlockNumber     uint64
	BlockHash       string
	ParentHash      string
	BlockTimestamp  uint64
	CoinbaseAddress string

	Difficulty uint64
	NumUncles  int
	NumTx      int

	IsPartOfReorg bool
	IsMainChain   bool
	IsFirst       bool

	MevGeth_CoinbaseDiffWei      string
	MevGeth_GasFeesWei           string
	MevGeth_EthSentToCoinbaseWei string

	MevGeth_CoinbaseDiffEth   string
	MevGeth_EthSentToCoinbase string
}

func NewBlockEntry

func NewBlockEntry(block *analysis.Block, reorg *analysis.Reorg) BlockEntry

func (*BlockEntry) UpdateWitCallBundleResponse

func (e *BlockEntry) UpdateWitCallBundleResponse(callBundleResponse flashbotsrpc.FlashbotsCallBundleResponse)

type DatabaseService

type DatabaseService struct {
	DB *sqlx.DB
}

func NewDatabaseService

func NewDatabaseService(dsn string) (*DatabaseService, error)

func (*DatabaseService) AddBlockEntry

func (s *DatabaseService) AddBlockEntry(entry BlockEntry) error

func (*DatabaseService) AddReorgEntry

func (s *DatabaseService) AddReorgEntry(entry ReorgEntry) error

func (*DatabaseService) AddReorgWithBlocks

func (s *DatabaseService) AddReorgWithBlocks(reorg *analysis.Reorg) error

func (*DatabaseService) BlockEntry

func (s *DatabaseService) BlockEntry(hash common.Hash) (entry BlockEntry, err error)

func (*DatabaseService) Close

func (s *DatabaseService) Close()

func (*DatabaseService) DeleteBlockEntry

func (s *DatabaseService) DeleteBlockEntry(entry BlockEntry) error

func (*DatabaseService) DeleteReorgEntry

func (s *DatabaseService) DeleteReorgEntry(entry ReorgEntry) error

func (*DatabaseService) DeleteReorgWithBlocks

func (s *DatabaseService) DeleteReorgWithBlocks(entry ReorgEntry) error

func (*DatabaseService) ReorgEntry

func (s *DatabaseService) ReorgEntry(key string) (entry ReorgEntry, err error)

func (*DatabaseService) Reset

func (s *DatabaseService) Reset()

type ReorgEntry

type ReorgEntry struct {
	Id         int
	Created_At sql.NullTime

	Key      string
	SeenLive bool

	StartBlockNumber  uint64
	EndBlockNumber    uint64
	Depth             int
	NumChains         int
	NumBlocksInvolved int
	NumBlocksReplaced int
	MermaidSyntax     string
}

func NewReorgEntry

func NewReorgEntry(reorg *analysis.Reorg) ReorgEntry

Jump to

Keyboard shortcuts

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