cmd

package
v0.0.0-...-135af17 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Block steps used to prevent long executor tasks and data loss possibility
	BlockNumberStep = uint64(1000)

	BlockchainFlag = cli.StringFlag{
		Name:  "blockchain",
		Usage: `Which blockchain to crawl ("ethereum", "polygon")`,
	}
	DataDirFlag = cli.StringFlag{
		Name:  "datadir",
		Usage: "Data directory for the databases and keystore",
		Value: "/home/ubuntu/nodes/ethereum",
	}
	GCModeFlag = cli.StringFlag{
		Name:  "gcmode",
		Usage: `Blockchain garbage collection mode ("full", "archive")`,
		Value: "full",
	}
	ThreadsFlag = cli.IntFlag{
		Name:  "threads",
		Usage: "Number of threads to use",
		Value: 2,
	}
)

Functions

func BlockYield

func BlockYield(start, end, blockStep uint64) chan []uint64

Block step generator, yield list of blocks with length equal blockStep TODO(kompotkot): Not-safe method with slices in channel, re-write this function

func LDBCLI

func LDBCLI()

Types

type CorruptBlock

type CorruptBlock struct {
	Number      uint64 `json:"number"`
	Source      string `json:"source"`
	Description string `json:"description"`
}

Malformed block structure which will be submitted to humbug journal

type CorruptBlocks

type CorruptBlocks struct {
	Blocks []CorruptBlock `json:"blocks"`
}

type HumbugReporter

type HumbugReporter struct {
	Reporter *humbug.HumbugReporter
}

type Job

type Job struct {
	BlockNumber uint64
	Results     chan<- Result
}

Concurrency jobs structure

type LightBlock

type LightBlock struct {
	Hash         string
	Number       *big.Int
	Transactions []LightTransaction
}

Lightweight block for database operations

type LightTransaction

type LightTransaction struct {
	Hash string
}

Lightweight transactions for database operations

type LocalConnections

type LocalConnections struct {
	Stack    *node.Node
	Chain    *core.BlockChain
	ChainDB  ethdb.Database
	Database *sql.DB
}

Predefined connections to blockchain and database

type Result

type Result struct {
	ErrorOutput string
	ErrorSource string
	Number      uint64
	Output      string
}

TODO(kompotkot): Find way to remove Number, it repeats Job

Jump to

Keyboard shortcuts

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