run

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 125 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHTTPReadHeaderTimeout = 10 * time.Second
	DefaultHTTPConnectionLimit   = 500
	DefaultHTTPMaxWait           = 10 * time.Second
)

Variables

This section is empty.

Functions

func AddConfiguration

func AddConfiguration[T Configuration](cfg *Config, s T, predicate func(T) bool) T

func EqualConfiguration

func EqualConfiguration(a, b Configuration) bool

EqualConfiguration returns true if A and B are equal.

func EqualConsensusApp

func EqualConsensusApp(a, b ConsensusApp) bool

EqualConsensusApp returns true if A and B are equal.

func EqualPrivateKey

func EqualPrivateKey(a, b PrivateKey) bool

EqualPrivateKey returns true if A and B are equal.

func EqualService

func EqualService(a, b Service) bool

EqualService returns true if A and B are equal.

func EqualStorage

func EqualStorage(a, b Storage) bool

EqualStorage returns true if A and B are equal.

func HaveConfiguration

func HaveConfiguration[T any](cfg *Config, predicate func(T) bool, existing *T) bool

func MarshalTOML

func MarshalTOML(a any) ([]byte, error)

func Ptr

func Ptr[T any](v T) *T

Types

type BadgerStorage

type BadgerStorage struct {
	Path    string
	Version int64
}

func (*BadgerStorage) Copy

func (v *BadgerStorage) Copy() *BadgerStorage

Copy returns a copy of the BadgerStorage.

func (*BadgerStorage) Equal

func (v *BadgerStorage) Equal(u *BadgerStorage) bool

EqualBadgerStorage returns true if V is equal to U.

func (*BadgerStorage) MarshalJSON

func (v *BadgerStorage) MarshalJSON() ([]byte, error)

MarshalBinary marshals the BadgerStorage to JSON.

func (BadgerStorage) Type

func (BadgerStorage) Type() StorageType

func (*BadgerStorage) UnmarshalJSON

