-
Notifications
You must be signed in to change notification settings - Fork 672
/
config.go
50 lines (38 loc) · 1.37 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package common
import (
"time"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/snow/validators"
)
// Config wraps the common configurations that are needed by a Snow consensus
// engine
type Config struct {
Ctx *snow.ConsensusContext
Validators validators.Set
Beacons validators.Set
SampleK int
StartupAlpha uint64
Alpha uint64
Sender Sender
Bootstrapable Bootstrapable
Subnet Subnet
Timer Timer
// Should Bootstrap be retried
RetryBootstrap bool
// Max number of times to retry bootstrap before warning the node operator
RetryBootstrapWarnFrequency int
// Max time to spend fetching a container and its ancestors when responding
// to a GetAncestors
MaxTimeGetAncestors time.Duration
// Max number of containers in a multiput message sent by this node.
MultiputMaxContainersSent int
// This node will only consider the first [MultiputMaxContainersReceived]
// containers in a multiput it receives.
MultiputMaxContainersReceived int
}
// Context implements the Engine interface
func (c *Config) Context() *snow.ConsensusContext { return c.Ctx }
// IsBootstrapped returns true iff this chain is done bootstrapping
func (c *Config) IsBootstrapped() bool { return c.Ctx.IsBootstrapped() }