config

package
v1.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_TRUNCATE_WINDOW = 7 * 24 * time.Hour // 1 week
View Source
const SIGNER = "signer"

Variables

This section is empty.

Functions

func GetLogger added in v0.20.0

func GetLogger(flags *Flags) (log.Logger, error)

func GetVcidFromServiceName added in v1.0.0

func GetVcidFromServiceName(serviceName string) int64

Types

type DockerConfig added in v1.0.0

type DockerConfig struct {
	Image               string
	Tag                 string
	Pull                bool
	ContainerNamePrefix string
	Resources           DockerResources
	Volumes             DockerVolumes
}

func (*DockerConfig) FullImageName added in v1.0.0

func (c *DockerConfig) FullImageName() string

type DockerResources added in v1.0.0

type DockerResources struct {
	Limits       Resource
	Reservations Resource
}

type DockerVolumes added in v1.0.0

type DockerVolumes struct {
	Blocks int
	Logs   int
}

In Gb with defaults of 100 and 2

type FederationNode added in v1.0.0

type FederationNode struct {
	Address string `json:"address"`
	IP      string `json:"ip"`
	Port    int    `json:"port"`
}

type Flags

type Flags struct {
	ConfigUrl         string
	KeyPairConfigPath string

	SSLCertificatePath string
	SSLPrivateKeyPath  string

	PollingInterval       time.Duration
	Timeout               time.Duration
	MaxReloadTimeDelay    time.Duration
	BootstrapResetTimeout time.Duration

	EthereumEndpoint string

	LoggerHttpEndpoint string
	LogFilePath        string

	StatusFilePath  string
	MetricsFilePath string

	OrchestratorOptions string

	ManagementConfig string

	// Autoupdate
	AutoUpdate          bool
	ShutdownAfterUpdate bool
	BoyarBinaryPath     string

	// Testing only
	WithNamespace bool
}

type KeyConfig added in v0.14.0

type KeyConfig interface {
	Address() string
	PrivateKey() string

	JSON(addressOnly bool) []byte
}

func NewKeysConfig added in v0.14.0

func NewKeysConfig(path string) (cfg KeyConfig, err error)

type MutableNodeConfiguration

type MutableNodeConfiguration interface {
	NodeConfiguration

	SetEthereumEndpoint(ethereumEndpoint string) MutableNodeConfiguration
	SetOrchestratorOptions(options *adapter.OrchestratorOptions) MutableNodeConfiguration
	SetSSLOptions(options adapter.SSLOptions) MutableNodeConfiguration
	UpdateDefaultServiceConfig() MutableNodeConfiguration
}

func NewStringConfigurationSource

func NewStringConfigurationSource(input string, ethereumEndpoint string, keyConfigPath string, withNamespace bool) (MutableNodeConfiguration, error)

func NewUrlConfigurationSource

func NewUrlConfigurationSource(url string, ethereumEndpoint string, keyConfigPath string, withNamespace bool) (MutableNodeConfiguration, error)

type NodeAddress added in v1.0.0

type NodeAddress string

func (NodeAddress) ShortID added in v1.0.0

func (n NodeAddress) ShortID() string

type NodeConfiguration

type NodeConfiguration interface {
	FederationNodes() []*FederationNode
	Chains() []*VirtualChain
	OrchestratorOptions() *adapter.OrchestratorOptions
	KeyConfigPath() string
	KeyConfig() KeyConfig
	ReloadTimeDelay(maxDelay time.Duration) time.Duration
	EthereumEndpoint() string
	NodeAddress() NodeAddress
	SSLOptions() adapter.SSLOptions
	Services() Services

	NamespacedContainerName(name string) string

	VerifyConfig() error
	Hash() string
}

func GetConfiguration

func GetConfiguration(flags *Flags) (NodeConfiguration, error)

type Peer added in v1.0.0

type Peer struct {
	IP   string
	Port int
}

type Resource added in v1.0.0

type Resource struct {
	Memory int64
	CPUs   float64
}

type Service added in v1.0.0

type Service struct {
	InternalPort int
	ExternalPort int
	DockerConfig DockerConfig
	Config       map[string]interface{}
	Disabled     bool
	PurgeData    bool

	InjectNodePrivateKey  bool
	ExecutablePath        string
	AllowAccessToSigner   bool
	AllowAccessToServices bool

	MountNodeLogs bool
}

type Services added in v1.0.0

type Services map[string]*Service

func (Services) Management added in v1.0.0

func (s Services) Management() *Service

func (Services) Signer added in v1.0.0

func (s Services) Signer() *Service

type VirtualChain added in v1.0.0

type VirtualChain struct {
	Service
	Id               VirtualChainId
	InternalHttpPort int // FIXME should be deprecated as vchain specific
}

func (*VirtualChain) GetContainerName added in v1.0.0

func (v *VirtualChain) GetContainerName() string

func (*VirtualChain) GetSerializedConfig added in v1.0.0

func (c *VirtualChain) GetSerializedConfig() []byte

type VirtualChainConfig added in v1.0.0

type VirtualChainConfig struct {
	VirtualChain *VirtualChain
	Topology     []*FederationNode
	NodeAddress  NodeAddress

	KeyPairConfig []byte `json:"-"` // Prevents key leak via log
}

type VirtualChainId added in v1.0.0

type VirtualChainId uint32

func (VirtualChainId) String added in v1.0.0

func (id VirtualChainId) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL