2019-02-26 18:35:16 +00:00
|
|
|
// 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)
|
|
|
|
|
2019-07-05 17:04:15 +01:00
|
|
|
NewStorageNodeDB func(index int, db storagenode.DB, log *zap.Logger) (storagenode.DB, error)
|
2019-02-26 18:35:16 +00:00
|
|
|
StorageNode func(index int, config *storagenode.Config)
|
2019-05-30 18:35:04 +01:00
|
|
|
NewIPCount int
|
2019-02-26 18:35:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
},
|
|
|
|
}
|