func (v *BadgerStorage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the BadgerStorage from JSON.

type BoltStorage

type BoltStorage struct {
	Path string
}

func (*BoltStorage) Copy

func (v *BoltStorage) Copy() *BoltStorage

Copy returns a copy of the BoltStorage.

func (*BoltStorage) Equal

func (v *BoltStorage) Equal(u *BoltStorage) bool

EqualBoltStorage returns true if V is equal to U.

func (*BoltStorage) MarshalJSON

func (v *BoltStorage) MarshalJSON() ([]byte, error)

MarshalBinary marshals the BoltStorage to JSON.

func (BoltStorage) Type

func (BoltStorage) Type() StorageType

func (*BoltStorage) UnmarshalJSON

func (v *BoltStorage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the BoltStorage from JSON.

type CometNodeKeyFile

type CometNodeKeyFile struct {
	Path string
	// contains filtered or unexported fields
}

func (*CometNodeKeyFile) Copy

Copy returns a copy of the CometNodeKeyFile.

func (*CometNodeKeyFile) Equal

func (v *CometNodeKeyFile) Equal(u *CometNodeKeyFile) bool

EqualCometNodeKeyFile returns true if V is equal to U.

func (*CometNodeKeyFile) MarshalJSON

func (v *CometNodeKeyFile) MarshalJSON() ([]byte, error)

MarshalBinary marshals the CometNodeKeyFile to JSON.

func (CometNodeKeyFile) Type

func (*CometNodeKeyFile) UnmarshalJSON

func (v *CometNodeKeyFile) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CometNodeKeyFile from JSON.

type CometPrivValFile

type CometPrivValFile struct {
	Path string
	// contains filtered or unexported fields
}

func (*CometPrivValFile) Copy

Copy returns a copy of the CometPrivValFile.

func (*CometPrivValFile) Equal

func (v *CometPrivValFile) Equal(u *CometPrivValFile) bool

EqualCometPrivValFile returns true if V is equal to U.

func (*CometPrivValFile) MarshalJSON

func (v *CometPrivValFile) MarshalJSON() ([]byte, error)

MarshalBinary marshals the CometPrivValFile to JSON.

func (CometPrivValFile) Type

func (*CometPrivValFile) UnmarshalJSON

func (v *CometPrivValFile) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CometPrivValFile from JSON.

type Config

type Config struct {
	DotEnv          *bool
	Network         string
	Configurations  []Configuration
	Services        []Service
	P2P             *P2P
	Logging         *Logging
	Instrumentation *Instrumentation
	Telemetry       *Telemetry
	// contains filtered or unexported fields
}

func (*Config) Copy

func (v *Config) Copy() *Config

Copy returns a copy of the Config.

func (*Config) Equal

func (v *Config) Equal(u *Config) bool

EqualConfig returns true if V is equal to U.

func (*Config) FilePath

func (c *Config) FilePath() string

func (*Config) Load

func (c *Config) Load(b []byte, format func([]byte, any) error) error

func (*Config) LoadFrom

func (c *Config) LoadFrom(file string) error

func (*Config) LoadFromFS

func (c *Config) LoadFromFS(fs fs.FS, file string) error

func (*Config) Marshal

func (c *Config) Marshal(format func(any) ([]byte, error)) ([]byte, error)

func (*Config) MarshalJSON

func (v *Config) MarshalJSON() ([]byte, error)

MarshalBinary marshals the Config to JSON.

func (*Config) Save

func (c *Config) Save() error

func (*Config) SaveTo

func (c *Config) SaveTo(file string) error

func (*Config) SetFilePath

func (c *Config) SetFilePath(p string)

func (*Config) UnmarshalJSON

func (v *Config) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Config from JSON.

type Configuration

type Configuration interface {
	Type() ConfigurationType
	// contains filtered or unexported methods
}

func CopyConfiguration

func CopyConfiguration(v Configuration) Configuration

CopyConfiguration returns a copy of the Configuration.

func UnmarshalConfigurationJSON

func UnmarshalConfigurationJSON(b []byte) (Configuration, error)

UnmarshalConfigurationJSON unmarshals a Configuration from JSON.

type ConfigurationType

type ConfigurationType int64
const (
	ConfigurationTypeCoreValidator ConfigurationType = 1
	ConfigurationTypeDevnet        ConfigurationType = 3
	ConfigurationTypeGateway       ConfigurationType = 2
)

func (ConfigurationType) MarshalJSON

func (v ConfigurationType) MarshalJSON() ([]byte, error)

MarshalBinary marshals the ConfigurationType to JSON.

func (*ConfigurationType) SetByName

func (v *ConfigurationType) SetByName(s string) (ok bool)

SetByName looks up a ConfigurationType by name.

func (*ConfigurationType) SetByValue

func (v *ConfigurationType) SetByValue(i int64) (ok bool)

SetByValue looks up a ConfigurationType by value.

func (ConfigurationType) String

func (v ConfigurationType) String() string

String returns the label or name of the ConfigurationType.

func (*ConfigurationType) UnmarshalJSON

func (v *ConfigurationType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ConfigurationType from JSON.

type ConsensusApp

type ConsensusApp interface {
	Type() ConsensusAppType

	Requires() []ioc.Requirement
	Provides() []ioc.Provided
	// contains filtered or unexported methods
}

func CopyConsensusApp

func CopyConsensusApp(v ConsensusApp) ConsensusApp

CopyConsensusApp returns a copy of the ConsensusApp.

func UnmarshalConsensusAppJSON

func UnmarshalConsensusAppJSON(b []byte) (ConsensusApp, error)

UnmarshalConsensusAppJSON unmarshals a ConsensusApp from JSON.

type ConsensusAppType

type ConsensusAppType int64
const (
	ConsensusAppTypeCore ConsensusAppType = 1
)

func (ConsensusAppType) MarshalJSON

func (v ConsensusAppType) MarshalJSON() ([]byte, error)

MarshalBinary marshals the ConsensusAppType to JSON.

func (*ConsensusAppType) SetByName

func (v *ConsensusAppType) SetByName(s string) (ok bool)

SetByName looks up a ConsensusAppType by name.

func (*ConsensusAppType) SetByValue

func (v *ConsensusAppType) SetByValue(i int64) (ok bool)

SetByValue looks up a ConsensusAppType by value.

func (ConsensusAppType) String

func (v ConsensusAppType) String() string

String returns the label or name of the ConsensusAppType.

func (*ConsensusAppType) UnmarshalJSON

func (v *ConsensusAppType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ConsensusAppType from JSON.

type ConsensusService

type ConsensusService struct {
	NodeDir          string
	ValidatorKey     PrivateKey
	Genesis          string
	Listen           Multiaddr
	BootstrapPeers   []Multiaddr
	MetricsNamespace string
	App              ConsensusApp
}

func (*ConsensusService) Copy

Copy returns a copy of the ConsensusService.

func (*ConsensusService) Equal

func (v *ConsensusService) Equal(u *ConsensusService) bool

EqualConsensusService returns true if V is equal to U.

func (*ConsensusService) MarshalJSON

func (v *ConsensusService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the ConsensusService to JSON.

func (*ConsensusService) Provides

func (c *ConsensusService) Provides() []ioc.Provided

func (*ConsensusService) Requires

func (c *ConsensusService) Requires() []ioc.Requirement

func (ConsensusService) Type

func (*ConsensusService) UnmarshalJSON

func (v *ConsensusService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ConsensusService from JSON.

func (*ConsensusService) Verify

func (c *ConsensusService) Verify() error

type CoreConsensusApp

type CoreConsensusApp struct {
	Partition            *protocol.PartitionInfo
	EnableHealing        *bool
	EnableDirectDispatch *bool
	MaxEnvelopesPerBlock *uint64
}

func (*CoreConsensusApp) Copy

Copy returns a copy of the CoreConsensusApp.

func (*CoreConsensusApp) Equal

func (v *CoreConsensusApp) Equal(u *CoreConsensusApp) bool

EqualCoreConsensusApp returns true if V is equal to U.

func (*CoreConsensusApp) MarshalJSON

func (v *CoreConsensusApp) MarshalJSON() ([]byte, error)

MarshalBinary marshals the CoreConsensusApp to JSON.

func (*CoreConsensusApp) Provides

func (c *CoreConsensusApp) Provides() []ioc.Provided

func (*CoreConsensusApp) Requires

func (c *CoreConsensusApp) Requires() []ioc.Requirement

func (CoreConsensusApp) Type

func (*CoreConsensusApp) UnmarshalJSON

func (v *CoreConsensusApp) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CoreConsensusApp from JSON.

type CoreValidatorConfiguration

type CoreValidatorConfiguration struct {
	Mode                 CoreValidatorMode
	Listen               Multiaddr
	BVN                  string
	ValidatorKey         PrivateKey
	DnGenesis            string
	BvnGenesis           string
	DnBootstrapPeers     []Multiaddr
	BvnBootstrapPeers    []Multiaddr
	EnableHealing        *bool
	EnableDirectDispatch *bool
	EnableSnapshots      *bool
	MaxEnvelopesPerBlock *uint64
	StorageType          *StorageType
}

func (*CoreValidatorConfiguration) Copy

Copy returns a copy of the CoreValidatorConfiguration.

func (*CoreValidatorConfiguration) Equal

EqualCoreValidatorConfiguration returns true if V is equal to U.

func (*CoreValidatorConfiguration) MarshalJSON

func (v *CoreValidatorConfiguration) MarshalJSON() ([]byte, error)

MarshalBinary marshals the CoreValidatorConfiguration to JSON.

func (CoreValidatorConfiguration) Type

func (*CoreValidatorConfiguration) UnmarshalJSON

func (v *CoreValidatorConfiguration) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CoreValidatorConfiguration from JSON.

type CoreValidatorMode

type CoreValidatorMode int64
const (
	CoreValidatorModeBVN  CoreValidatorMode = 2
	CoreValidatorModeDN   CoreValidatorMode = 1
	CoreValidatorModeDual CoreValidatorMode = 0
)

func (CoreValidatorMode) MarshalJSON

func (v CoreValidatorMode) MarshalJSON() ([]byte, error)

MarshalBinary marshals the CoreValidatorMode to JSON.

func (*CoreValidatorMode) SetByName

func (v *CoreValidatorMode) SetByName(s string) (ok bool)

SetByName looks up a CoreValidatorMode by name.

func (*CoreValidatorMode) SetByValue

func (v *CoreValidatorMode) SetByValue(i int64) (ok bool)

SetByValue looks up a CoreValidatorMode by value.

func (CoreValidatorMode) String

func (v CoreValidatorMode) String() string

String returns the label or name of the CoreValidatorMode.

func (*CoreValidatorMode) UnmarshalJSON

func (v *CoreValidatorMode) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the CoreValidatorMode from JSON.

type DevnetConfiguration

type DevnetConfiguration struct {
	Listen      Multiaddr
	Bvns        uint64
	Validators  uint64
	Followers   uint64
	Globals     *network.GlobalValues
	StorageType *StorageType
}

func (*DevnetConfiguration) Copy

Copy returns a copy of the DevnetConfiguration.

func (*DevnetConfiguration) Equal

EqualDevnetConfiguration returns true if V is equal to U.

func (*DevnetConfiguration) MarshalJSON

func (v *DevnetConfiguration) MarshalJSON() ([]byte, error)

MarshalBinary marshals the DevnetConfiguration to JSON.

func (DevnetConfiguration) Type

func (*DevnetConfiguration) UnmarshalJSON

func (v *DevnetConfiguration) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the DevnetConfiguration from JSON.

type DhtMode

type DhtMode dht.ModeOpt

func (DhtMode) MarshalJSON

func (d DhtMode) MarshalJSON() ([]byte, error)

func (DhtMode) String

func (d DhtMode) String() string

func (*DhtMode) UnmarshalJSON

func (d *DhtMode) UnmarshalJSON(b []byte) error

type EventsService

type EventsService struct {
	Partition string
}

func (*EventsService) Copy

func (v *EventsService) Copy() *EventsService

Copy returns a copy of the EventsService.

func (*EventsService) Equal

func (v *EventsService) Equal(u *EventsService) bool

EqualEventsService returns true if V is equal to U.

func (*EventsService) MarshalJSON

func (v *EventsService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the EventsService to JSON.

func (*EventsService) Provides

func (e *EventsService) Provides() []ioc.Provided

func (*EventsService) Requires

func (e *EventsService) Requires() []ioc.Requirement

func (EventsService) Type

func (EventsService) Type() ServiceType

func (*EventsService) UnmarshalJSON

func (v *EventsService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the EventsService from JSON.

type ExpBlockDBStorage

type ExpBlockDBStorage struct {
	Path string
}

func (*ExpBlockDBStorage) Copy

Copy returns a copy of the ExpBlockDBStorage.

func (*ExpBlockDBStorage) Equal

EqualExpBlockDBStorage returns true if V is equal to U.

func (*ExpBlockDBStorage) MarshalJSON

func (v *ExpBlockDBStorage) MarshalJSON() ([]byte, error)

MarshalBinary marshals the ExpBlockDBStorage to JSON.

func (ExpBlockDBStorage) Type

func (*ExpBlockDBStorage) UnmarshalJSON

func (v *ExpBlockDBStorage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ExpBlockDBStorage from JSON.

type FaucetService

type FaucetService struct {
	Account    *url.URL
	SigningKey PrivateKey
	Router     *RouterServiceRef
}

func (*FaucetService) Copy

func (v *FaucetService) Copy() *FaucetService

Copy returns a copy of the FaucetService.

func (*FaucetService) Equal

func (v *FaucetService) Equal(u *FaucetService) bool

EqualFaucetService returns true if V is equal to U.

func (*FaucetService) MarshalJSON

func (v *FaucetService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the FaucetService to JSON.

func (*FaucetService) Provides

func (f *FaucetService) Provides() []ioc.Provided

func (*FaucetService) Requires

func (f *FaucetService) Requires() []ioc.Requirement

func (FaucetService) Type

func (FaucetService) Type() ServiceType

func (*FaucetService) UnmarshalJSON

func (v *FaucetService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the FaucetService from JSON.

type GatewayConfiguration

type GatewayConfiguration struct {
	Listen Multiaddr
}

func (*GatewayConfiguration) Copy

Copy returns a copy of the GatewayConfiguration.

func (*GatewayConfiguration) Equal

EqualGatewayConfiguration returns true if V is equal to U.

func (*GatewayConfiguration) MarshalJSON

func (v *GatewayConfiguration) MarshalJSON() ([]byte, error)

MarshalBinary marshals the GatewayConfiguration to JSON.

func (GatewayConfiguration) Type

func (*GatewayConfiguration) UnmarshalJSON

func (v *GatewayConfiguration) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the GatewayConfiguration from JSON.

type HttpListener

type HttpListener struct {
	// Listen are the addresses and schemes to listen on.
	Listen []Multiaddr
	// ConnectionLimit limits the number of concurrent connections.
	ConnectionLimit *int64
	// ReadHeaderTimeout protects against slow-loris attacks.
	ReadHeaderTimeout *encoding.Duration
	// TlsCertPath is the path of the TLS certificate.
	TlsCertPath string
	// TlsKeyPath is the path of the TLS key.
	TlsKeyPath string
}

func (*HttpListener) Copy

func (v *HttpListener) Copy() *HttpListener

Copy returns a copy of the HttpListener.

func (*HttpListener) Equal

func (v *HttpListener) Equal(u *HttpListener) bool

EqualHttpListener returns true if V is equal to U.

func (*HttpListener) MarshalJSON

func (v *HttpListener) MarshalJSON() ([]byte, error)

MarshalBinary marshals the HttpListener to JSON.

func (*HttpListener) UnmarshalJSON

func (v *HttpListener) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the HttpListener from JSON.

type HttpPeerMapEntry

type HttpPeerMapEntry struct {
	ID         PeerID
	Partitions []string
	Addresses  []Multiaddr
}

func (*HttpPeerMapEntry) Copy

Copy returns a copy of the HttpPeerMapEntry.

func (*HttpPeerMapEntry) Equal

func (v *HttpPeerMapEntry) Equal(u *HttpPeerMapEntry) bool

EqualHttpPeerMapEntry returns true if V is equal to U.

func (*HttpPeerMapEntry) MarshalJSON

func (v *HttpPeerMapEntry) MarshalJSON() ([]byte, error)

MarshalBinary marshals the HttpPeerMapEntry to JSON.

func (*HttpPeerMapEntry) UnmarshalJSON

func (v *HttpPeerMapEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the HttpPeerMapEntry from JSON.

type HttpService

type HttpService struct {
	HttpListener
	// CorsOrigins is a list of allowed CORS origins.
	CorsOrigins []string
	// LetsEncrypt automatically retrieves a certificate from Let's Encrypt for the specified domains.
	LetsEncrypt  []string
	DebugJsonRpc *bool
	Router       *RouterServiceRef
	// PeerMap hard-codes the peer map.
	PeerMap []*HttpPeerMapEntry
}

func (*HttpService) Copy

func (v *HttpService) Copy() *HttpService

Copy returns a copy of the HttpService.

func (*HttpService) Equal

func (v *HttpService) Equal(u *HttpService) bool

EqualHttpService returns true if V is equal to U.

func (*HttpService) MarshalJSON

func (v *HttpService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the HttpService to JSON.

func (*HttpService) Provides

func (h *HttpService) Provides() []ioc.Provided

func (*HttpService) Requires

func (h *HttpService) Requires() []ioc.Requirement

func (HttpService) Type

func (HttpService) Type() ServiceType

func (*HttpService) UnmarshalJSON

func (v *HttpService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the HttpService from JSON.

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg *Config) (*Instance, error)

func Start

func Start(ctx context.Context, cfg *Config) (*Instance, error)

func (*Instance) Done

func (i *Instance) Done() <-chan struct{}

func (*Instance) Reset

func (inst *Instance) Reset() error

func (*Instance) Start

func (inst *Instance) Start() error

func (*Instance) StartFiltered

func (inst *Instance) StartFiltered(predicate func(Service) bool) (err error)

func (*Instance) Stop

func (i *Instance) Stop()

func (*Instance) Verify

func (i *Instance) Verify() (*Config, error)

Verify validates the configuration and returns it with all services expanded.

type Instrumentation

type Instrumentation struct {
	HttpListener
	PprofListen Multiaddr
	Monitoring  *Monitor
}

func (*Instrumentation) Copy

func (v *Instrumentation) Copy() *Instrumentation

Copy returns a copy of the Instrumentation.

func (*Instrumentation) Equal

func (v *Instrumentation) Equal(u *Instrumentation) bool

EqualInstrumentation returns true if V is equal to U.

func (*Instrumentation) MarshalJSON

func (v *Instrumentation) MarshalJSON() ([]byte, error)

MarshalBinary marshals the Instrumentation to JSON.

func (*Instrumentation) UnmarshalJSON

func (v *Instrumentation) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Instrumentation from JSON.

type LevelDBStorage

type LevelDBStorage struct {
	Path string
}

func (*LevelDBStorage) Copy

func (v *LevelDBStorage) Copy() *LevelDBStorage

Copy returns a copy of the LevelDBStorage.

func (*LevelDBStorage) Equal

func (v *LevelDBStorage) Equal(u *LevelDBStorage) bool

EqualLevelDBStorage returns true if V is equal to U.

func (*LevelDBStorage) MarshalJSON

func (v *LevelDBStorage) MarshalJSON() ([]byte, error)

MarshalBinary marshals the LevelDBStorage to JSON.

func (LevelDBStorage) Type

func (LevelDBStorage) Type() StorageType

func (*LevelDBStorage) UnmarshalJSON

func (v *LevelDBStorage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the LevelDBStorage from JSON.

type Logging

type Logging struct {
	Format string
	Color  *bool
	Rules  []*LoggingRule
	Loki   *LokiLogging
}

func (*Logging) Copy

func (v *Logging) Copy() *Logging

Copy returns a copy of the Logging.

func (*Logging) Equal

func (v *Logging) Equal(u *Logging) bool

EqualLogging returns true if V is equal to U.

func (*Logging) MarshalJSON

func (v *Logging) MarshalJSON() ([]byte, error)

MarshalBinary marshals the Logging to JSON.

func (*Logging) UnmarshalJSON

func (v *Logging) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Logging from JSON.

type LoggingRule

type LoggingRule struct {
	Level   slog.Level
	Modules []string
}

func (*LoggingRule) Copy

func (v *LoggingRule) Copy() *LoggingRule

Copy returns a copy of the LoggingRule.

func (*LoggingRule) Equal

func (v *LoggingRule) Equal(u *LoggingRule) bool

EqualLoggingRule returns true if V is equal to U.

func (*LoggingRule) MarshalJSON

func (v *LoggingRule) MarshalJSON() ([]byte, error)

MarshalBinary marshals the LoggingRule to JSON.

func (*LoggingRule) UnmarshalJSON

func (v *LoggingRule) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the LoggingRule from JSON.

type LokiLogging

type LokiLogging struct {
	Enable   bool
	Url      string
	Username string
	Password string
}

func (*LokiLogging) Copy

func (v *LokiLogging) Copy() *LokiLogging

Copy returns a copy of the LokiLogging.

func (*LokiLogging) Equal

func (v *LokiLogging) Equal(u *LokiLogging) bool

EqualLokiLogging returns true if V is equal to U.

func (*LokiLogging) MarshalJSON

func (v *LokiLogging) MarshalJSON() ([]byte, error)

MarshalBinary marshals the LokiLogging to JSON.

func (*LokiLogging) UnmarshalJSON

func (v *LokiLogging) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the LokiLogging from JSON.

type MemoryStorage

type MemoryStorage struct {
}

func (*MemoryStorage) Copy

func (v *MemoryStorage) Copy() *MemoryStorage

Copy returns a copy of the MemoryStorage.

func (*MemoryStorage) Equal

func (v *MemoryStorage) Equal(u *MemoryStorage) bool

EqualMemoryStorage returns true if V is equal to U.

func (*MemoryStorage) MarshalJSON

func (v *MemoryStorage) MarshalJSON() ([]byte, error)

MarshalBinary marshals the MemoryStorage to JSON.

func (MemoryStorage) Type

func (MemoryStorage) Type() StorageType

func (*MemoryStorage) UnmarshalJSON

func (v *MemoryStorage) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MemoryStorage from JSON.

type MetricsService

type MetricsService struct {
	Partition string
}

func (*MetricsService) Copy

func (v *MetricsService) Copy() *MetricsService

Copy returns a copy of the MetricsService.

func (*MetricsService) Equal

func (v *MetricsService) Equal(u *MetricsService) bool

EqualMetricsService returns true if V is equal to U.

func (*MetricsService) MarshalJSON

func (v *MetricsService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the MetricsService to JSON.

func (*MetricsService) Provides

func (m *MetricsService) Provides() []ioc.Provided

func (*MetricsService) Requires

func (m *MetricsService) Requires() []ioc.Requirement

func (MetricsService) Type

func (MetricsService) Type() ServiceType

func (*MetricsService) UnmarshalJSON

func (v *MetricsService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the MetricsService from JSON.

type Monitor

type Monitor struct {
	// Directory is the directory traces and profiles are written to.
	Directory string
	// ProfileMemory enables profiling when memory usage increases dramatically.
	ProfileMemory *bool
	// MemoryPollingRate is rate at which to poll memory usage.
	MemoryPollingRate *encoding.Duration
	// AllocRateTrigger is the rate of allocation in bytes/second that triggers a profile.
	AllocRateTrigger *float64
}

func (*Monitor) Copy

func (v *Monitor) Copy() *Monitor

Copy returns a copy of the Monitor.

func (*Monitor) Equal

func (v *Monitor) Equal(u *Monitor) bool

EqualMonitor returns true if V is equal to U.

func (*Monitor) MarshalJSON

func (v *Monitor) MarshalJSON() ([]byte, error)

MarshalBinary marshals the Monitor to JSON.

func (*Monitor) UnmarshalJSON

func (v *Monitor) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Monitor from JSON.

type Multiaddr

type Multiaddr = multiaddr.Multiaddr

type NetworkService

type NetworkService struct {
	Partition string
}

func (*NetworkService) Copy

func (v *NetworkService) Copy() *NetworkService

Copy returns a copy of the NetworkService.

func (*NetworkService) Equal

func (v *NetworkService) Equal(u *NetworkService) bool

EqualNetworkService returns true if V is equal to U.

func (*NetworkService) MarshalJSON

func (v *NetworkService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the NetworkService to JSON.

func (*NetworkService) Provides

func (n *NetworkService) Provides() []ioc.Provided

func (*NetworkService) Requires

func (n *NetworkService) Requires() []ioc.Requirement

func (NetworkService) Type

func (NetworkService) Type() ServiceType

func (*NetworkService) UnmarshalJSON

func (v *NetworkService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the NetworkService from JSON.

type OtlpConfig

type OtlpConfig struct {
	Enabled  *bool
	Endpoint string
	Username string
	Password string
}

func (*OtlpConfig) Copy

func (v *OtlpConfig) Copy() *OtlpConfig

Copy returns a copy of the OtlpConfig.

func (*OtlpConfig) Equal

func (v *OtlpConfig) Equal(u *OtlpConfig) bool

EqualOtlpConfig returns true if V is equal to U.

func (*OtlpConfig) MarshalJSON

func (v *OtlpConfig) MarshalJSON() ([]byte, error)

MarshalBinary marshals the OtlpConfig to JSON.

func (*OtlpConfig) UnmarshalJSON

func (v *OtlpConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the OtlpConfig from JSON.

type P2P

type P2P struct {
	Listen             []Multiaddr
	BootstrapPeers     []Multiaddr
	Key                PrivateKey
	PeerDB             *string
	EnablePeerTracking bool
	DiscoveryMode      *DhtMode
	External           Multiaddr
}

func (*P2P) Copy

func (v *P2P) Copy() *P2P

Copy returns a copy of the P2P.

func (*P2P) Equal

func (v *P2P) Equal(u *P2P) bool

EqualP2P returns true if V is equal to U.

func (*P2P) MarshalJSON

func (v *P2P) MarshalJSON() ([]byte, error)

MarshalBinary marshals the P2P to JSON.

func (*P2P) UnmarshalJSON

func (v *P2P) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the P2P from JSON.

type PeerID

type PeerID = peer.ID

type PrivateKey

type PrivateKey interface {
	Type() PrivateKeyType
	// contains filtered or unexported methods
}

func CopyPrivateKey

func CopyPrivateKey(v PrivateKey) PrivateKey

CopyPrivateKey returns a copy of the PrivateKey.

func UnmarshalPrivateKeyJSON

func UnmarshalPrivateKeyJSON(b []byte) (PrivateKey, error)

UnmarshalPrivateKeyJSON unmarshals a PrivateKey from JSON.

type PrivateKeySeed

type PrivateKeySeed struct {
	Seed *record.Key
	// contains filtered or unexported fields
}

func (*PrivateKeySeed) Copy

func (v *PrivateKeySeed) Copy() *PrivateKeySeed

Copy returns a copy of the PrivateKeySeed.

func (*PrivateKeySeed) Equal

func (v *PrivateKeySeed) Equal(u *PrivateKeySeed) bool

EqualPrivateKeySeed returns true if V is equal to U.

func (*PrivateKeySeed) MarshalJSON

func (v *PrivateKeySeed) MarshalJSON() ([]byte, error)

MarshalBinary marshals the PrivateKeySeed to JSON.

func (PrivateKeySeed) Type

func (*PrivateKeySeed) UnmarshalJSON

func (v *PrivateKeySeed) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PrivateKeySeed from JSON.

type PrivateKeyType

type PrivateKeyType int64
const (
	PrivateKeyTypeCometNodeKeyFile PrivateKeyType = 5
	PrivateKeyTypeCometPrivValFile PrivateKeyType = 4
	PrivateKeyTypeRaw              PrivateKeyType = 1
	PrivateKeyTypeSeed             PrivateKeyType = 3
	PrivateKeyTypeTransient        PrivateKeyType = 2
)

func (PrivateKeyType) MarshalJSON

func (v PrivateKeyType) MarshalJSON() ([]byte, error)

MarshalBinary marshals the PrivateKeyType to JSON.

func (*PrivateKeyType) SetByName

func (v *PrivateKeyType) SetByName(s string) (ok bool)

SetByName looks up a PrivateKeyType by name.

func (*PrivateKeyType) SetByValue

func (v *PrivateKeyType) SetByValue(i int64) (ok bool)

SetByValue looks up a PrivateKeyType by value.

func (PrivateKeyType) String

func (v PrivateKeyType) String() string

String returns the label or name of the PrivateKeyType.

func (*PrivateKeyType) UnmarshalJSON

func (v *PrivateKeyType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PrivateKeyType from JSON.

type Querier

type Querier struct {
	Partition string
	Storage   *StorageOrRef
}

func (*Querier) Copy

func (v *Querier) Copy() *Querier

Copy returns a copy of the Querier.

func (*Querier) Equal

func (v *Querier) Equal(u *Querier) bool

EqualQuerier returns true if V is equal to U.

func (*Querier) MarshalJSON

func (v *Querier) MarshalJSON() ([]byte, error)

MarshalBinary marshals the Querier to JSON.

func (*Querier) Provides

func (q *Querier) Provides() []ioc.Provided

func (*Querier) Requires

func (q *Querier) Requires() []ioc.Requirement

func (Querier) Type

func (Querier) Type() ServiceType

func (*Querier) UnmarshalJSON

func (v *Querier) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Querier from JSON.

type RawPrivateKey

type RawPrivateKey struct {
	Address string
}

func (*RawPrivateKey) Copy

func (v *RawPrivateKey) Copy() *RawPrivateKey

Copy returns a copy of the RawPrivateKey.

func (*RawPrivateKey) Equal

func (v *RawPrivateKey) Equal(u *RawPrivateKey) bool

EqualRawPrivateKey returns true if V is equal to U.

func (*RawPrivateKey) MarshalJSON

func (v *RawPrivateKey) MarshalJSON() ([]byte, error)

MarshalBinary marshals the RawPrivateKey to JSON.

func (RawPrivateKey) Type

func (*RawPrivateKey) UnmarshalJSON

func (v *RawPrivateKey) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the RawPrivateKey from JSON.

type RouterService

type RouterService struct {
	Name string
	// Events may specify an event bus to use for routing table updates.
	Events string
	// PeerMap uses a hard-coded peer map for initializing routing.
	PeerMap []*HttpPeerMapEntry
}

func (*RouterService) Copy

func (v *RouterService) Copy() *RouterService

Copy returns a copy of the RouterService.

func (*RouterService) Equal

func (v *RouterService) Equal(u *RouterService) bool

EqualRouterService returns true if V is equal to U.

func (*RouterService) MarshalJSON

func (v *RouterService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the RouterService to JSON.

func (*RouterService) Provides

func (r *RouterService) Provides() []ioc.Provided

func (*RouterService) Requires

func (r *RouterService) Requires() []ioc.Requirement

func (RouterService) Type

func (RouterService) Type() ServiceType

func (*RouterService) UnmarshalJSON

func (v *RouterService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the RouterService from JSON.

type RouterServiceRef

type RouterServiceRef = ServiceOrRef[*RouterService]

TODO: Remove (once schema supports it)

type Service

type Service interface {
	ioc.Factory
	Type() ServiceType
	// contains filtered or unexported methods
}

func CopyService

func CopyService(v Service) Service

CopyService returns a copy of the Service.

func UnmarshalServiceJSON

func UnmarshalServiceJSON(b []byte) (Service, error)

UnmarshalServiceJSON unmarshals a Service from JSON.

type ServiceOrRef

type ServiceOrRef[T serviceType[T]] baseRef[T]

func ServiceReference

func ServiceReference[T serviceType[T]](ref string) *ServiceOrRef[T]

func ServiceValue

func ServiceValue[T serviceType[T]](service T) *ServiceOrRef[T]

func (*ServiceOrRef[T]) Copy

func (s *ServiceOrRef[T]) Copy() *ServiceOrRef[T]

func (*ServiceOrRef[T]) Equal

func (s *ServiceOrRef[T]) Equal(t *ServiceOrRef[T]) bool

func (*ServiceOrRef[T]) MarshalJSON

func (s *ServiceOrRef[T]) MarshalJSON() ([]byte, error)

func (*ServiceOrRef[T]) RequiresOr

func (s *ServiceOrRef[T]) RequiresOr(def ...ioc.Requirement) []ioc.Requirement

func (*ServiceOrRef[T]) UnmarshalJSON

func (s *ServiceOrRef[T]) UnmarshalJSON(b []byte) error

type ServiceType

type ServiceType int64
const (
	ServiceTypeConsensus ServiceType = 2
	ServiceTypeEvents    ServiceType = 6
	ServiceTypeFaucet    ServiceType = 10
	ServiceTypeHttp      ServiceType = 7
	ServiceTypeMetrics   ServiceType = 5
	ServiceTypeNetwork   ServiceType = 4
	ServiceTypeQuerier   ServiceType = 3
	ServiceTypeRouter    ServiceType = 8
	ServiceTypeSnapshot  ServiceType = 9
	ServiceTypeStorage   ServiceType = 1
	ServiceTypeSubnode   ServiceType = 11
)

func (ServiceType) MarshalJSON

func (v ServiceType) MarshalJSON() ([]byte, error)

MarshalBinary marshals the ServiceType to JSON.

func (*ServiceType) SetByName

func (v *ServiceType) SetByName(s string) (ok bool)

SetByName looks up a ServiceType by name.

func (*ServiceType) SetByValue

func (v *ServiceType) SetByValue(i int64) (ok bool)

SetByValue looks up a ServiceType by value.

func (ServiceType) String

func (v ServiceType) String() string

String returns the label or name of the ServiceType.

func (*ServiceType) UnmarshalJSON

func (v *ServiceType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ServiceType from JSON.

type SnapshotService

type SnapshotService struct {
	Partition string
	Storage   *StorageOrRef
	// Directory is the directory to store snapshots in.
	Directory string
	// Schedule is the schedule for capturing snapshots.
	Schedule *network.CronSchedule
	// RetainCount is the number of snapshots to retain.
	RetainCount *uint64
	// EnableIndexing enables indexing of snapshots.
	EnableIndexing *bool
}

func (*SnapshotService) Copy

func (v *SnapshotService) Copy() *SnapshotService

Copy returns a copy of the SnapshotService.

func (*SnapshotService) Equal

func (v *SnapshotService) Equal(u *SnapshotService) bool

EqualSnapshotService returns true if V is equal to U.

func (*SnapshotService) MarshalJSON

func (v *SnapshotService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the SnapshotService to JSON.

func (*SnapshotService) Provides

func (s *SnapshotService) Provides() []ioc.Provided

func (*SnapshotService) Requires

func (s *SnapshotService) Requires() []ioc.Requirement

func (SnapshotService) Type

func (*SnapshotService) UnmarshalJSON

func (v *SnapshotService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SnapshotService from JSON.

type Storage

type Storage interface {
	Type() StorageType
	// contains filtered or unexported methods
}

func CopyStorage

func CopyStorage(v Storage) Storage

CopyStorage returns a copy of the Storage.

func UnmarshalStorageJSON

func UnmarshalStorageJSON(b []byte) (Storage, error)

UnmarshalStorageJSON unmarshals a Storage from JSON.

type StorageOrRef

type StorageOrRef baseRef[Storage]

func (*StorageOrRef) Copy

func (s *StorageOrRef) Copy() *StorageOrRef

func (*StorageOrRef) Equal

func (s *StorageOrRef) Equal(t *StorageOrRef) bool

func (*StorageOrRef) MarshalJSON

func (s *StorageOrRef) MarshalJSON() ([]byte, error)

func (*StorageOrRef) Required

func (s *StorageOrRef) Required(def string) []ioc.Requirement

func (*StorageOrRef) UnmarshalJSON

func (s *StorageOrRef) UnmarshalJSON(b []byte) error

type StorageService

type StorageService struct {
	Name    string
	Storage Storage
}

func (*StorageService) Copy

func (v *StorageService) Copy() *StorageService

Copy returns a copy of the StorageService.

func (*StorageService) Equal

func (v *StorageService) Equal(u *StorageService) bool

EqualStorageService returns true if V is equal to U.

func (*StorageService) MarshalJSON

func (v *StorageService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the StorageService to JSON.

func (*StorageService) Provides

func (c *StorageService) Provides() []ioc.Provided

func (*StorageService) Requires

func (c *StorageService) Requires() []ioc.Requirement

func (StorageService) Type

func (StorageService) Type() ServiceType

func (*StorageService) UnmarshalJSON

func (v *StorageService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the StorageService from JSON.

type StorageType

type StorageType int64
const (
	StorageTypeBadger     StorageType = 2
	StorageTypeBolt       StorageType = 3
	StorageTypeExpBlockDB StorageType = 1001
	StorageTypeLevelDB    StorageType = 4
	StorageTypeMemory     StorageType = 1
)

func (StorageType) MarshalJSON

func (v StorageType) MarshalJSON() ([]byte, error)

MarshalBinary marshals the StorageType to JSON.

func (*StorageType) SetByName

func (v *StorageType) SetByName(s string) (ok bool)

SetByName looks up a StorageType by name.

func (*StorageType) SetByValue

func (v *StorageType) SetByValue(i int64) (ok bool)

SetByValue looks up a StorageType by value.

func (StorageType) String

func (v StorageType) String() string

String returns the label or name of the StorageType.

func (*StorageType) UnmarshalJSON

func (v *StorageType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the StorageType from JSON.

type SubnodeService

type SubnodeService struct {
	Name     string
	NodeKey  PrivateKey
	Services []Service
}

func (*SubnodeService) Copy

func (v *SubnodeService) Copy() *SubnodeService

Copy returns a copy of the SubnodeService.

func (*SubnodeService) Equal

func (v *SubnodeService) Equal(u *SubnodeService) bool

EqualSubnodeService returns true if V is equal to U.

func (*SubnodeService) MarshalJSON

func (v *SubnodeService) MarshalJSON() ([]byte, error)

MarshalBinary marshals the SubnodeService to JSON.

func (*SubnodeService) Provides

func (s *SubnodeService) Provides() []ioc.Provided

func (*SubnodeService) Requires

func (s *SubnodeService) Requires() []ioc.Requirement

func (SubnodeService) Type

func (SubnodeService) Type() ServiceType

func (*SubnodeService) UnmarshalJSON

func (v *SubnodeService) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SubnodeService from JSON.

type Telemetry

type Telemetry struct {
	Enabled *bool
	Stdout  *bool
	Export  *HttpListener
	Otlp    *OtlpConfig
	Rules   []*TelemetryRule
}

func (*Telemetry) Copy

func (v *Telemetry) Copy() *Telemetry

Copy returns a copy of the Telemetry.

func (*Telemetry) Equal

func (v *Telemetry) Equal(u *Telemetry) bool

EqualTelemetry returns true if V is equal to U.

func (*Telemetry) MarshalJSON

func (v *Telemetry) MarshalJSON() ([]byte, error)

MarshalBinary marshals the Telemetry to JSON.

func (*Telemetry) UnmarshalJSON

func (v *Telemetry) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Telemetry from JSON.

type TelemetryRule

type TelemetryRule struct {
	Match []string
	Drop  bool
	Rate  encoding.Duration
}

func (*TelemetryRule) Copy

func (v *TelemetryRule) Copy() *TelemetryRule

Copy returns a copy of the TelemetryRule.

func (*TelemetryRule) Equal

func (v *TelemetryRule) Equal(u *TelemetryRule) bool

EqualTelemetryRule returns true if V is equal to U.

func (*TelemetryRule) MarshalJSON

func (v *TelemetryRule) MarshalJSON() ([]byte, error)

MarshalBinary marshals the TelemetryRule to JSON.

func (*TelemetryRule) UnmarshalJSON

func (v *TelemetryRule) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TelemetryRule from JSON.

type TransientPrivateKey

type TransientPrivateKey struct {
	// contains filtered or unexported fields
}

func (*TransientPrivateKey) Copy

Copy returns a copy of the TransientPrivateKey.

func (*TransientPrivateKey) Equal

EqualTransientPrivateKey returns true if V is equal to U.

func (*TransientPrivateKey) MarshalJSON

func (v *TransientPrivateKey) MarshalJSON() ([]byte, error)

MarshalBinary marshals the TransientPrivateKey to JSON.

func (TransientPrivateKey) Type

func (*TransientPrivateKey) UnmarshalJSON

func (v *TransientPrivateKey) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TransientPrivateKey from JSON.

Jump to

Keyboard shortcuts

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