DefaultNewNode returns a Tendermint node with default settings for the PrivValidator, ClientCreator, GenesisDoc, and DBProvider. It implements NodeProvider.
(config *cfg.Config, logger log.Logger, misbehaviors map[int64]cs.Misbehavior)
| 126 | // PrivValidator, ClientCreator, GenesisDoc, and DBProvider. |
| 127 | // It implements NodeProvider. |
| 128 | func DefaultNewNode(config *cfg.Config, logger log.Logger, misbehaviors map[int64]cs.Misbehavior) (*Node, error) { |
| 129 | nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) |
| 130 | if err != nil { |
| 131 | return nil, fmt.Errorf("failed to load or gen node key %s, err: %w", config.NodeKeyFile(), err) |
| 132 | } |
| 133 | |
| 134 | return NewNode(config, |
| 135 | LoadOrGenFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()), |
| 136 | nodeKey, |
| 137 | proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir()), |
| 138 | DefaultGenesisDocProviderFunc(config), |
| 139 | DefaultDBProvider, |
| 140 | DefaultMetricsProvider(config.Instrumentation), |
| 141 | logger, |
| 142 | misbehaviors, |
| 143 | ) |
| 144 | } |
| 145 | |
| 146 | // MetricsProvider returns a consensus, p2p and mempool Metrics. |
| 147 | type MetricsProvider func(chainID string) (*consensus.Metrics, *p2p.Metrics, *mempl.Metrics, *sm.Metrics) |
nothing calls this directly
no test coverage detected