{"modulePath":"github.com/Dijets-Inc/testnet-node","version":"v0.0.0-20230111055708-897bf553f469","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package node\n\n## Types\n\n```go\ntype APIAuthConfig struct {\n\tAPIRequireAuthToken bool   `json:\"apiRequireAuthToken\"`\n\tAPIAuthPassword     string `json:\"-\"`\n}\n```\n\n```go\ntype APIConfig struct {\n\tAPIAuthConfig    `json:\"authConfig\"`\n\tAPIIndexerConfig `json:\"indexerConfig\"`\n\tIPCConfig        `json:\"ipcConfig\"`\n\n\t// Enable/Disable APIs\n\tAdminAPIEnabled    bool `json:\"adminAPIEnabled\"`\n\tInfoAPIEnabled     bool `json:\"infoAPIEnabled\"`\n\tKeystoreAPIEnabled bool `json:\"keystoreAPIEnabled\"`\n\tMetricsAPIEnabled  bool `json:\"metricsAPIEnabled\"`\n\tHealthAPIEnabled   bool `json:\"healthAPIEnabled\"`\n}\n```\n\n```go\ntype APIIndexerConfig struct {\n\tIndexAPIEnabled      bool `json:\"indexAPIEnabled\"`\n\tIndexAllowIncomplete bool `json:\"indexAllowIncomplete\"`\n}\n```\n\n```go\ntype BootstrapConfig struct {\n\t// Should Bootstrap be retried\n\tRetryBootstrap bool `json:\"retryBootstrap\"`\n\n\t// Max number of times to retry bootstrap before warning the node operator\n\tRetryBootstrapWarnFrequency int `json:\"retryBootstrapWarnFrequency\"`\n\n\t// Timeout before emitting a warn log when connecting to bootstrapping beacons\n\tBootstrapBeaconConnectionTimeout time.Duration `json:\"bootstrapBeaconConnectionTimeout\"`\n\n\t// Max number of containers in an ancestors message sent by this node.\n\tBootstrapAncestorsMaxContainersSent int `json:\"bootstrapAncestorsMaxContainersSent\"`\n\n\t// This node will only consider the first [AncestorsMaxContainersReceived]\n\t// containers in an ancestors message it receives.\n\tBootstrapAncestorsMaxContainersReceived int `json:\"bootstrapAncestorsMaxContainersReceived\"`\n\n\t// Max time to spend fetching a container and its\n\t// ancestors while responding to a GetAncestors message\n\tBootstrapMaxTimeGetAncestors time.Duration `json:\"bootstrapMaxTimeGetAncestors\"`\n\n\tBootstrapIDs []ids.NodeID `json:\"bootstrapIDs\"`\n\tBootstrapIPs []ips.IPPort `json:\"bootstrapIPs\"`\n}\n```\n\n```go\ntype Config struct {\n\tHTTPConfig          `json:\"httpConfig\"`\n\tIPConfig            `json:\"ipConfig\"`\n\tStakingConfig       `json:\"stakingConfig\"`\n\tgenesis.TxFeeConfig `json:\"txFeeConfig\"`\n\tStateSyncConfig     `json:\"stateSyncConfig\"`\n\tBootstrapConfig     `json:\"bootstrapConfig\"`\n\tDatabaseConfig      `json:\"databaseConfig\"`\n\n\t// Genesis information\n\tGenesisBytes []byte `json:\"-\"`\n\tDjtxAssetID  ids.ID `json:\"djtxAssetID\"`\n\n\t// ID of the network this node should connect to\n\tNetworkID uint32 `json:\"networkID\"`\n\n\t// Health\n\tHealthCheckFreq time.Duration `json:\"healthCheckFreq\"`\n\n\t// Network configuration\n\tNetworkConfig network.Config `json:\"networkConfig\"`\n\n\tGossipConfig sender.GossipConfig `json:\"gossipConfig\"`\n\n\tAdaptiveTimeoutConfig timer.AdaptiveTimeoutConfig `json:\"adaptiveTimeoutConfig\"`\n\n\t// Benchlist Configuration\n\tBenchlistConfig benchlist.Config `json:\"benchlistConfig\"`\n\n\t// Profiling configurations\n\tProfilerConfig profiler.Config `json:\"profilerConfig\"`\n\n\t// Logging configuration\n\tLoggingConfig logging.Config `json:\"loggingConfig\"`\n\n\t// Plugin directory\n\tPluginDir string `json:\"pluginDir\"`\n\n\t// File Descriptor Limit\n\tFdLimit uint64 `json:\"fdLimit\"`\n\n\t// Consensus configuration\n\tConsensusParams avalanche.Parameters `json:\"consensusParams\"`\n\n\t// Metrics\n\tMeterVMEnabled bool `json:\"meterVMEnabled\"`\n\n\t// Router that is used to handle incoming consensus messages\n\tConsensusRouter          router.Router       `json:\"-\"`\n\tRouterHealthConfig       router.HealthConfig `json:\"routerHealthConfig\"`\n\tConsensusShutdownTimeout time.Duration       `json:\"consensusShutdownTimeout\"`\n\t// Gossip a container in the accepted frontier every [ConsensusGossipFrequency]\n\tConsensusGossipFrequency time.Duration `json:\"consensusGossipFreq\"`\n\n\t// Subnet Whitelist\n\tWhitelistedSubnets set.Set[ids.ID] `json:\"whitelistedSubnets\"`\n\n\t// SubnetConfigs\n\tSubnetConfigs map[ids.ID]chains.SubnetConfig `json:\"subnetConfigs\"`\n\n\t// ChainConfigs\n\tChainConfigs map[string]chains.ChainConfig `json:\"-\"`\n\tChainAliases map[ids.ID][]string           `json:\"chainAliases\"`\n\n\t// VM management\n\tVMManager vms.Manager `json:\"-\"`\n\n\t// Halflife to use for the processing requests tracker.\n\t// Larger halflife --\u003e usage metrics change more slowly.\n\tSystemTrackerProcessingHalflife time.Duration `json:\"systemTrackerProcessingHalflife\"`\n\n\t// Frequency to check the real resource usage of tracked processes.\n\t// More frequent checks --\u003e usage metrics are more accurate, but more\n\t// expensive to track\n\tSystemTrackerFrequency time.Duration `json:\"systemTrackerFrequency\"`\n\n\t// Halflife to use for the cpu tracker.\n\t// Larger halflife --\u003e cpu usage metrics change more slowly.\n\tSystemTrackerCPUHalflife time.Duration `json:\"systemTrackerCPUHalflife\"`\n\n\t// Halflife to use for the disk tracker.\n\t// Larger halflife --\u003e disk usage metrics change more slowly.\n\tSystemTrackerDiskHalflife time.Duration `json:\"systemTrackerDiskHalflife\"`\n\n\tCPUTargeterConfig tracker.TargeterConfig `json:\"cpuTargeterConfig\"`\n\n\tDiskTargeterConfig tracker.TargeterConfig `json:\"diskTargeterConfig\"`\n\n\tRequiredAvailableDiskSpace         uint64 `json:\"requiredAvailableDiskSpace\"`\n\tWarningThresholdAvailableDiskSpace uint64 `json:\"warningThresholdAvailableDiskSpace\"`\n\n\tTraceConfig trace.Config `json:\"traceConfig\"`\n\n\t// See comment on [MinPercentConnectedStakeHealthy] in platformvm.Config\n\tMinPercentConnectedStakeHealthy map[ids.ID]float64 `json:\"minPercentConnectedStakeHealthy\"`\n\n\t// See comment on [UseCurrentHeight] in platformvm.Config\n\tUseCurrentHeight bool `json:\"useCurrentHeight\"`\n\n\t// ProvidedFlags contains all the flags set by the user\n\tProvidedFlags map[string]interface{} `json:\"-\"`\n\n\t// ChainDataDir is the root path for per-chain directories where VMs can\n\t// write arbitrary data.\n\tChainDataDir string `json:\"chainDataDir\"`\n}\n```\nConfig contains all of the configurations of an Avalanche node.\n\n```go\ntype DatabaseConfig struct {\n\t// Path to database\n\tPath string `json:\"path\"`\n\n\t// Name of the database type to use\n\tName string `json:\"name\"`\n\n\t// Path to config file\n\tConfig []byte `json:\"-\"`\n}\n```\n\n```go\ntype HTTPConfig struct {\n\tAPIConfig `json:\"apiConfig\"`\n\tHTTPHost  string `json:\"httpHost\"`\n\tHTTPPort  uint16 `json:\"httpPort\"`\n\n\tHTTPSEnabled bool   `json:\"httpsEnabled\"`\n\tHTTPSKey     []byte `json:\"-\"`\n\tHTTPSCert    []byte `json:\"-\"`\n\n\tAPIAllowedOrigins []string `json:\"apiAllowedOrigins\"`\n\n\tShutdownTimeout time.Duration `json:\"shutdownTimeout\"`\n\tShutdownWait    time.Duration `json:\"shutdownWait\"`\n}\n```\n\n```go\ntype IPCConfig struct {\n\tIPCAPIEnabled      bool     `json:\"ipcAPIEnabled\"`\n\tIPCPath            string   `json:\"ipcPath\"`\n\tIPCDefaultChainIDs []string `json:\"ipcDefaultChainIDs\"`\n}\n```\n\n```go\ntype IPConfig struct {\n\tIPPort           ips.DynamicIPPort `json:\"ip\"`\n\tIPUpdater        dynamicip.Updater `json:\"-\"`\n\tIPResolutionFreq time.Duration     `json:\"ipResolutionFrequency\"`\n\t// True if we attempted NAT traversal\n\tAttemptedNATTraversal bool `json:\"attemptedNATTraversal\"`\n\t// Tries to perform network address translation\n\tNat nat.Router `json:\"-\"`\n}\n```\n\n```go\ntype Node struct {\n\tLog        logging.Logger\n\tLogFactory logging.Factory\n\n\t// This node's unique ID used when communicating with other nodes\n\t// (in consensus, for example)\n\tID ids.NodeID\n\n\t// Storage for this node\n\tDBManager manager.Manager\n\tDB        database.Database\n\n\t// dispatcher for events as they happen in consensus\n\tDecisionAcceptorGroup  snow.AcceptorGroup\n\tConsensusAcceptorGroup snow.AcceptorGroup\n\n\tIPCs *ipcs.ChainIPCs\n\n\tNet network.Network\n\n\t// Handles HTTP API calls\n\tAPIServer server.Server\n\n\t// This node's configuration\n\tConfig *Config\n\n\t// Incremented only once on initialization.\n\t// Decremented when node is done shutting down.\n\tDoneShuttingDown sync.WaitGroup\n\n\t// Metrics Registerer\n\tMetricsRegisterer *prometheus.Registry\n\tMetricsGatherer   metrics.MultiGatherer\n\n\t// VM endpoint registry\n\tVMRegistry registry.VMRegistry\n\t// contains filtered or unexported fields\n}\n```\nNode is an instance of an Avalanche node.\n\n```go\nfunc (n *Node) Dispatch() error\n```\nDispatch starts the node's servers. Returns when the node exits.\n\n```go\nfunc (n *Node) ExitCode() int\n```\n\n```go\nfunc (n *Node) Initialize(\n\tconfig *Config,\n\tlogger logging.Logger,\n\tlogFactory logging.Factory,\n) error\n```\nInitialize this node\n\n```go\nfunc (n *Node) Shutdown(exitCode int)\n```\nShutdown this node May be called multiple times\n\n```go\ntype StakingConfig struct {\n\tgenesis.StakingConfig\n\tEnableStaking         bool            `json:\"enableStaking\"`\n\tStakingTLSCert        tls.Certificate `json:\"-\"`\n\tStakingSigningKey     *bls.SecretKey  `json:\"-\"`\n\tDisabledStakingWeight uint64          `json:\"disabledStakingWeight\"`\n\tStakingKeyPath        string          `json:\"stakingKeyPath\"`\n\tStakingCertPath       string          `json:\"stakingCertPath\"`\n\tStakingSignerPath     string          `json:\"stakingSignerPath\"`\n}\n```\n\n```go\ntype StateSyncConfig struct {\n\tStateSyncIDs []ids.NodeID `json:\"stateSyncIDs\"`\n\tStateSyncIPs []ips.IPPort `json:\"stateSyncIPs\"`\n}\n```\n\n","path":"github.com/Dijets-Inc/testnet-node/node","name":"node","synopsis":"","isRedistributable":true}
