-
Notifications
You must be signed in to change notification settings - Fork 402
/
reconfigure.go
39 lines (32 loc) · 1.17 KB
/
reconfigure.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
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package testplanet
import (
"go.uber.org/zap"
"storj.io/storj/bootstrap"
"storj.io/storj/satellite"
"storj.io/storj/storagenode"
)
// Reconfigure allows to change node configurations
type Reconfigure struct {
NewBootstrapDB func(index int) (bootstrap.DB, error)
Bootstrap func(index int, config *bootstrap.Config)
NewSatelliteDB func(log *zap.Logger, index int) (satellite.DB, error)
Satellite func(log *zap.Logger, index int, config *satellite.Config)
NewStorageNodeDB func(index int) (storagenode.DB, error)
StorageNode func(index int, config *storagenode.Config)
NewIPCount int
}
// DisablePeerCAWhitelist returns a `Reconfigure` that sets `UsePeerCAWhitelist` for
// all node types that use kademlia.
var DisablePeerCAWhitelist = Reconfigure{
Bootstrap: func(index int, config *bootstrap.Config) {
config.Server.UsePeerCAWhitelist = false
},
Satellite: func(log *zap.Logger, index int, config *satellite.Config) {
config.Server.UsePeerCAWhitelist = false
},
StorageNode: func(index int, config *storagenode.Config) {
config.Server.UsePeerCAWhitelist = false
},
}