github.com/prysmaticlabs/prysm@v1.4.4/shared/params/config_utils_prod.go (about)

     1  // +build !develop
     2  
     3  package params
     4  
     5  import (
     6  	"github.com/mohae/deepcopy"
     7  )
     8  
     9  var beaconConfig = MainnetConfig()
    10  
    11  // BeaconConfig retrieves beacon chain config.
    12  func BeaconConfig() *BeaconChainConfig {
    13  	return beaconConfig
    14  }
    15  
    16  // OverrideBeaconConfig by replacing the config. The preferred pattern is to
    17  // call BeaconConfig(), change the specific parameters, and then call
    18  // OverrideBeaconConfig(c). Any subsequent calls to params.BeaconConfig() will
    19  // return this new configuration.
    20  func OverrideBeaconConfig(c *BeaconChainConfig) {
    21  	beaconConfig = c
    22  }
    23  
    24  // Copy returns a copy of the config object.
    25  func (c *BeaconChainConfig) Copy() *BeaconChainConfig {
    26  	config, ok := deepcopy.Copy(*c).(BeaconChainConfig)
    27  	if !ok {
    28  		config = *beaconConfig
    29  	}
    30  	return &config
    31  }