node: implement tendermint modes (#6241)

Co-authored-by: dongsam <dongsamb@gmail.com>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
This commit is contained in:
Callum Waters
2021-03-18 11:17:53 +01:00
committed by GitHub
parent 5c547137f6
commit 9f7051d38a
18 changed files with 428 additions and 150 deletions

View File

@@ -522,6 +522,27 @@ func TestNodeNewNodeCustomReactors(t *testing.T) {
assert.Equal(t, customBlockchainReactor, n.Switch().Reactor("BLOCKCHAIN"))
}
func TestNodeNewSeedNode(t *testing.T) {
config := cfg.ResetTestRoot("node_new_node_custom_reactors_test")
config.Mode = cfg.ModeSeed
defer os.RemoveAll(config.RootDir)
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
require.NoError(t, err)
n, err := NewSeedNode(config,
nodeKey,
DefaultGenesisDocProviderFunc(config),
log.TestingLogger(),
)
require.NoError(t, err)
err = n.Start()
require.NoError(t, err)
assert.True(t, n.pexReactor.IsRunning())
}
func state(nVals int, height int64) (sm.State, dbm.DB, []types.PrivValidator) {
privVals := make([]types.PrivValidator, nVals)
vals := make([]types.GenesisValidator, nVals)