mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-09 04:21:20 +00:00
8c376082ff
* move locking to the hd object itself, create ready channel * Fix lint * More integration * Fix lint * Connect to processing * Set hd.files at recovery * Serialise processSegment * Fix lint * Not prepend filesDir * Write to the database * Fix lint * Set up genesis block * Fix hard coded tips * Fix chainbreak false alarm * Recover from DB * Skip non-header records * Not initialise if recovered from DB * Fix lint
31 lines
957 B
Go
31 lines
957 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/cmd/headers/download"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
bufferSizeStr string // Size of buffer
|
|
)
|
|
|
|
func init() {
|
|
downloadCmd.Flags().StringVar(&filesDir, "filesdir", "", "path to directory where files will be stored")
|
|
downloadCmd.Flags().StringVar(&bufferSizeStr, "bufferSize", "512M", "size o the buffer")
|
|
downloadCmd.Flags().StringVar(&sentryAddr, "sentryAddr", "localhost:9091", "sentry address <host>:<port>")
|
|
downloadCmd.Flags().StringVar(&coreAddr, "coreAddr", "localhost:9092", "core address <host>:<port>")
|
|
withChaindata(downloadCmd)
|
|
withLmdbFlags(downloadCmd)
|
|
rootCmd.AddCommand(downloadCmd)
|
|
}
|
|
|
|
var downloadCmd = &cobra.Command{
|
|
Use: "download",
|
|
Short: "Download headers backwards",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
db := openDatabase(chaindata)
|
|
defer db.Close()
|
|
return download.Download(filesDir, bufferSizeStr, sentryAddr, coreAddr, db)
|
|
},
|
|
}
|