cmd

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 28 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

func GetAddrsToListenOn

func GetAddrsToListenOn(protocolPort uint16) ([]net.TCPAddr, []net.Listener)

func Run

func Run(cmd *cobra.Command, args []string)

func SetupRunFlags

func SetupRunFlags(cmd *cobra.Command)

Types

type Config

type Config struct {
	// Core
	Params               *lib.DeSoParams
	ProtocolPort         uint16
	DataDirectory        string
	MempoolDumpDirectory string
	TXIndex              bool
	Regtest              bool
	PostgresURI          string

	// Peers
	ConnectIPs          []string
	AddIPs              []string
	AddSeeds            []string
	TargetOutboundPeers uint32
	StallTimeoutSeconds uint64

	// Peer Restrictions
	PrivateMode       bool
	ReadOnlyMode      bool
	DisableNetworking bool
	IgnoreInboundInvs bool
	MaxInboundPeers   uint32
	OneInboundPerIp   bool

	// Snapshot
	HyperSync                 bool
	ForceChecksum             bool
	SyncType                  lib.NodeSyncType
	MaxSyncBlockHeight        uint32
	SnapshotBlockHeightPeriod uint64
	DisableEncoderMigrations  bool

	// Mining
	MinerPublicKeys  []string
	NumMiningThreads uint64

	// Fees
	RateLimitFeerate uint64
	MinFeerate       uint64

	// BlockProducer
	MaxBlockTemplatesCache          uint64
	MinBlockUpdateInterval          uint64
	BlockCypherAPIKey               string
	BlockProducerSeed               string
	TrustedBlockProducerPublicKeys  []string
	TrustedBlockProducerStartHeight uint64

	// Logging
	LogDirectory          string
	GlogV                 uint64
	GlogVmodule           string
	LogDBSummarySnapshots bool
	DatadogProfiler       bool
	TimeEvents            bool
}

func LoadConfig

func LoadConfig() *Config

func (*Config) Print

func (config *Config) Print()

type Node

type Node struct {
	Server   *lib.Server
	ChainDB  *badger.DB
	TXIndex  *lib.TXIndex
	Params   *lib.DeSoParams
	Config   *Config
	Postgres *lib.Postgres

	// IsRunning is false when a NewNode is created, set to true on Start(), set to false
	// after Stop() is called. Mainly used in testing.
	IsRunning bool
	// contains filtered or unexported fields
}

func NewNode

func NewNode(config *Config) *Node

func (*Node) Start

func (node *Node) Start(exitChannels ...*chan struct{})

Start is the main function used to kick off the node. The exitChannels are optionally passed by the caller to receive signals from the node. In particular, exitChannels will be closed by the node when the node is shutting down for good.

func (*Node) Stop

func (node *Node) Stop()

Jump to

Keyboard shortcuts

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