backfill

package
v0.0.0-...-0483ee8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackfillError = errors.New("backfill error")

BackfillError is a custom error type for backfill-related errors.

Functions

func Block_Identifier_To_Block

func Block_Identifier_To_Block(identifier BlockIdentifier, network Network) (int, error)

func Default_rpc

func Default_rpc(network Network) (string, error)

func Etherscan_base_url

func Etherscan_base_url(network Network) (string, error)

func FilterEventsByContractAddress

func FilterEventsByContractAddress(providername string, contractAddress string, FromBlockNumber uint64, ToBlockNumber uint64, filename string)

func FilterEventsByHexKeyString

func FilterEventsByHexKeyString(providername string, hexKeyString []string, FromBlockNumber uint64, ToBlockNumber uint64, filename string)

func GetFileExportersForBackfill

func GetFileExportersForBackfill(backfillType BackfillDataType, kwargs map[string]interface{}) (map[string]*FileResourceExporter, error)

Backfill logic

func Get_current_block_number

func Get_current_block_number(network Network) (int, error)

Types

type AbstractResourceExporter

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

AbstractResourceExporter is the base class for resource exporters.

func (*AbstractResourceExporter) Close

func (e *AbstractResourceExporter) Close()

func (*AbstractResourceExporter) EncodeDataclassAsDict

func (e *AbstractResourceExporter) EncodeDataclassAsDict(dataclass map[string]interface{}) map[string]interface{}

func (*AbstractResourceExporter) Init

func (e *AbstractResourceExporter) Init()

use pointer as allow the actual value modification

type BackfillDataType

type BackfillDataType string

BackfillDataType represents different types of blockchain data that can be backfilled.

const (
	FullBlocks   BackfillDataType = "full_blocks"
	Blocks       BackfillDataType = "blocks"
	Transactions BackfillDataType = "transactions"
	Transfers    BackfillDataType = "transfers"
	Events       BackfillDataType = "events"
	Traces       BackfillDataType = "traces"
)

type BlockIdentifier

type BlockIdentifier string

type ExportMode

type ExportMode string

ExportMode defines the mode of export: db_models or csv.

const (
	DBModels ExportMode = "db_models"
	CSV      ExportMode = "csv"
)

type FileResourceExporter

type FileResourceExporter struct {
	AbstractResourceExporter
	// contains filtered or unexported fields
}

FileResourceExporter is used to export resources to a CSV file.

func NewFileResourceExporter

func NewFileResourceExporter(fileName string, append bool) (*FileResourceExporter, error)

func (*FileResourceExporter) CSVEncodeValue

func (e *FileResourceExporter) CSVEncodeValue(val interface{}) (string, error)

func (*FileResourceExporter) EncodeDataclass

func (e *FileResourceExporter) EncodeDataclass(dataclass map[string]interface{}) ([]string, string, error)

func (*FileResourceExporter) Write

func (e *FileResourceExporter) Write(resources []map[string]interface{}) error

type GraceFullkiller

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

func New_Gracfull_Killer

func New_Gracfull_Killer() *GraceFullkiller

func (*GraceFullkiller) KillNow

func (g *GraceFullkiller) KillNow() bool

type Network

type Network string
const (
	Ethereum Network = "ethereum"
	Starknet Network = "starknet"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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