db2

package
v1.59.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const BT_COLUMNFAMILY_BLOCK = "b"
View Source
const BT_COLUMNFAMILY_RECEIPTS = "r"
View Source
const BT_COLUMNFAMILY_TRACES = "t"
View Source
const BT_COLUMNFAMILY_UNCLES = "u"
View Source
const BT_COLUMN_BLOCK = "b"
View Source
const BT_COLUMN_RECEIPTS = "r"
View Source
const BT_COLUMN_TRACES = "t"
View Source
const BT_COLUMN_UNCLES = "u"
View Source
const BlocksRawTable = "blocks-raw"
View Source
const MAX_EL_BLOCK_NUMBER = int64(1_000_000_000_000 - 1)

Variables

View Source
var ErrMethodNotSupported = fmt.Errorf("method not supported")
View Source
var ErrNotFoundInCache = fmt.Errorf("cannot find hash in cache")

Functions

This section is empty.

Types

type BigTableEthRaw

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

func NewBigTableEthRaw

func NewBigTableEthRaw(db RawStoreReader, chainID uint64) *BigTableEthRaw

func (*BigTableEthRaw) BlockByNumber

func (r *BigTableEthRaw) BlockByNumber(ctx context.Context, number *big.Int) ([]byte, error)

func (*BigTableEthRaw) BlockReceipts

func (r *BigTableEthRaw) BlockReceipts(ctx context.Context, number *big.Int) ([]byte, error)

func (*BigTableEthRaw) RoundTrip

func (r *BigTableEthRaw) RoundTrip(request *http.Request) (*http.Response, error)

func (*BigTableEthRaw) TraceBlockByNumber

func (r *BigTableEthRaw) TraceBlockByNumber(ctx context.Context, number *big.Int) ([]byte, error)

func (*BigTableEthRaw) UncleByBlockHashAndIndex

func (r *BigTableEthRaw) UncleByBlockHashAndIndex(ctx context.Context, hash string, index int64) ([]byte, error)

func (*BigTableEthRaw) UncleByBlockNumberAndIndex

func (r *BigTableEthRaw) UncleByBlockNumberAndIndex(ctx context.Context, number *big.Int, index int64) ([]byte, error)

type Bytes

type Bytes []byte

Bytes marshals/unmarshals as a JSON string with 0x prefix. The empty slice marshals as "0x".

func (*Bytes) String

func (b *Bytes) String() string

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

type CachedRawStore

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

func WithCache

func WithCache(reader RawStoreReader) *CachedRawStore

func (*CachedRawStore) ReadBlockByHash

func (c *CachedRawStore) ReadBlockByHash(chainID uint64, hash string) (*FullBlockRawData, error)

func (*CachedRawStore) ReadBlockByNumber

func (c *CachedRawStore) ReadBlockByNumber(chainID uint64, number int64) (*FullBlockRawData, error)

func (*CachedRawStore) ReadBlocksByNumber

func (c *CachedRawStore) ReadBlocksByNumber(chainID uint64, start, end int64) ([]*FullBlockRawData, error)

type FullBlockRawData

type FullBlockRawData struct {
	ChainID uint64

	BlockNumber      int64
	BlockHash        Bytes
	BlockUnclesCount int
	BlockTxs         []string

	Block    Bytes
	Receipts Bytes
	Traces   Bytes
	Uncles   Bytes
}

type MinimalBlock

type MinimalBlock struct {
	Result struct {
		Hash string `json:"hash"`
	} `json:"result"`
}

type RawStore

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

func NewRawStore

func NewRawStore(store store.Store) RawStore

func (RawStore) AddBlocks

func (db RawStore) AddBlocks(blocks []FullBlockRawData) error

func (RawStore) ReadBlockByHash

func (db RawStore) ReadBlockByHash(chainID uint64, hash string) (*FullBlockRawData, error)

func (RawStore) ReadBlockByNumber

func (db RawStore) ReadBlockByNumber(chainID uint64, number int64) (*FullBlockRawData, error)

func (RawStore) ReadBlocksByNumber

func (db RawStore) ReadBlocksByNumber(chainID uint64, start, end int64) ([]*FullBlockRawData, error)

type RawStoreReader

type RawStoreReader interface {
	ReadBlockByNumber(chainID uint64, number int64) (*FullBlockRawData, error)
	ReadBlockByHash(chainID uint64, hash string) (*FullBlockRawData, error)
	ReadBlocksByNumber(chainID uint64, start, end int64) ([]*FullBlockRawData, error)
}

type WithFallback

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

func NewWithFallback

func NewWithFallback(roundTripper, fallback http.RoundTripper) *WithFallback

func (WithFallback) RoundTrip

func (r WithFallback) RoundTrip(request *http.Request) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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