erigon-pulse/cmd/integration/commands/root.go
ledgerwatch 94360212cb
Download/seed headers and block bodies via BitTorrent (#1195)
* save state

* torrent experiments

* torrent experiment passed

* fixes after merge

* snapshot headers processing passed

* save state

* save state

* download headers works after snapshot processing

* save state

* save state

* save state

* save state

* add lazy load tx to snapshots, increase number of trackers

* save state

* speedup getting info

* change logging

* move to turbo package

* save state

* save state

* save state

* cleanup

* save state

* add test test

* save state

* lmdb debugging

* fix readonly mode

* save state

* fix build

* sync works

* save state

* save state

* save state

* allow cmd stages stageSenders use snapshots

* debugging failed hashing

* remove experimental tests

* remove torrent experimental tests

* fix lint

* extract snapshot wrapper

* metainfo checker

* add remote seeder

* add logs

* update gomod

* remove useless code

* fix lint&remove useless code

* extract verify snapshot to separated command

* skip debug test

* fix test

* change type of seedSnapshot flag

* add eth logger to torrent lib

* skip debug test

* add Close method

* review fixes

* fix lint

Co-authored-by: b00ris <b00ris@mail.ru>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2020-10-07 13:15:49 +01:00

41 lines
980 B
Go

package commands
import (
"github.com/ledgerwatch/turbo-geth/cmd/utils"
"github.com/ledgerwatch/turbo-geth/ethdb"
"github.com/ledgerwatch/turbo-geth/internal/debug"
"github.com/ledgerwatch/turbo-geth/migrations"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "integration",
Short: "long and heavy integration tests for turbo-geth",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if err := utils.SetupCobra(cmd); err != nil {
panic(err)
}
if len(chaindata) > 0 {
db := ethdb.MustOpen(chaindata)
defer db.Close()
if err := migrations.NewMigrator().Apply(db, datadir); err != nil {
panic(err)
}
err := SetSnapshotKV(db, snapshotDir, snapshotMode)
if err != nil {
panic(err)
}
}
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
defer utils.StopDebug()
},
}
func RootCommand() *cobra.Command {
utils.CobraFlags(rootCmd, append(debug.Flags, utils.MetricFlags...))
return rootCmd
}