params

package
v0.130.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MPL-2.0 Imports: 22 Imported by: 75

Documentation

Index

Constants

View Source
const (
	FleetUndefined  = ""
	FleetProd       = "eth.prod"
	FleetStaging    = "eth.staging"
	FleetTest       = "eth.test"
	FleetWakuV2Prod = "wakuv2.prod"
	FleetWakuV2Test = "wakuv2.test"
	FleetStatusTest = "status.test"
	FleetStatusProd = "status.prod"
)

Define available fleets.

View Source
const (
	// StatusDatabase path relative to DataDir.
	StatusDatabase = "status-db"

	// SendTransactionMethodName defines the name for a giving transaction.
	SendTransactionMethodName = "eth_sendTransaction"

	// AccountsMethodName defines the name for listing the currently signed accounts.
	AccountsMethodName = "eth_accounts"

	// PersonalSignMethodName defines the name for `personal.sign` API.
	PersonalSignMethodName = "personal_sign"

	// PersonalRecoverMethodName defines the name for `personal.recover` API.
	PersonalRecoverMethodName = "personal_ecRecover"

	// DefaultGas default amount of gas used for transactions
	DefaultGas = 180000

	// WhisperMinimumPoW amount of work for Whisper message to be added to sending queue
	// We enforce a minimum as a bland spam prevention mechanism.
	WhisperMinimumPoW = 0.000002

	// WhisperTTL is time to live for messages, in seconds
	WhisperTTL = 120

	// WakuMinimumPoW amount of work for Whisper message to be added to sending queue
	// We enforce a minimum as a bland spam prevention mechanism.
	WakuMinimumPoW = 0.000002

	// WakuTTL is time to live for messages, in seconds
	WakuTTL = 120

	// MainnetEthereumNetworkURL is URL where the upstream ethereum network is loaded to
	// allow us avoid syncing node.
	MainnetEthereumNetworkURL = "https://mainnet.infura.io/nKmXgiFgc2KqtoQ8BCGJ"

	// GoerliEthereumNetworkURL is an open RPC endpoint to Goerli network
	// Other RPC endpoints are available here: http://goerli.blockscout.com/
	GoerliEthereumNetworkURL = "http://goerli.blockscout.com/"

	// MainNetworkID is id of the main network
	MainNetworkID = 1

	// GoerliNetworkID is id of goerli test network (PoA)
	GoerliNetworkID = 5

	// StatusChainNetworkID is id of a test network (private chain)
	StatusChainNetworkID = 777

	// WhisperDiscv5Topic used to register and search for whisper peers using discovery v5.
	WhisperDiscv5Topic = discv5.Topic("whisper")

	// MailServerDiscv5Topic used to register and search for mail server peers using discovery v5.
	MailServerDiscv5Topic = discv5.Topic("whispermail")

	// LESDiscoveryIdentifier is a prefix for topic used for LES peers discovery.
	LESDiscoveryIdentifier = "LES2@"
)

Variables

View Source
var (
	// WhisperDiscv5Limits declares min and max limits for peers with whisper topic.
	WhisperDiscv5Limits = Limits{2, 2}
	// LesDiscoveryLimits default limits used if LES and discovery are enabled.
	LesDiscoveryLimits = Limits{2, 2}
)
View Source
var GitCommit string

GitCommit is a commit hash.

View Source
var IpfsGatewayURL string

IpfsGatewayURL is the Gateway URL to use for IPFS

View Source
var Version string

Version is defined in VERSION file. We set it in loadNodeConfig() in api/backend.go.

Functions

func LesTopic added in v0.13.0

func LesTopic(netid int) string

LesTopic returns discovery v5 topic derived from genesis of the provided network. 1 - mainnet, 5 - goerli

func NewValidator

func NewValidator() *validator.Validate

NewValidator returns a new validator.Validate.

Types

type BridgeConfig added in v0.46.0

type BridgeConfig struct {
	Enabled bool
}

BridgeConfig provides configuration for Whisper-Waku bridge.

type BrowsersConfig added in v0.35.0

type BrowsersConfig struct {
	Enabled bool
}

BrowsersConfig extra configuration for browsers.Service.

