mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-19 00:54:12 +00:00
256e4262e1
* 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
26 lines
657 B
Go
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()
|
|
},
|
|
}
|