erigon-pulse/cmd/state/commands/global_flags_vars.go
ledgerwatch cd706d5081
Download/seed block bodies and block headers via BitTorrent (#1218)
* 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

* tidy mods

* Fix compile

* Fix lint

* Fix rpcdaemon running in the docker

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

53 lines
1.8 KiB
Go

package commands
import (
"github.com/ledgerwatch/turbo-geth/common/dbutils"
"github.com/spf13/cobra"
)
var (
chaindata string
statsfile string
snapshotFile string
block uint64
privateApiAddr string
changeSetBucket string
indexBucket string
)
func must(err error) {
if err != nil {
panic(err)
}
}
func withBlock(cmd *cobra.Command) {
cmd.Flags().Uint64Var(&block, "block", 1, "specifies a block number for operation")
}
func withChaindata(cmd *cobra.Command) {
cmd.Flags().StringVar(&chaindata, "chaindata", "chaindata", "path to the chaindata file used as input to analysis")
must(cmd.MarkFlagFilename("chaindata", ""))
}
func withStatsfile(cmd *cobra.Command) {
cmd.Flags().StringVar(&statsfile, "statsfile", "stateless.csv", "path where to write the stats file")
must(cmd.MarkFlagFilename("statsfile", "csv"))
}
func withPrivateApi(cmd *cobra.Command) {
cmd.Flags().StringVar(&privateApiAddr, "private.api.addr", "", "private api network address, for example: 127.0.0.1:9090, empty string means not to start the listener. do not expose to public network. serves remote database interface")
}
func withCSBucket(cmd *cobra.Command) {
cmd.Flags().StringVar(&changeSetBucket, "changeset-bucket", string(dbutils.AccountChangeSetBucket), string(dbutils.AccountChangeSetBucket)+" for account and "+string(dbutils.StorageChangeSetBucket)+" for storage")
}
func withIndexBucket(cmd *cobra.Command) {
cmd.Flags().StringVar(&indexBucket, "index-bucket", string(dbutils.AccountsHistoryBucket), string(dbutils.AccountsHistoryBucket)+" for account and "+string(dbutils.StorageHistoryBucket)+" for storage")
}
func withSnapshotFile(cmd *cobra.Command) {
cmd.Flags().StringVar(&snapshotFile, "snapshot", "", "path where to write the snapshot file")
}