type Cluster added in v0.12.0

type Cluster struct {
	StaticNodes     []string `json:"staticnodes"`
	BootNodes       []string `json:"bootnodes"`
	MailServers     []string `json:"mailservers"` // list of trusted mail servers
	RendezvousNodes []string `json:"rendezvousnodes"`
}

Cluster defines a list of Ethereum nodes.

type ClusterConfig

type ClusterConfig struct {
	// Enabled flag specifies that nodes in this configuration are taken into account.
	Enabled bool

	// Fleet is a name of a selected fleet. If it has a value, nodes are loaded
	// from a file, namely `fleet-*.{{ .Fleet }}.json`. Nodes can be added to any list
	// in `ClusterConfig`.
	Fleet string

	// StaticNodes is a list of static nodes.
	StaticNodes []string

	// BootNodes is a list of bootnodes.
	BootNodes []string

	// TrustedMailServers is a list of verified and trusted Mail Server nodes.
	TrustedMailServers []string

	// PushNotificationsServers is a list of default push notification servers.
	PushNotificationsServers []string

	// RendezvousNodes is a list rendezvous discovery nodes.
	RendezvousNodes []string

	// WakuNodes is a list of waku2 multiaddresses
	WakuNodes []string

	// DiscV5Nodes is a list of enr to be used for ambient discovery
	DiscV5BootstrapNodes []string
}

ClusterConfig holds configuration for supporting cluster peers, which is a temporary means for mobile devices to get connected to Ethereum network (UDP-based discovery may not be available, so we need means to discover the network manually).

func LoadClusterConfigFromFleet added in v0.79.0

func LoadClusterConfigFromFleet(fleet string) (*ClusterConfig, error)

func (*ClusterConfig) String

func (c *ClusterConfig) String() string

String dumps config object as nicely indented JSON

func (*ClusterConfig) Validate added in v0.15.0

func (c *ClusterConfig) Validate(validate *validator.Validate) error

Validate validates the ClusterConfig struct and returns an error if inconsistent values are found

type DatabaseConfig added in v0.35.0

type DatabaseConfig struct {
	PGConfig PGConfig
}

type LightEthConfig

type LightEthConfig struct {
	// Enabled flag specifies whether protocol is enabled
	Enabled bool

	// DatabaseCache is memory (in MBs) allocated to internal caching (min 16MB / database forced)
	DatabaseCache int

	// TrustedNodes is a list of trusted servers
	TrustedNodes []string

	//MinTrustedFraction is minimum percentage of connected trusted servers to validate header(1-100)
	MinTrustedFraction int
}

LightEthConfig holds LES-related configuration Status nodes are always lightweight clients (due to mobile platform constraints)

func (*LightEthConfig) Validate added in v0.15.0

func (c *LightEthConfig) Validate(validate *validator.Validate) error

Validate validates the LightEthConfig struct and returns an error if inconsistent values are found

type Limits

type Limits struct {
	Min, Max int
}

Limits represent min and max amount of peers

func NewLimits

func NewLimits(min, max int) Limits

NewLimits creates new Limits config with given min and max values.

type LocalNotificationsConfig added in v0.62.16

type LocalNotificationsConfig struct {
	Enabled bool
}

LocalNotificationsConfig extra configuration for localnotifications.Service.

type MailserversConfig added in v0.35.0

type MailserversConfig struct {
	Enabled bool
}

MailserversConfig extra configuration for mailservers.Service.

type Network added in v0.93.2

type Network struct {
	ChainID                uint64          `json:"chainId"`
	ChainName              string          `json:"chainName"`
	RPCURL                 string          `json:"rpcUrl"`
	BlockExplorerURL       string          `json:"blockExplorerUrl,omitempty"`
	IconURL                string          `json:"iconUrl,omitempty"`
	NativeCurrencyName     string          `json:"nativeCurrencyName,omitempty"`
	NativeCurrencySymbol   string          `json:"nativeCurrencySymbol,omitempty"`
	NativeCurrencyDecimals uint64          `json:"nativeCurrencyDecimals"`
	IsTest                 bool            `json:"isTest"`
	Layer                  uint64          `json:"layer"`
	Enabled                bool            `json:"enabled"`
	ChainColor             string          `json:"chainColor"`
	ShortName              string          `json:"shortName"`
	TokenOverrides         []TokenOverride `json:"tokenOverrides"`
}

