service: remove stop method and use contexts (#7292)

This commit is contained in:
Sam Kleinman
2021-11-18 17:56:21 -05:00
committed by GitHub
parent 1c34d17240
commit 6ab62fe7b6
115 changed files with 3613 additions and 2271 deletions
+13 -4
View File
@@ -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,