diff --git a/Makefile b/Makefile index 6aa690a51..104950507 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ POKTROLLD_HOME := ./localnet/poktrolld POCKET_NODE = tcp://127.0.0.1:36657 # The pocket rollup node (full node and sequencer in the localnet context) -RELAYER_NODE = http://anvil:8547 # TODO_IN_THIS_COMMIT: UPDATE THIS URL +APPGATE_SERVER = http://localhost:42069 POCKET_ADDR_PREFIX = pokt #################### @@ -137,7 +137,7 @@ go_imports: check_go_version ## Run goimports on all go files .PHONY: test_e2e test_e2e: ## Run all E2E tests export POCKET_NODE=$(POCKET_NODE) && \ - export RELAYER_NODE=$(RELAYER_NODE) && \ + export APPGATE_SERVER=$(APPGATE_SERVER) && \ POKTROLLD_HOME=../../$(POKTROLLD_HOME) && \ go test -v ./e2e/tests/... -tags=e2e diff --git a/e2e/tests/init_test.go b/e2e/tests/init_test.go index 2c7d398f3..6124f4d5a 100644 --- a/e2e/tests/init_test.go +++ b/e2e/tests/init_test.go @@ -243,7 +243,7 @@ func (s *suite) TheSessionForApplicationAndServiceContainsTheSupplier(appName st } func (s *suite) TheApplicationSendsTheSupplierARequestForServiceWithData(appName, supplierName, serviceId, requestData string) { - res, err := s.pocketd.RunCurl("", requestData) + res, err := s.pocketd.RunCurl("", serviceId, requestData) if err != nil { s.Fatalf("error sending relay request from app %s to supplier %s for service %s: %v", appName, supplierName, serviceId, err) } diff --git a/e2e/tests/node.go b/e2e/tests/node.go index d610ef54c..2aee2eba7 100644 --- a/e2e/tests/node.go +++ b/e2e/tests/node.go @@ -21,8 +21,8 @@ var ( defaultRPCHost = "127.0.0.1" // defaultHome is the default home directory for pocketd defaultHome = os.Getenv("POKTROLLD_HOME") - // defaultRelayerURL used by curl commands to send relay requests - defaultRelayerURL = os.Getenv("RELAYER_NODE") + // defaultAppGateServerURL used by curl commands to send relay requests + defaultAppGateServerURL = os.Getenv("APPGATE_SERVER") ) func init() { @@ -46,7 +46,7 @@ type commandResult struct { type PocketClient interface { RunCommand(args ...string) (*commandResult, error) RunCommandOnHost(rpcUrl string, args ...string) (*commandResult, error) - RunCurl(rpcUrl string, data string, args ...string) (*commandResult, error) + RunCurl(rpcUrl, service, data string, args ...string) (*commandResult, error) } // Ensure that pocketdBin struct fulfills PocketClient @@ -72,11 +72,11 @@ func (p *pocketdBin) RunCommandOnHost(rpcUrl string, args ...string) (*commandRe } // RunCurl runs a curl command on the local machine -func (p *pocketdBin) RunCurl(rpcUrl string, data string, args ...string) (*commandResult, error) { +func (p *pocketdBin) RunCurl(rpcUrl, service, data string, args ...string) (*commandResult, error) { if rpcUrl == "" { - rpcUrl = defaultRelayerURL + rpcUrl = defaultAppGateServerURL } - return p.runCurlPostCmd(rpcUrl, data, args...) + return p.runCurlPostCmd(rpcUrl, service, data, args...) } // runPocketCmd is a helper to run a command using the local pocketd binary with the flags provided @@ -108,8 +108,8 @@ func (p *pocketdBin) runPocketCmd(args ...string) (*commandResult, error) { } // runCurlPostCmd is a helper to run a command using the local pocketd binary with the flags provided -func (p *pocketdBin) runCurlPostCmd(rpcUrl string, data string, args ...string) (*commandResult, error) { - base := []string{"-v", "-X", "POST", "-H", "'Content-Type: application/json'", "--data", fmt.Sprintf("'%s'", data), rpcUrl} +func (p *pocketdBin) runCurlPostCmd(rpcUrl string, service string, data string, args ...string) (*commandResult, error) { + base := []string{"-v", "-X", "POST", "-H", "'Content-Type: application/json'", "--data", fmt.Sprintf("'%s'", data), fmt.Sprintf("%s/%s", rpcUrl, service)} args = append(base, args...) commandStr := "curl " + strings.Join(args, " ") // Create a string representation of the command cmd := exec.Command("curl", args...) diff --git a/pkg/appgateserver/cmd/cmd.go b/pkg/appgateserver/cmd/cmd.go index 21052e270..663562e98 100644 --- a/pkg/appgateserver/cmd/cmd.go +++ b/pkg/appgateserver/cmd/cmd.go @@ -142,6 +142,6 @@ func setupAppGateServerDependencies(cmd *cobra.Command, ctx context.Context, com return nil, fmt.Errorf("failed to create block client: %w", err) } - // Return the dependencie config. + // Return the dependencies config. return depinject.Supply(clientCtx, blockClient), nil }