2017-05-16 12:09:52 +00:00
|
|
|
package node_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/accounts"
|
|
|
|
"github.com/ethereum/go-ethereum/les"
|
|
|
|
gethnode "github.com/ethereum/go-ethereum/node"
|
|
|
|
"github.com/ethereum/go-ethereum/rpc"
|
2018-06-08 11:29:50 +00:00
|
|
|
"github.com/status-im/status-go/node"
|
|
|
|
"github.com/status-im/status-go/params"
|
2019-12-09 10:06:04 +00:00
|
|
|
"github.com/status-im/status-go/whisper"
|
2018-02-09 13:37:56 +00:00
|
|
|
|
2018-04-18 15:13:27 +00:00
|
|
|
"github.com/status-im/status-go/t/e2e"
|
2018-02-08 12:52:47 +00:00
|
|
|
. "github.com/status-im/status-go/t/utils"
|
2017-05-16 12:09:52 +00:00
|
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestManagerTestSuite(t *testing.T) {
|
2019-10-04 15:21:24 +00:00
|
|
|
e2e.Init()
|
2017-05-16 12:09:52 +00:00
|
|
|
suite.Run(t, new(ManagerTestSuite))
|
|
|
|
}
|
|
|
|
|
|
|
|
type ManagerTestSuite struct {
|
2018-04-05 09:45:26 +00:00
|
|
|
e2e.StatusNodeTestSuite
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *ManagerTestSuite) SetupTest() {
|
2018-04-05 09:45:26 +00:00
|
|
|
s.StatusNode = node.New()
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
|
|
|
|
2017-10-11 14:20:51 +00:00
|
|
|
func (s *ManagerTestSuite) TestReferencesWithoutStartedNode() {
|
|
|
|
var testCases = []struct {
|
2017-05-16 12:09:52 +00:00
|
|
|
name string
|
|
|
|
initFn func() (interface{}, error)
|
|
|
|
expectedErr error
|
|
|
|
}{
|
2017-05-25 13:14:52 +00:00
|
|
|
{
|
|
|
|
"non-null manager, no running node, AddPeer()",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return nil, s.StatusNode.AddPeer("enode://da3bf389a031f33fb55c9f5f54fde8473912402d27fffaa50efd74c0d0515f3a61daf6d52151f2876b19c15828e6f670352bff432b5ec457652e74755e8c864f@51.15.62.116:30303")
|
2017-05-25 13:14:52 +00:00
|
|
|
},
|
|
|
|
node.ErrNoRunningNode,
|
|
|
|
},
|
2017-05-16 12:09:52 +00:00
|
|
|
{
|
|
|
|
"non-null manager, no running node, get NodeConfig",
|
|
|
|
func() (interface{}, error) {
|
2018-04-16 12:36:09 +00:00
|
|
|
return s.StatusNode.Config(), nil
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
2018-04-16 12:36:09 +00:00
|
|
|
nil,
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"non-null manager, no running node, get Node",
|
|
|
|
func() (interface{}, error) {
|
2018-04-16 12:36:09 +00:00
|
|
|
return s.StatusNode.GethNode(), nil
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
2018-04-16 12:36:09 +00:00
|
|
|
nil,
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"non-null manager, no running node, get LES",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.LightEthereumService()
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
node.ErrNoRunningNode,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"non-null manager, no running node, get Whisper",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.WhisperService()
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
node.ErrNoRunningNode,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"non-null manager, no running node, get RPC Client",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.RPCClient(), nil
|
2017-05-28 13:57:30 +00:00
|
|
|
},
|
2017-09-19 11:40:43 +00:00
|
|
|
nil,
|
2017-05-28 13:57:30 +00:00
|
|
|
},
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
2017-10-11 14:20:51 +00:00
|
|
|
for _, tc := range testCases {
|
|
|
|
s.T().Log(tc.name)
|
|
|
|
obj, err := tc.initFn()
|
2017-05-16 12:09:52 +00:00
|
|
|
s.Nil(obj)
|
2017-10-11 14:20:51 +00:00
|
|
|
s.Equal(tc.expectedErr, err)
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
2017-10-11 14:20:51 +00:00
|
|
|
}
|
2017-05-16 12:09:52 +00:00
|
|
|
|
2017-10-11 14:20:51 +00:00
|
|
|
func (s *ManagerTestSuite) TestReferencesWithStartedNode() {
|
2017-10-23 16:03:07 +00:00
|
|
|
s.StartTestNode()
|
2017-11-07 17:43:49 +00:00
|
|
|
defer func() {
|
|
|
|
time.Sleep(100 * time.Millisecond)
|
|
|
|
s.StopTestNode()
|
|
|
|
}()
|
2017-10-11 14:20:51 +00:00
|
|
|
|
|
|
|
var testCases = []struct {
|
2017-05-16 12:09:52 +00:00
|
|
|
name string
|
|
|
|
initFn func() (interface{}, error)
|
|
|
|
expectedType interface{}
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
"node is running, get NodeConfig",
|
|
|
|
func() (interface{}, error) {
|
2018-04-16 12:36:09 +00:00
|
|
|
return s.StatusNode.Config(), nil
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
¶ms.NodeConfig{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"node is running, get Node",
|
|
|
|
func() (interface{}, error) {
|
2018-04-16 12:36:09 +00:00
|
|
|
return s.StatusNode.GethNode(), nil
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
&gethnode.Node{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"node is running, get LES",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.LightEthereumService()
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
&les.LightEthereum{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"node is running, get Whisper",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.WhisperService()
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
&whisper.Whisper{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"node is running, get AccountManager",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.AccountManager()
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
&accounts.Manager{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"node is running, get RPC Client",
|
|
|
|
func() (interface{}, error) {
|
2018-04-05 09:45:26 +00:00
|
|
|
return s.StatusNode.RPCClient(), nil
|
2017-05-16 12:09:52 +00:00
|
|
|
},
|
|
|
|
&rpc.Client{},
|
|
|
|
},
|
|
|
|
}
|
2017-10-11 14:20:51 +00:00
|
|
|
for _, tc := range testCases {
|
|
|
|
s.T().Log(tc.name)
|
|
|
|
obj, err := tc.initFn()
|
2017-05-16 12:09:52 +00:00
|
|
|
s.NoError(err)
|
|
|
|
s.NotNil(obj)
|
2017-10-11 14:20:51 +00:00
|
|
|
s.IsType(tc.expectedType, obj)
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *ManagerTestSuite) TestNodeStartStop() {
|
2018-03-02 09:25:30 +00:00
|
|
|
nodeConfig, err := MakeTestNodeConfig(GetNetworkID())
|
2017-10-11 14:20:51 +00:00
|
|
|
s.NoError(err)
|
2017-05-16 12:09:52 +00:00
|
|
|
|
|
|
|
// try stopping non-started node
|
2018-04-05 09:45:26 +00:00
|
|
|
s.False(s.StatusNode.IsRunning())
|
2017-11-07 17:43:49 +00:00
|
|
|
time.Sleep(100 * time.Millisecond) //https://github.com/status-im/status-go/issues/429#issuecomment-339663163
|
2018-04-05 09:45:26 +00:00
|
|
|
s.Equal(node.ErrNoRunningNode, s.StatusNode.Stop())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
2017-10-11 14:20:51 +00:00
|
|
|
// start node
|
2018-04-05 09:45:26 +00:00
|
|
|
s.False(s.StatusNode.IsRunning())
|
2019-08-20 15:38:40 +00:00
|
|
|
s.NoError(s.StatusNode.Start(nodeConfig, nil))
|
2017-10-11 14:20:51 +00:00
|
|
|
// wait till node is started
|
2018-04-05 09:45:26 +00:00
|
|
|
s.True(s.StatusNode.IsRunning())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
|
|
|
// try starting another node (w/o stopping the previously started node)
|
2019-08-20 15:38:40 +00:00
|
|
|
s.Equal(node.ErrNodeRunning, s.StatusNode.Start(nodeConfig, nil))
|
2017-05-16 12:09:52 +00:00
|
|
|
|
2017-10-11 14:20:51 +00:00
|
|
|
// now stop node
|
2017-11-07 17:43:49 +00:00
|
|
|
time.Sleep(100 * time.Millisecond) //https://github.com/status-im/status-go/issues/429#issuecomment-339663163
|
2018-04-05 09:45:26 +00:00
|
|
|
s.NoError(s.StatusNode.Stop())
|
|
|
|
s.False(s.StatusNode.IsRunning())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
|
|
|
// start new node with exactly the same config
|
2019-08-20 15:38:40 +00:00
|
|
|
s.NoError(s.StatusNode.Start(nodeConfig, nil))
|
2018-04-05 09:45:26 +00:00
|
|
|
s.True(s.StatusNode.IsRunning())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
2017-10-11 14:20:51 +00:00
|
|
|
// finally stop the node
|
2017-11-07 17:43:49 +00:00
|
|
|
time.Sleep(100 * time.Millisecond) //https://github.com/status-im/status-go/issues/429#issuecomment-339663163
|
2018-04-05 09:45:26 +00:00
|
|
|
s.NoError(s.StatusNode.Stop())
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *ManagerTestSuite) TestNetworkSwitching() {
|
|
|
|
// get Ropsten config
|
2018-03-02 09:25:30 +00:00
|
|
|
nodeConfig, err := MakeTestNodeConfig(GetNetworkID())
|
2017-10-11 14:20:51 +00:00
|
|
|
s.NoError(err)
|
2018-04-05 09:45:26 +00:00
|
|
|
s.False(s.StatusNode.IsRunning())
|
2019-08-20 15:38:40 +00:00
|
|
|
s.NoError(s.StatusNode.Start(nodeConfig, nil))
|
2017-10-11 14:20:51 +00:00
|
|
|
// wait till node is started
|
2018-04-05 09:45:26 +00:00
|
|
|
s.Require().True(s.StatusNode.IsRunning())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
2018-04-05 09:45:26 +00:00
|
|
|
firstHash, err := e2e.FirstBlockHash(s.StatusNode)
|
2017-10-11 14:20:51 +00:00
|
|
|
s.NoError(err)
|
2017-10-26 13:11:24 +00:00
|
|
|
s.Equal(GetHeadHash(), firstHash)
|
2017-05-16 12:09:52 +00:00
|
|
|
|
|
|
|
// now stop node, and make sure that a new node, on different network can be started
|
2017-11-07 17:43:49 +00:00
|
|
|
time.Sleep(100 * time.Millisecond) //https://github.com/status-im/status-go/issues/429#issuecomment-339663163
|
2018-04-05 09:45:26 +00:00
|
|
|
s.NoError(s.StatusNode.Stop())
|
|
|
|
s.False(s.StatusNode.IsRunning())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
|
|
|
// start new node with completely different config
|
2018-03-02 09:25:30 +00:00
|
|
|
nodeConfig, err = MakeTestNodeConfig(params.RinkebyNetworkID)
|
2017-10-11 14:20:51 +00:00
|
|
|
s.NoError(err)
|
2019-08-20 15:38:40 +00:00
|
|
|
s.NoError(s.StatusNode.Start(nodeConfig, nil))
|
2018-04-05 09:45:26 +00:00
|
|
|
s.True(s.StatusNode.IsRunning())
|
2017-05-16 12:09:52 +00:00
|
|
|
|
|
|
|
// make sure we are on another network indeed
|
2018-04-05 09:45:26 +00:00
|
|
|
firstHash, err = e2e.FirstBlockHash(s.StatusNode)
|
2017-10-11 14:20:51 +00:00
|
|
|
s.NoError(err)
|
2017-10-25 22:07:50 +00:00
|
|
|
s.Equal(GetHeadHashFromNetworkID(params.RinkebyNetworkID), firstHash)
|
2017-05-16 12:09:52 +00:00
|
|
|
|
2017-11-07 17:43:49 +00:00
|
|
|
time.Sleep(100 * time.Millisecond) //https://github.com/status-im/status-go/issues/429#issuecomment-339663163
|
2018-04-05 09:45:26 +00:00
|
|
|
s.NoError(s.StatusNode.Stop())
|
2017-05-16 12:09:52 +00:00
|
|
|
}
|
|
|
|
|
2018-04-05 09:45:26 +00:00
|
|
|
func (s *ManagerTestSuite) TestStartWithUpstreamEnabled() {
|
2017-10-26 12:33:42 +00:00
|
|
|
if GetNetworkID() == params.StatusChainNetworkID {
|
|
|
|
s.T().Skip()
|
|
|
|
}
|
|
|
|
|
2018-03-02 09:25:30 +00:00
|
|
|
nodeConfig, err := MakeTestNodeConfig(GetNetworkID())
|
2017-10-25 12:08:33 +00:00
|
|
|
s.NoError(err)
|
|
|
|
|
2017-10-26 13:11:24 +00:00
|
|
|
networkURL, err := GetRemoteURL()
|
2017-10-11 14:20:51 +00:00
|
|
|
s.NoError(err)
|
|
|
|
|
|
|
|
nodeConfig.UpstreamConfig.Enabled = true
|
2017-10-25 12:08:33 +00:00
|
|
|
nodeConfig.UpstreamConfig.URL = networkURL
|
2017-10-11 14:20:51 +00:00
|
|
|
|
2019-08-20 15:38:40 +00:00
|
|
|
s.NoError(s.StatusNode.Start(nodeConfig, nil))
|
2018-04-05 09:45:26 +00:00
|
|
|
s.True(s.StatusNode.IsRunning())
|
2017-11-07 17:43:49 +00:00
|
|
|
|
|
|
|
time.Sleep(100 * time.Millisecond) //https://github.com/status-im/status-go/issues/429#issuecomment-339663163
|
2018-04-05 09:45:26 +00:00
|
|
|
s.NoError(s.StatusNode.Stop())
|
2017-05-25 13:14:52 +00:00
|
|
|
}
|
|
|
|
|
2017-10-11 14:20:51 +00:00
|
|
|
// TODO(adam): race conditions should be tested with -race flag and unit tests, if possible.
|
2017-11-07 17:43:49 +00:00
|
|
|
// TODO(boris): going via https://github.com/status-im/status-go/pull/433#issuecomment-342232645 . Testing should be with -race flag
|
2017-10-11 14:20:51 +00:00
|
|
|
// Research if it's possible to do the same with unit tests.
|
2017-11-07 17:43:49 +00:00
|
|
|
//func (s *ManagerTestSuite) TestRaceConditions() {
|
|
|
|
// cnt := 25
|
|
|
|
// progress := make(chan struct{}, cnt)
|
|
|
|
// rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
|
|
//
|
2018-03-02 09:25:30 +00:00
|
|
|
// nodeConfig1, e := MakeTestNodeConfig(GetNetworkID())
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.NoError(e)
|
|
|
|
//
|
2018-03-02 09:25:30 +00:00
|
|
|
// nodeConfig2, e := MakeTestNodeConfig(GetNetworkID())
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.NoError(e)
|
|
|
|
//
|
|
|
|
// nodeConfigs := []*params.NodeConfig{nodeConfig1, nodeConfig2}
|
|
|
|
//
|
|
|
|
// var funcsToTest = []func(*params.NodeConfig){
|
|
|
|
// func(config *params.NodeConfig) {
|
2018-04-05 09:45:26 +00:00
|
|
|
// log.Info("Start()")
|
|
|
|
// _, err := s.StatusNode.Start(config)
|
|
|
|
// s.T().Logf("Start() for network: %d, error: %v", config.NetworkID, err)
|
2017-11-07 17:43:49 +00:00
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.Stop()
|
|
|
|
// s.T().Logf("Stop() for network: %d, error: %v", config.NetworkID, err)
|
2017-11-07 17:43:49 +00:00
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("Node()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.GethNode()
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.T().Logf("Node(), error: %v", err)
|
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
2018-04-05 09:45:26 +00:00
|
|
|
// log.Info("IsRunning()")
|
|
|
|
// s.T().Logf("IsRunning(), result: %v", s.StatusNode.IsRunning())
|
2017-11-07 17:43:49 +00:00
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// // TODO(adam): quarantined until it uses a different datadir
|
|
|
|
// // as otherwise it wipes out cached blockchain data.
|
|
|
|
// // func(config *params.NodeConfig) {
|
2018-02-09 13:37:56 +00:00
|
|
|
// // log.Info("ResetChainData()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// // _, err := s.StatusNode.ResetChainData()
|
2018-02-09 13:37:56 +00:00
|
|
|
// // s.T().Logf("ResetChainData(), error: %v", err)
|
|
|
|
// // progress <- struct{}{}
|
2017-11-07 17:43:49 +00:00
|
|
|
// // },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("RestartNode()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.RestartNode()
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.T().Logf("RestartNode(), error: %v", err)
|
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
2018-04-05 09:45:26 +00:00
|
|
|
// log.Info("Config()")
|
|
|
|
// _, err := s.StatusNode.Config()
|
|
|
|
// s.T().Logf("Config(), error: %v", err)
|
2017-11-07 17:43:49 +00:00
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("LightEthereumService()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.LightEthereumService()
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.T().Logf("LightEthereumService(), error: %v", err)
|
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("WhisperService()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.WhisperService()
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.T().Logf("WhisperService(), error: %v", err)
|
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("AccountManager()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.AccountManager()
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.T().Logf("AccountManager(), error: %v", err)
|
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("AccountKeyStore()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// _, err := s.StatusNode.AccountKeyStore()
|
2017-11-07 17:43:49 +00:00
|
|
|
// s.T().Logf("AccountKeyStore(), error: %v", err)
|
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// func(config *params.NodeConfig) {
|
|
|
|
// log.Info("RPCClient()")
|
2018-04-05 09:45:26 +00:00
|
|
|
// s.StatusNode.RPCClient()
|
2017-11-07 17:43:49 +00:00
|
|
|
// progress <- struct{}{}
|
|
|
|
// },
|
|
|
|
// }
|
|
|
|
//
|
2018-04-05 09:45:26 +00:00
|
|
|
// // increase Start()/Stop() population
|
2017-11-07 17:43:49 +00:00
|
|
|
// for i := 0; i < 5; i++ {
|
|
|
|
// funcsToTest = append(funcsToTest, funcsToTest[0], funcsToTest[1])
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// for i := 0; i < cnt; i++ {
|
|
|
|
// randConfig := nodeConfigs[rnd.Intn(len(nodeConfigs))]
|
|
|
|
// randFunc := funcsToTest[rnd.Intn(len(funcsToTest))]
|
|
|
|
//
|
|
|
|
// if rnd.Intn(100) > 75 { // introduce random delays
|
|
|
|
// time.Sleep(500 * time.Millisecond)
|
|
|
|
// }
|
|
|
|
// go randFunc(randConfig)
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// for range progress {
|
|
|
|
// cnt -= 1
|
|
|
|
// if cnt <= 0 {
|
|
|
|
// break
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// time.Sleep(2 * time.Second) // so that we see some logs
|
2018-04-05 09:45:26 +00:00
|
|
|
// nodeStopped, _ := s.StatusNode.Stop() // just in case we have a node running
|
2017-11-07 17:43:49 +00:00
|
|
|
//
|
|
|
|
// if nodeStopped != nil {
|
|
|
|
// <-nodeStopped
|
|
|
|
// }
|
|
|
|
//}
|