db

package
v0.0.0-...-f87342c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HASH_PREFIX_SIZE = 7 // 3 collisions as of height 771643
	RECENT_RING_SIZE = 1024 * 64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRec

type BlockRec struct {
	*blkchain.Block

	Id     int
	Height int
	Hash   blkchain.Uint256
	Orphan bool
	// contains filtered or unexported fields
}

type Config

type Config struct {
	ConnectString string
}

type Explorer

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

func NewExplorer

func NewExplorer(cfg Config) (*Explorer, error)

func (*Explorer) SelectAddrTotalReceived

func (e *Explorer) SelectAddrTotalReceived(addr []byte, limit int) (int64, error)

func (*Explorer) SelectBlockByHashJson

func (e *Explorer) SelectBlockByHashJson(hash blkchain.Uint256) (*string, error)

func (*Explorer) SelectBlocksJson

func (e *Explorer) SelectBlocksJson(height, limit int) ([]string, error)

func (*Explorer) SelectHashType

func (e *Explorer) SelectHashType(hash blkchain.Uint256) (*string, error)

func (*Explorer) SelectMaxHeight

func (e *Explorer) SelectMaxHeight() (int, error)

func (*Explorer) SelectTxByHashJson

func (e *Explorer) SelectTxByHashJson(hash blkchain.Uint256) (*string, error)

func (*Explorer) SelectTxsByAddrJson

func (e *Explorer) SelectTxsByAddrJson(addr []byte, startTxId int, limit int) ([]string, error)

func (*Explorer) SelectTxsJson

func (e *Explorer) SelectTxsJson(blockHash blkchain.Uint256, startN, limit int) ([]string, error)

type PGWriter

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

func NewPGWriter

func NewPGWriter(connstr string, cacheSize int, utxo isUTXOer, zfsDataset string, parallel int) (*PGWriter, error)

func (*PGWriter) Close

func (p *PGWriter) Close()

func (*PGWriter) HeightAndHashes

func (w *PGWriter) HeightAndHashes(back int) (map[int][]blkchain.Uint256, error)

func (*PGWriter) SetOrphans

func (w *PGWriter) SetOrphans(limit int) error

func (*PGWriter) Uptime

func (p *PGWriter) Uptime() time.Duration

func (*PGWriter) WriteBlock

func (p *PGWriter) WriteBlock(b *BlockRec, sync bool) error

Jump to

Keyboard shortcuts

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