type NodeConfig

type NodeConfig struct {
	// NetworkID sets network to use for selecting peers to connect to
	NetworkID uint64 `json:"NetworkId" validate:"required"`

	RootDataDir string `json:"-"`

	// DataDir is the file system folder the node should use for any data storage needs.
	DataDir string `validate:"required"`

	// KeyStoreDir is the file system folder that contains private keys.
	KeyStoreDir string `validate:"required"`

	// NodeKey is the hex-encoded node ID (private key). Should be a valid secp256k1 private key that will be used for both
	// remote peer identification as well as network traffic encryption.
	NodeKey string

	// NoDiscovery set to true will disable discovery protocol.
	NoDiscovery bool

	// Rendezvous enables discovery protocol.
	Rendezvous bool

	// ListenAddr is an IP address and port of this node (e.g. 127.0.0.1:30303).
	ListenAddr string

	// AdvertiseAddr is a public IP address the node wants to be found with.
	// It is especially useful when using floating IPs attached to a server.
	// This configuration value is used by rendezvous protocol, and it's optional
	// If no value is specified, it will attempt to determine the node's external
	// IP address. A value can be specified in case the returned address is incorrect
	AdvertiseAddr string

	// Name sets the instance name of the node. It must not contain the / character.
	Name string `validate:"excludes=/"`

	// Version exposes program's version. It is used in the devp2p node identifier.
	Version string

	// APIModules is a comma-separated list of API modules exposed via *any* (HTTP/WS/IPC) RPC interface.
	APIModules string `validate:"required"`

	// HTTPEnabled specifies whether the http RPC server is to be enabled by default.
	HTTPEnabled bool

	// HTTPHost is the host interface on which to start the HTTP RPC server.
	// Pass empty string if no HTTP RPC interface needs to be started.
	HTTPHost string

	// HTTPPort is the TCP port number on which to start the Geth's HTTP RPC server.
	HTTPPort int

	// HTTPVirtualHosts is the list of virtual hostnames which are allowed on incoming requests.
	// This is by default {'localhost'}. Using this prevents attacks like
	// DNS rebinding, which bypasses SOP by simply masquerading as being within the same
	// origin. These attacks do not utilize CORS, since they are not cross-domain.
	// By explicitly checking the Host-header, the server will not allow requests
	// made against the server with a malicious host domain.
	// Requests using an IP address directly are not affected.
	HTTPVirtualHosts []string

	// HTTPCors is the Cross-Origin Resource Sharing header to send to requesting
	// clients. Please be aware that CORS is a browser enforced security, it's fully
	// useless for custom HTTP clients.
	HTTPCors []string

	// IPCEnabled specifies whether IPC-RPC Server is enabled or not
	IPCEnabled bool

	// IPCFile is filename of exposed IPC RPC Server
	IPCFile string

	// TLSEnabled specifies whether TLS support should be enabled on node or not
	// TLS support is only planned in go-ethereum, so we are using our own patch.
	TLSEnabled bool

	// MaxPeers is the maximum number of (global) peers that can be connected.
	// Set to zero, if only static or trusted peers are allowed to connect.
	MaxPeers int

	// MaxPendingPeers is the maximum number of peers that can be pending in the
	// handshake phase, counted separately for inbound and outbound connections.
	MaxPendingPeers int

	// LogEnabled enables the logger
	LogEnabled bool `json:"LogEnabled"`

	// LogMobileSystem enables log redirection to android/ios system logger.
	LogMobileSystem bool

	// LogFile is a folder which contains LogFile
	LogDir string

	// LogFile is filename where exposed logs get written to
	LogFile string

	// LogLevel defines minimum log level. Valid names are "ERROR", "WARN", "INFO", "DEBUG", and "TRACE".
	LogLevel string `validate:"eq=ERROR|eq=WARN|eq=INFO|eq=DEBUG|eq=TRACE"`

	// LogMaxBackups defines number of rotated log files that will be stored.
	LogMaxBackups int

	// LogMaxSize in megabytes after current size is reached log file will be rotated.
	LogMaxSize int

	// LogCompressRotated if true all rotated files will be gzipped.
	LogCompressRotated bool

	// LogToStderr defines whether logged info should also be output to os.Stderr
	LogToStderr bool

	// EnableStatusService should be true to enable methods under status namespace.
	EnableStatusService bool

	// EnableNTPSync enables NTP synchronizations
	EnableNTPSync bool

	// UpstreamConfig extra config for providing upstream infura server.
	UpstreamConfig UpstreamRPCConfig `json:"UpstreamConfig"`

	// Initial networks to load
	Networks []Network

	// ClusterConfig extra configuration for supporting cluster peers.
	ClusterConfig ClusterConfig `json:"ClusterConfig," validate:"structonly"`

	// LightEthConfig extra configuration for LES
	LightEthConfig LightEthConfig `json:"LightEthConfig," validate:"structonly"`

	// WakuConfig provides a configuration for Waku subprotocol.
	WakuConfig WakuConfig `json:"WakuConfig" validate:"structonly"`

	// WakuV2Config provides a configuration for WakuV2 protocol.
	WakuV2Config WakuV2Config `json:"WakuV2Config" validate:"structonly"`

	// BridgeConfig provides a configuration for Whisper-Waku bridge.
	BridgeConfig BridgeConfig `json:"BridgeConfig" validate:"structonly"`

	// ShhextConfig extra configuration for service running under shhext namespace.
	ShhextConfig ShhextConfig `json:"ShhextConfig," validate:"structonly"`

	// WalletConfig extra configuration for wallet.Service.
	WalletConfig WalletConfig

	// WalleLocalNotificationsConfig extra configuration for localnotifications.Service.
	LocalNotificationsConfig LocalNotificationsConfig

	// BrowsersConfig extra configuration for browsers.Service.
	BrowsersConfig BrowsersConfig

	// PermissionsConfig extra configuration for permissions.Service.
	PermissionsConfig PermissionsConfig

	// MailserversConfig extra configuration for mailservers.Service
	// (persistent storage of user's mailserver records).
	MailserversConfig MailserversConfig

	// Web3ProviderConfig extra configuration for provider.Service
	// (desktop provider API)
	Web3ProviderConfig Web3ProviderConfig

	// SwarmConfig extra configuration for Swarm and ENS
	SwarmConfig SwarmConfig `json:"SwarmConfig," validate:"structonly"`

	TorrentConfig TorrentConfig

	// RegisterTopics a list of specific topics where the peer wants to be
	// discoverable.
	RegisterTopics []discv5.Topic `json:"RegisterTopics"`

	// RequiredTopics list of topics where a client wants to search for
	// discoverable peers with the discovery limits.
	RequireTopics map[discv5.Topic]Limits `json:"RequireTopics"`

	// MailServerRegistryAddress is the MailServerRegistry contract address
	MailServerRegistryAddress string

	// PushNotificationServerConfig is the config for the push notification server
	PushNotificationServerConfig pushnotificationserver.Config `json:"PushNotificationServerConfig"`

	OutputMessageCSVEnabled bool
	// contains filtered or unexported fields
}

