mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 21:11:20 +00:00
config: add block downloader window flag (#2259)
This commit is contained in:
parent
bfe4d97fae
commit
17adaf5f87
@ -372,8 +372,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||
backend.sentryServers = append(backend.sentryServers, server65)
|
||||
backend.sentries = append(backend.sentries, remote.NewSentryClientDirect(eth.ETH65, server65))
|
||||
}
|
||||
blockDownloaderWindow := 65536
|
||||
backend.downloadServer, err = download.NewControlServer(chainDb.RwKV(), stack.Config().NodeName(), chainConfig, genesis.Hash(), backend.engine, backend.config.NetworkID, backend.sentries, blockDownloaderWindow)
|
||||
backend.downloadServer, err = download.NewControlServer(chainDb.RwKV(), stack.Config().NodeName(), chainConfig, genesis.Hash(), backend.engine, backend.config.NetworkID, backend.sentries, config.BlockDownloaderWindow)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -130,6 +130,8 @@ type Config struct {
|
||||
SnapshotSeeding bool
|
||||
SnapshotLayout bool
|
||||
|
||||
BlockDownloaderWindow int
|
||||
|
||||
// Address to connect to external snapshot downloader
|
||||
// empty if you want to use internal bittorrent snapshot downloader
|
||||
ExternalSnapshotDownloaderAddr string
|
||||
|
@ -27,6 +27,7 @@ var DefaultFlags = []cli.Flag{
|
||||
SnapshotDatabaseLayoutFlag,
|
||||
ExternalSnapshotDownloaderAddrFlag,
|
||||
BatchSizeFlag,
|
||||
BlockDownloaderWindowFlag,
|
||||
DatabaseVerbosityFlag,
|
||||
PrivateApiAddr,
|
||||
EtlBufferSizeFlag,
|
||||
|
@ -31,6 +31,11 @@ var (
|
||||
Usage: "Buffer size for ETL operations.",
|
||||
Value: etl.BufferOptimalSize.String(),
|
||||
}
|
||||
BlockDownloaderWindowFlag = cli.IntFlag{
|
||||
Name: "blockDownloaderWindow",
|
||||
Usage: "Outstanding limit of block bodies being downloaded",
|
||||
Value: 65536,
|
||||
}
|
||||
|
||||
PrivateApiAddr = cli.StringFlag{
|
||||
Name: "private.api.addr",
|
||||
@ -144,6 +149,7 @@ func ApplyFlagsForEthConfig(ctx *cli.Context, cfg *ethconfig.Config) {
|
||||
|
||||
cfg.ExternalSnapshotDownloaderAddr = ctx.GlobalString(ExternalSnapshotDownloaderAddrFlag.Name)
|
||||
cfg.StateStream = ctx.GlobalBool(StateStreamFlag.Name)
|
||||
cfg.BlockDownloaderWindow = ctx.GlobalInt(BlockDownloaderWindowFlag.Name)
|
||||
}
|
||||
func ApplyFlagsForEthConfigCobra(f *pflag.FlagSet, cfg *ethconfig.Config) {
|
||||
if v := f.String(StorageModeFlag.Name, StorageModeFlag.Value, StorageModeFlag.Usage); v != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user