Flags cleanup for CLI changes and linter complaints
This commit is contained in:
parent
2f0cdfe4b0
commit
f235c6d072
@ -973,113 +973,114 @@ var (
|
||||
Category: flags.MetricsCategory,
|
||||
}
|
||||
|
||||
StateDiffFlag = cli.BoolFlag{
|
||||
StateDiffFlag = &cli.BoolFlag{
|
||||
Name: "statediff",
|
||||
Usage: "Enables the processing of state diffs between each block",
|
||||
Category: flags.MiscCategory,
|
||||
}
|
||||
StateDiffDBTypeFlag = cli.StringFlag{
|
||||
StateDiffDBTypeFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.type",
|
||||
Usage: "Statediff database type (current options: postgres, file, dump)",
|
||||
Value: "postgres",
|
||||
}
|
||||
StateDiffDBDriverTypeFlag = cli.StringFlag{
|
||||
StateDiffDBDriverTypeFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.driver",
|
||||
Usage: "Statediff database driver type",
|
||||
Value: "pgx",
|
||||
}
|
||||
StateDiffDBDumpDst = cli.StringFlag{
|
||||
StateDiffDBDumpDst = &cli.StringFlag{
|
||||
Name: "statediff.dump.dst",
|
||||
Usage: "Statediff database dump destination (default is stdout)",
|
||||
Value: "stdout",
|
||||
}
|
||||
StateDiffDBHostFlag = cli.StringFlag{
|
||||
StateDiffDBHostFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.host",
|
||||
Usage: "Statediff database hostname/ip",
|
||||
Value: "localhost",
|
||||
}
|
||||
StateDiffDBPortFlag = cli.IntFlag{
|
||||
StateDiffDBPortFlag = &cli.IntFlag{
|
||||
Name: "statediff.db.port",
|
||||
Usage: "Statediff database port",
|
||||
Value: 5432,
|
||||
}
|
||||
StateDiffDBNameFlag = cli.StringFlag{
|
||||
StateDiffDBNameFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.name",
|
||||
Usage: "Statediff database name",
|
||||
}
|
||||
StateDiffDBPasswordFlag = cli.StringFlag{
|
||||
StateDiffDBPasswordFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.password",
|
||||
Usage: "Statediff database password",
|
||||
}
|
||||
StateDiffDBUserFlag = cli.StringFlag{
|
||||
StateDiffDBUserFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.user",
|
||||
Usage: "Statediff database username",
|
||||
Value: "postgres",
|
||||
}
|
||||
StateDiffDBMaxConnLifetime = cli.DurationFlag{
|
||||
StateDiffDBMaxConnLifetime = &cli.DurationFlag{
|
||||
Name: "statediff.db.maxconnlifetime",
|
||||
Usage: "Statediff database maximum connection lifetime (in seconds)",
|
||||
}
|
||||
StateDiffDBMaxConnIdleTime = cli.DurationFlag{
|
||||
StateDiffDBMaxConnIdleTime = &cli.DurationFlag{
|
||||
Name: "statediff.db.maxconnidletime",
|
||||
Usage: "Statediff database maximum connection idle time (in seconds)",
|
||||
}
|
||||
StateDiffDBMaxConns = cli.IntFlag{
|
||||
StateDiffDBMaxConns = &cli.IntFlag{
|
||||
Name: "statediff.db.maxconns",
|
||||
Usage: "Statediff database maximum connections",
|
||||
}
|
||||
StateDiffDBMinConns = cli.IntFlag{
|
||||
StateDiffDBMinConns = &cli.IntFlag{
|
||||
Name: "statediff.db.minconns",
|
||||
Usage: "Statediff database minimum connections",
|
||||
}
|
||||
StateDiffDBMaxIdleConns = cli.IntFlag{
|
||||
StateDiffDBMaxIdleConns = &cli.IntFlag{
|
||||
Name: "statediff.db.maxidleconns",
|
||||
Usage: "Statediff database maximum idle connections",
|
||||
}
|
||||
StateDiffDBConnTimeout = cli.DurationFlag{
|
||||
StateDiffDBConnTimeout = &cli.DurationFlag{
|
||||
Name: "statediff.db.conntimeout",
|
||||
Usage: "Statediff database connection timeout (in seconds)",
|
||||
}
|
||||
StateDiffDBNodeIDFlag = cli.StringFlag{
|
||||
StateDiffDBNodeIDFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.nodeid",
|
||||
Usage: "Node ID to use when writing state diffs to database",
|
||||
}
|
||||
StateDiffFileMode = cli.StringFlag{
|
||||
StateDiffFileMode = &cli.StringFlag{
|
||||
Name: "statediff.file.mode",
|
||||
Usage: "Statediff file writing mode (current options: csv, sql)",
|
||||
Value: "csv",
|
||||
}
|
||||
StateDiffFileCsvDir = cli.StringFlag{
|
||||
StateDiffFileCsvDir = &cli.StringFlag{
|
||||
Name: "statediff.file.csvdir",
|
||||
Usage: "Full path of output directory to write statediff data out to when operating in csv file mode",
|
||||
}
|
||||
StateDiffFilePath = cli.StringFlag{
|
||||
StateDiffFilePath = &cli.StringFlag{
|
||||
Name: "statediff.file.path",
|
||||
Usage: "Full path (including filename) to write statediff data out to when operating in sql file mode",
|
||||
}
|
||||
StateDiffKnownGapsFilePath = cli.StringFlag{
|
||||
StateDiffKnownGapsFilePath = &cli.StringFlag{
|
||||
Name: "statediff.knowngapsfile.path",
|
||||
Usage: "Full path (including filename) to write knownGaps statements when the DB is unavailable.",
|
||||
Value: "./known_gaps.sql",
|
||||
}
|
||||
StateDiffWatchedAddressesFilePath = cli.StringFlag{
|
||||
StateDiffWatchedAddressesFilePath = &cli.StringFlag{
|
||||
Name: "statediff.file.wapath",
|
||||
Usage: "Full path (including filename) to write statediff watched addresses out to when operating in file mode",
|
||||
}
|
||||
StateDiffDBClientNameFlag = cli.StringFlag{
|
||||
StateDiffDBClientNameFlag = &cli.StringFlag{
|
||||
Name: "statediff.db.clientname",
|
||||
Usage: "Client name to use when writing state diffs to database",
|
||||
Value: "go-ethereum",
|
||||
}
|
||||
StateDiffWritingFlag = cli.BoolFlag{
|
||||
StateDiffWritingFlag = &cli.BoolFlag{
|
||||
Name: "statediff.writing",
|
||||
Usage: "Activates progressive writing of state diffs to database as new block are synced",
|
||||
}
|
||||
StateDiffWorkersFlag = cli.UintFlag{
|
||||
StateDiffWorkersFlag = &cli.UintFlag{
|
||||
Name: "statediff.workers",
|
||||
Usage: "Number of concurrent workers to use during statediff processing (default 1)",
|
||||
Value: 1,
|
||||
}
|
||||
StateDiffWaitForSync = cli.BoolFlag{
|
||||
StateDiffWaitForSync = &cli.BoolFlag{
|
||||
Name: "statediff.waitforsync",
|
||||
Usage: "Should the statediff service wait for geth to catch up to the head of the chain?",
|
||||
}
|
||||
|
@ -128,7 +128,6 @@ func TestAccountSnapshotResolve(t *testing.T) {
|
||||
t.Fatalf("error should be nil %v", gc)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestAccountSnapshotTree(t *testing.T) {
|
||||
|
@ -290,7 +290,6 @@ func TestEthBlockResolveNonLinkFieldsExtraPathElements(t *testing.T) {
|
||||
if err.Error() != "unexpected path elements past "+field {
|
||||
t.Fatalf("Wrong error\r\nexpected %s\r\ngot %s", "unexpected path elements past "+field, err.Error())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,9 +65,7 @@ type KnownGapsState struct {
|
||||
}
|
||||
|
||||
// Create a new KnownGapsState struct, currently unused.
|
||||
func NewKnownGapsState(checkForGaps bool, processingKey int64, expectedDifference *big.Int,
|
||||
errorState bool, writeFilePath string, db sql.Database, statediffMetrics statediffMetricsHandles) *KnownGapsState {
|
||||
|
||||
func NewKnownGapsState(checkForGaps bool, processingKey int64, expectedDifference *big.Int, errorState bool, writeFilePath string, db sql.Database, statediffMetrics statediffMetricsHandles) *KnownGapsState {
|
||||
return &KnownGapsState{
|
||||
checkForGaps: checkForGaps,
|
||||
processingKey: processingKey,
|
||||
@ -77,7 +75,6 @@ func NewKnownGapsState(checkForGaps bool, processingKey int64, expectedDifferenc
|
||||
db: db,
|
||||
statediffMetrics: statediffMetrics,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func minMax(array []*big.Int) (*big.Int, *big.Int) {
|
||||
|
@ -28,7 +28,6 @@ type gapValues struct {
|
||||
// Test for failures when they are expected, when we go from smaller block to larger block
|
||||
// We should no longer see the smaller block in DB
|
||||
func TestKnownGaps(t *testing.T) {
|
||||
|
||||
tests := []gapValues{
|
||||
// Known Gaps
|
||||
{knownErrorBlocksStart: 115, knownErrorBlocksEnd: 120, expectedDif: 1, processingKey: 1},
|
||||
|
@ -120,5 +120,4 @@ func FindIntersection(a, b []string) []string {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user