NodeConfig stores configuration options for a node

func NewConfigFromJSON added in v0.15.0

func NewConfigFromJSON(configJSON string) (*NodeConfig, error)

NewConfigFromJSON parses incoming JSON and returned it as Config

func NewNodeConfig

func NewNodeConfig(dataDir string, networkID uint64) (*NodeConfig, error)

NewNodeConfig creates new node configuration object with bare-minimum defaults. Important: the returned config is not validated.

func NewNodeConfigWithDefaults added in v0.15.0

func NewNodeConfigWithDefaults(dataDir string, networkID uint64, opts ...Option) (*NodeConfig, error)

NewNodeConfigWithDefaults creates new node configuration object with some defaults suitable for adhoc use.

func NewNodeConfigWithDefaultsAndFiles added in v0.15.1

func NewNodeConfigWithDefaultsAndFiles(
	dataDir string, networkID uint64, opts []Option, files []string,
) (*NodeConfig, error)

NewNodeConfigWithDefaultsAndFiles creates new node configuration object with some defaults suitable for adhoc use and applies config files on top.

func (*NodeConfig) AddAPIModule

func (c *NodeConfig) AddAPIModule(m string)

AddAPIModule adds a mobule to APIModules

func (*NodeConfig) FormatAPIModules

func (c *NodeConfig) FormatAPIModules() []string

