erigon-pulse/cmd/headers/commands/download.go
ledgerwatch 256e4262e1
2nd batch of Headers PoC changes (#1067)
* PoC utility

* Headers cmd

* headers download command

* Fix lint

* Send handshake

* Receive Status message

* Better error messages

* Messages

* Fix

* Fix lint

* Print block number for NewBlockMsg

* Fix lint
2020-09-07 07:03:12 +01:00

26 lines
657 B
Go

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 {
return download.Download()
},
}