From 00dd3a6801ef12cc4f7b4ea35a0aa70b3cde4c31 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Fri, 15 Jul 2022 16:57:42 -0400 Subject: [PATCH] allow e2e to work for out of process app --- test/e2e/node/main.go | 19 ++++++++++++++++++- test/e2e/pkg/manifest.go | 2 ++ test/e2e/pkg/testnet.go | 6 +++++- test/e2e/runner/setup.go | 6 ++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/test/e2e/node/main.go b/test/e2e/node/main.go index b109d5397..3e020fe6d 100644 --- a/test/e2e/node/main.go +++ b/test/e2e/node/main.go @@ -112,7 +112,24 @@ func startApp(cfg *Config) error { return err } logger.Info("start app", "msg", log.NewLazySprintf("Server listening on %v (%v protocol)", cfg.Listen, cfg.Protocol)) - return nil + tmcfg, nodeLogger, nodeKey, err := setupNode() + if err != nil { + return fmt.Errorf("failed to setup config: %w", err) + } + + n, err := node.NewNode(tmcfg, + privval.LoadOrGenFilePV(tmcfg.PrivValidatorKeyFile(), tmcfg.PrivValidatorStateFile()), + nodeKey, + proxy.NewRemoteClientCreator(cfg.Listen, cfg.Protocol, true), + node.DefaultGenesisDocProviderFunc(tmcfg), + node.DefaultDBProvider, + node.DefaultMetricsProvider(tmcfg.Instrumentation), + nodeLogger, + ) + if err != nil { + return err + } + return n.Start() } // startNode starts a Tendermint node running the application directly. It assumes the Tendermint diff --git a/test/e2e/pkg/manifest.go b/test/e2e/pkg/manifest.go index 65c0cf84b..2ce268c2d 100644 --- a/test/e2e/pkg/manifest.go +++ b/test/e2e/pkg/manifest.go @@ -96,6 +96,8 @@ type ManifestNode struct { // This defaults to v0. Mempool string `toml:"mempool_version"` + ABCIProtocol string `toml:"abci_protocol"` + // StateSync enables state sync. The runner automatically configures trusted // block hashes and RPC servers. At least one node in the network must have // SnapshotInterval set to non-zero, and the state syncing node must have diff --git a/test/e2e/pkg/testnet.go b/test/e2e/pkg/testnet.go index 4d46de922..0b8dbd4b9 100644 --- a/test/e2e/pkg/testnet.go +++ b/test/e2e/pkg/testnet.go @@ -145,6 +145,10 @@ func LoadTestnet(file string) (*Testnet, error) { for _, name := range nodeNames { nodeManifest := manifest.Nodes[name] + abciProtocol := "builtin" + if nodeManifest.ABCIProtocol != "" { + abciProtocol = nodeManifest.ABCIProtocol + } node := &Node{ Name: name, Testnet: testnet, @@ -154,7 +158,7 @@ func LoadTestnet(file string) (*Testnet, error) { ProxyPort: proxyPortGen.Next(), Mode: ModeValidator, Database: "goleveldb", - ABCIProtocol: Protocol(testnet.ABCIProtocol), + ABCIProtocol: Protocol(abciProtocol), PrivvalProtocol: ProtocolFile, StartAt: nodeManifest.StartAt, FastSync: nodeManifest.FastSync, diff --git a/test/e2e/runner/setup.go b/test/e2e/runner/setup.go index 919e4542f..0ebd349be 100644 --- a/test/e2e/runner/setup.go +++ b/test/e2e/runner/setup.go @@ -82,10 +82,15 @@ func Setup(testnet *e2e.Testnet) error { } } + fmt.Println("proxy! app") + fmt.Println(node.Name) + fmt.Println(node.Mode) + fmt.Println(node.ABCIProtocol) cfg, err := MakeConfig(node) if err != nil { return err } + fmt.Println(cfg.ProxyApp) config.WriteConfigFile(filepath.Join(nodeDir, "config", "config.toml"), cfg) // panics appCfg, err := MakeAppConfig(node) @@ -244,6 +249,7 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) { case e2e.ProtocolUNIX: cfg.ProxyApp = AppAddressUNIX case e2e.ProtocolTCP: + fmt.Println("tcp?") cfg.ProxyApp = AppAddressTCP case e2e.ProtocolGRPC: cfg.ProxyApp = AppAddressTCP