FormatAPIModules returns a slice of APIModules.

func (*NodeConfig) Save

func (c *NodeConfig) Save() error

Save dumps configuration to the disk

func (*NodeConfig) String

func (c *NodeConfig) String() string

String dumps config object as nicely indented JSON

func (*NodeConfig) UpdateWithDefaults added in v0.59.0

func (c *NodeConfig) UpdateWithDefaults() error

UpdateWithDefaults updates config with missing default values, as the config is only generated once and is thereafter pulled from the database. The way it is stored in the database makes this step necessary as it's stored as a blob and can't be easily migrated.

func (*NodeConfig) Validate

func (c *NodeConfig) Validate() error

Validate checks if NodeConfig fields have valid values.

It returns nil if there are no errors, otherwise one or more errors can be returned. Multiple errors are joined with a new line.

A single error for a struct:

type TestStruct struct {
    TestField string `validate:"required"`
}

has the following format:

Key: 'TestStruct.TestField' Error:Field validation for 'TestField' failed on the 'required' tag

type Option added in v0.15.1

type Option func(*NodeConfig) error

Option is an additional setting when creating a NodeConfig using NewNodeConfigWithDefaults.

func WithFleet added in v0.15.1

func WithFleet(fleet string) Option

WithFleet loads one of the preconfigured Status fleets.

func WithLES added in v0.15.1

func WithLES() Option

WithLES enabled LES protocol.

func WithMailserver added in v0.15.1

func WithMailserver() Option

WithMailserver enables MailServer.

type PGConfig added in v0.35.0

type PGConfig struct {
	// Enabled whether we should use a Postgres instance
	Enabled bool
	// The URI of the server
	URI string
}

type PermissionsConfig added in v0.35.0

type PermissionsConfig struct {
	Enabled bool
}

PermissionsConfig extra configuration for permissions.Service.

type PushNotificationServer added in v0.98.5

type PushNotificationServer struct {
	*ecdsa.PublicKey
}

func (*PushNotificationServer) MarshalText added in v0.98.5

func (p *PushNotificationServer) MarshalText() ([]byte, error)

func (*PushNotificationServer) UnmarshalText added in v0.98.5

func (p *PushNotificationServer) UnmarshalText(data []byte) error

type ShhextConfig added in v0.35.0

type ShhextConfig struct {
	PFSEnabled bool
	// BackupDisabledDataDir is the file system folder the node should use for any data storage needs that it doesn't want backed up.
	BackupDisabledDataDir string
	// InstallationId id of the current installation
	InstallationID string
	// MailServerConfirmations should be true if client wants to receive confirmatons only from a selected mail servers.
	MailServerConfirmations bool
	// EnableConnectionManager turns on management of the mail server connections if true.
	EnableConnectionManager bool
	// EnableLastUsedMonitor guarantees that last used mail server will be tracked and persisted into the storage.
	EnableLastUsedMonitor bool
	// ConnectionTarget will be used by connection manager. It will ensure that we connected with configured number of servers.
	ConnectionTarget int
	// RequestsDelay used to ensure that no similar requests are sent within short periods of time.
	RequestsDelay time.Duration
	// MaxServerFailures defines maximum allowed expired requests before server will be swapped to another one.
	MaxServerFailures int

	// MaxMessageDeliveryAttempts defines how many times we will try to deliver not-acknowledged envelopes.
	MaxMessageDeliveryAttempts int

	// WhisperCacheDir is a folder where whisper filters may persist messages before delivering them
	// to a client.
	WhisperCacheDir string

	// DisableGenericDiscoveryTopic indicates whether we should be listening on the old discovery
	DisableGenericDiscoveryTopic bool

	// SendV1Messages indicates whether we should be sending v1-compatible only messages
	SendV1Messages bool

	// DatasyncEnabled indicates whether we should enable dataasync
	DataSyncEnabled bool

	// VerifyTransactionURL is the URL for verifying transactions.
	// IMPORTANT: It should always be mainnet unless used for testing
	VerifyTransactionURL string

	// VerifyENSURL is the URL for verifying ens names.
	// IMPORTANT: It should always be mainnet unless used for testing
	VerifyENSURL string

	// VerifyENSContractAddress is the address of the contract used to verify ENS
	// No default is provided and if not set ENS resolution is disabled
	VerifyENSContractAddress string

	VerifyTransactionChainID int64

	// DefaultPushNotificationsServers is the default-status run push notification servers
	DefaultPushNotificationsServers []*PushNotificationServer

	// AnonMetricsSendID is the public key used by a metrics node to decrypt metrics protobufs
	AnonMetricsSendID string

	// AnonMetricsServerEnabled indicates whether or not the
	AnonMetricsServerEnabled bool

	// AnonMetricsServerPostgresURI is the uri used to connect to a postgres db
	AnonMetricsServerPostgresURI string

	// BandwidthStatsEnabled indicates if a signal is going to be emitted to indicate the upload and download rate
	BandwidthStatsEnabled bool
}

