MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / startNode

Function startNode

test/e2e/node/main.go:122–146  ·  view source on GitHub ↗

startNode starts a Tendermint node running the application directly. It assumes the Tendermint configuration is in $TMHOME/config/tendermint.toml. FIXME There is no way to simply load the configuration from a file, so we need to pull in Viper.

(cfg *Config)

Source from the content-addressed store, hash-verified

120//
121// FIXME There is no way to simply load the configuration from a file, so we need to pull in Viper.
122func startNode(cfg *Config) error {
123 app, err := app.NewApplication(cfg.App())
124 if err != nil {
125 return err
126 }
127
128 tmcfg, nodeLogger, nodeKey, err := setupNode()
129 if err != nil {
130 return fmt.Errorf("failed to setup config: %w", err)
131 }
132
133 n, err := node.NewNode(tmcfg,
134 privval.LoadOrGenFilePV(tmcfg.PrivValidatorKeyFile(), tmcfg.PrivValidatorStateFile()),
135 nodeKey,
136 proxy.NewLocalClientCreator(app),
137 node.DefaultGenesisDocProviderFunc(tmcfg),
138 node.DefaultDBProvider,
139 node.DefaultMetricsProvider(tmcfg.Instrumentation),
140 nodeLogger,
141 )
142 if err != nil {
143 return err
144 }
145 return n.Start()
146}
147
148func startLightClient(cfg *Config) error {
149 tmcfg, nodeLogger, _, err := setupNode()

Callers 1

runFunction · 0.70

Calls 10

NewNodeFunction · 0.92
LoadOrGenFilePVFunction · 0.92
NewLocalClientCreatorFunction · 0.92
DefaultMetricsProviderFunction · 0.92
setupNodeFunction · 0.85
AppMethod · 0.80
PrivValidatorKeyFileMethod · 0.80
StartMethod · 0.65

Tested by

no test coverage detected