mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 03:22:18 +00:00
ab4c456fec
* Use log instead of Printf * Better output * Display NewBlockHeadersMsg * Print tx hashes * Separate sentry and downloader * Fix lint * Requesting headers * Fix lint * Prevent deadlock, fix NPE * Not quit when did not restore * Fix types * Fix types again * Warn on penalty * Prints * Avoid deadlock * Better request logic * Print height * Actually send header requests * Actually send header request * Fix compile errors, sending * Print BlockHeadersMsg * Fix lint
26 lines
665 B
Go
26 lines
665 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(filesDir)
|
|
},
|
|
}
|