ShhextConfig defines options used by shhext service.

func (*ShhextConfig) Validate added in v0.35.0

func (c *ShhextConfig) Validate(validate *validator.Validate) error

Validate validates the ShhextConfig struct and returns an error if inconsistent values are found

type SwarmConfig

type SwarmConfig struct {
	// Enabled flag specifies whether protocol is enabled
	Enabled bool
}

SwarmConfig holds Swarm-related configuration

func (*SwarmConfig) String

func (c *SwarmConfig) String() string

String dumps config object as nicely indented JSON

func (*SwarmConfig) Validate added in v0.15.0

func (c *SwarmConfig) Validate(validate *validator.Validate) error

Validate validates the SwarmConfig struct and returns an error if inconsistent values are found

type TokenOverride added in v0.109.1

type TokenOverride struct {
	Symbol  string         `json:"symbol"`
	Address common.Address `json:"address"`
}

type TorrentConfig added in v0.96.2

type TorrentConfig struct {
	// Enabled set to true enables Community History Archive protocol
	Enabled bool
	// Port number which the BitTorrent client will listen to for conntections
	Port int
	// DataDir is the file system folder Status should use for message archive torrent data.
	DataDir string
	// TorrentDir is the file system folder Status should use for storing torrent metadata files.
	TorrentDir string
}

TorrentConfig provides configuration for the BitTorrent client used for message history archives.

func (*TorrentConfig) Validate added in v0.96.2

func (c *TorrentConfig) Validate(validate *validator.Validate) error

type UpstreamRPCConfig

type UpstreamRPCConfig struct {
	// Enabled flag specifies whether feature is enabled
	Enabled bool

	// URL sets the rpc upstream host address for communication with
	// a non-local infura endpoint.
	URL string
}

UpstreamRPCConfig stores configuration for upstream rpc connection.

func (*UpstreamRPCConfig) Validate added in v0.15.0

func (c *UpstreamRPCConfig) Validate(validate *validator.Validate) error

Validate validates the UpstreamRPCConfig struct and returns an error if inconsistent values are found

type WakuConfig added in v0.39.0

