mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 23:14:37 +00:00
service: remove stop method and use contexts (#7292)
This commit is contained in:
+13
-4
@@ -2,6 +2,7 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
abciclient "github.com/tendermint/tendermint/abci/client"
|
||||
@@ -16,8 +17,12 @@ import (
|
||||
// process that host their own process-local tendermint node. This is
|
||||
// equivalent to running tendermint in it's own process communicating
|
||||
// to an external ABCI application.
|
||||
func NewDefault(conf *config.Config, logger log.Logger) (service.Service, error) {
|
||||
return newDefaultNode(conf, logger)
|
||||
func NewDefault(
|
||||
ctx context.Context,
|
||||
conf *config.Config,
|
||||
logger log.Logger,
|
||||
) (service.Service, error) {
|
||||
return newDefaultNode(ctx, conf, logger)
|
||||
}
|
||||
|
||||
// New constructs a tendermint node. The ClientCreator makes it
|
||||
@@ -26,7 +31,9 @@ func NewDefault(conf *config.Config, logger log.Logger) (service.Service, error)
|
||||
// Genesis document: if the value is nil, the genesis document is read
|
||||
// from the file specified in the config, and otherwise the node uses
|
||||
// value of the final argument.
|
||||
func New(conf *config.Config,
|
||||
func New(
|
||||
ctx context.Context,
|
||||
conf *config.Config,
|
||||
logger log.Logger,
|
||||
cf abciclient.Creator,
|
||||
gen *types.GenesisDoc,
|
||||
@@ -51,7 +58,9 @@ func New(conf *config.Config,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return makeNode(conf,
|
||||
return makeNode(
|
||||
ctx,
|
||||
conf,
|
||||
pval,
|
||||
nodeKey,
|
||||
cf,
|
||||
|
||||
Reference in New Issue
Block a user