mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
concurrent shutdown
This commit is contained in:
@@ -37,3 +37,11 @@ The chain's rpc can be found at http://localhost:46657.
|
||||
The netmon expects a config file with a list of chains/validators to get started. A default one for a local chain is provided as local-chain.json. `netmon config` can be used to create a config file for a chain deployed with `mintnet`.
|
||||
|
||||
The API is available as GET requests with URI encoded parameters, or as JSONRPC POST requests. The JSONRPC methods are also exposed over websocket.
|
||||
|
||||
# TODO
|
||||
|
||||
- log metrics for charts
|
||||
- mintnet rpc commands
|
||||
- chain size
|
||||
- val set changes
|
||||
- more efficient locking / refactor for a big select loop
|
||||
|
@@ -49,11 +49,17 @@ func NewTendermintNetwork() *TendermintNetwork {
|
||||
func (tn *TendermintNetwork) Stop() {
|
||||
tn.mtx.Lock()
|
||||
defer tn.mtx.Unlock()
|
||||
wg := new(sync.WaitGroup)
|
||||
for _, c := range tn.Chains {
|
||||
for _, v := range c.Config.Validators {
|
||||
v.Stop()
|
||||
wg.Add(1)
|
||||
go func(val *types.ValidatorState) {
|
||||
val.Stop()
|
||||
wg.Done()
|
||||
}(v)
|
||||
}
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
@@ -69,7 +69,7 @@ func (vs *ValidatorState) Start() error {
|
||||
vs.Config.mtx.Unlock()
|
||||
|
||||
em := eventmeter.NewEventMeter(fmt.Sprintf("ws://%s/websocket", rpcAddr), UnmarshalEvent)
|
||||
if err := em.Start(); err != nil {
|
||||
if _, err := em.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
vs.em = em
|
||||
|
Reference in New Issue
Block a user