type WakuConfig struct {
	// Enabled set to true enables Waku subprotocol.
	Enabled bool

	// LightClient should be true if the node should start with an empty bloom filter and not forward messages from other nodes
	LightClient bool

	// FullNode should be true if waku should always acta as a full node
	FullNode bool

	// EnableMailServer is mode when node is capable of delivering expired messages on demand
	EnableMailServer bool

	// DataDir is the file system folder Waku should use for any data storage needs.
	// For instance, MailServer will use this directory to store its data.
	DataDir string

	// MinimumPoW minimum PoW for Waku messages
	// We enforce a minimum as a bland spam prevention mechanism.
	MinimumPoW float64

	// MailServerPassword for symmetric encryption of waku message history requests.
	// (if no account file selected, then this password is used for symmetric encryption).
	MailServerPassword string

	// MailServerRateLimit minimum time between queries to mail server per peer.
	MailServerRateLimit int

	// MailServerDataRetention is a number of days data should be stored by MailServer.
	MailServerDataRetention int

	// TTL time to live for messages, in seconds
	TTL int

	// MaxMessageSize is a maximum size of a devp2p packet handled by the Waku protocol,
	// not only the size of envelopes sent in that packet.
	MaxMessageSize uint32

	// DatabaseConfig is configuration for which data store we use.
	DatabaseConfig DatabaseConfig

	// EnableRateLimiter set to true enables IP and peer ID rate limiting.
	EnableRateLimiter bool

	// PacketRateLimitIP sets the limit on the number of packets per second
	// from a given IP.
	PacketRateLimitIP int64

	// PacketRateLimitPeerID sets the limit on the number of packets per second
	// from a given peer ID.
	PacketRateLimitPeerID int64

	// BytesRateLimitIP sets the limit on the number of bytes per second
	// from a given IP.
	BytesRateLimitIP int64

	// BytesRateLimitPeerID sets the limit on the number of bytes per second
	// from a given peer ID.
	BytesRateLimitPeerID int64

	// RateLimitTolerance is a number of how many a limit must be exceeded
	// in order to drop a peer.
	// If equal to 0, the peers are never dropped.
	RateLimitTolerance int64

	// BloomFilterMode tells us whether we should be sending a bloom
	// filter rather than TopicInterest
	BloomFilterMode bool

	// SoftBlacklistedPeerIDs is a list of peer ids that should be soft-blacklisted (messages should be dropped but connection kept)
	SoftBlacklistedPeerIDs []string

	// EnableConfirmations when true, instructs that confirmation should be sent for received messages
	EnableConfirmations bool
}

WakuConfig provides a configuration for Waku service.

type WakuV2Config added in v0.80.2

type WakuV2Config struct {
	// Enabled set to true enables Waku subprotocol.
	Enabled bool

	// Host interface in which to start libp2p protocol
	Host string

	// Port number in which to start libp2p protocol (0 for random)
	Port int

	// Interval of time in seconds to send a ping to peers to keep the connection to them alive
	KeepAliveInterval int

	// LightClient should be true if the node will not relay messages and only rely on lightpush/filter nodes
	LightClient bool

	// FullNode should be true if waku should always acta as a full node
	FullNode bool

	// DiscoveryLimit indicates the maximum number of peers to discover
	DiscoveryLimit int

	// DataDir is the file system folder Waku should use for any data storage needs.
	// For instance, MailServer will use this directory to store its data.
	DataDir string

	// MaxMessageSize is a maximum size of a devp2p packet handled by the Waku protocol,
	// not only the size of envelopes sent in that packet.
	MaxMessageSize uint32

	// EnableConfirmations when true, instructs that confirmation should be sent for received messages
	EnableConfirmations bool

	// A name->libp2p_addr map for Wakuv2 custom nodes
	CustomNodes map[string]string

	// PeerExchange determines whether WakuV2 Peer Exchange is enabled or not
	PeerExchange bool

	// Nameserver determines which nameserver will be used for dns discovery
	Nameserver string

	// EnableDiscV5 indicates if DiscoveryV5 is enabled or not
	EnableDiscV5 bool

	// UDPPort number to start discovery v5
	UDPPort int

	// AutoUpdate instructs the node to update their own ip address and port with the values seen by other nodes
	AutoUpdate bool

	// EnableStore indicates if WakuStore protocol should be enabled or not
	EnableStore bool

	// StoreCapacity indicates the max number of messages to store
	StoreCapacity int

	// StoreSeconds indicates the maximum number of seconds before a message is removed from the store
	StoreSeconds int
}

WakuConfig provides a configuration for Waku service.

type WalletConfig added in v0.35.0

type WalletConfig struct {
	Enabled       bool
	OpenseaAPIKey string `json:"OpenseaAPIKey"`
}

WalletConfig extra configuration for wallet.Service.

type Web3ProviderConfig added in v0.92.6

type Web3ProviderConfig struct {
	Enabled bool
}

ProviderConfig extra configuration for provider.Service

Jump to

Keyboard shortcuts

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