2020-09-07 06:03:12 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/headers/download"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
filesDir string // Directory when the files should be stored
|
|
|
|
bufferSize int // Size of buffer in MiB
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
downloadCmd.Flags().StringVar(&filesDir, "filesdir", "", "path to directory where files will be stored")
|
|
|
|
downloadCmd.Flags().IntVar(&bufferSize, "buffersize", 512, "size o the buffer in MiB")
|
|
|
|
rootCmd.AddCommand(downloadCmd)
|
|
|
|
}
|
|
|
|
|
|
|
|
var downloadCmd = &cobra.Command{
|
|
|
|
Use: "download",
|
|
|
|
Short: "Download headers backwards",
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2020-09-11 06:35:51 +00:00
|
|
|
return download.Download(filesDir)
|
2020-09-07 06:03:12 +00:00
|
|
|
},
|
|
|
|
}
|