From eabc92b84e70c65a935edc0ff3ec344df2d60ef0 Mon Sep 17 00:00:00 2001 From: npty Date: Fri, 27 Oct 2023 15:31:52 +0700 Subject: [PATCH] chore: remove lcdPort and rpcPort in config --- packages/axelar-local-dev-cosmos/jest/jest.global-setup.ts | 1 - packages/axelar-local-dev-cosmos/src/axelar/config.ts | 3 --- packages/axelar-local-dev-cosmos/src/docker/utils.ts | 7 +++---- packages/axelar-local-dev-cosmos/src/types.ts | 3 --- packages/axelar-local-dev-cosmos/src/wasm/config.ts | 3 --- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/axelar-local-dev-cosmos/jest/jest.global-setup.ts b/packages/axelar-local-dev-cosmos/jest/jest.global-setup.ts index da7bcd27..d74360da 100644 --- a/packages/axelar-local-dev-cosmos/jest/jest.global-setup.ts +++ b/packages/axelar-local-dev-cosmos/jest/jest.global-setup.ts @@ -2,5 +2,4 @@ import { stopAll, startAll } from "../src/docker"; export default async () => { await startAll(); - // await new Promise((resolve) => setTimeout(resolve, 3000)); }; diff --git a/packages/axelar-local-dev-cosmos/src/axelar/config.ts b/packages/axelar-local-dev-cosmos/src/axelar/config.ts index 8e0197d8..787c5fa0 100644 --- a/packages/axelar-local-dev-cosmos/src/axelar/config.ts +++ b/packages/axelar-local-dev-cosmos/src/axelar/config.ts @@ -2,9 +2,6 @@ import path from "path"; import { ChainConfig } from "../types"; export const defaultConfig: ChainConfig = { - lcdPort: 11317, - rpcPort: 36657, - healthcheckEndpoint: "health", dockerPath: path.join(__dirname, "../../docker/axelar"), }; export const getOwnerAccount = () => {}; diff --git a/packages/axelar-local-dev-cosmos/src/docker/utils.ts b/packages/axelar-local-dev-cosmos/src/docker/utils.ts index b865eec8..6ad9b5d1 100644 --- a/packages/axelar-local-dev-cosmos/src/docker/utils.ts +++ b/packages/axelar-local-dev-cosmos/src/docker/utils.ts @@ -21,9 +21,9 @@ export function getChainConfig(chain: CosmosChain) { } export function createContainerEnv(chain: CosmosChain, options: ChainConfig) { - const { dockerPath, rpcPort, lcdPort } = options; + const { dockerPath } = options; const envPath = path.join(dockerPath, ".env"); - const env = `CHAIN_ID=${chain}\nCHAIN_LCD_PORT=${lcdPort}\nCHAIN_RPC_PORT=${rpcPort}\nMONIKER=${chain}`; + const env = `CHAIN_ID=${chain}\nMONIKER=${chain}`; fs.writeFileSync(envPath, env); } @@ -50,11 +50,10 @@ export async function getOwnerAccount(chain: CosmosChain) { * If response isn't 200 within {timeout}, throws an error. */ export async function waitForRpc(chain: CosmosChain, config: ChainConfig) { - const { healthcheckEndpoint } = config; const start = Date.now(); const timeout = 60000; const interval = 3000; - const url = `http://localhost/${chain}-rpc/${healthcheckEndpoint}`; + const url = `http://localhost/${chain}-rpc/health`; let status = 0; while (Date.now() - start < timeout) { try { diff --git a/packages/axelar-local-dev-cosmos/src/types.ts b/packages/axelar-local-dev-cosmos/src/types.ts index 414a4589..325e722b 100644 --- a/packages/axelar-local-dev-cosmos/src/types.ts +++ b/packages/axelar-local-dev-cosmos/src/types.ts @@ -9,9 +9,6 @@ export interface CosmosChainInfo { } export type ChainConfig = { - lcdPort: number; - rpcPort: number; - healthcheckEndpoint: string; dockerPath: string; }; diff --git a/packages/axelar-local-dev-cosmos/src/wasm/config.ts b/packages/axelar-local-dev-cosmos/src/wasm/config.ts index b8871519..0e5b0c7d 100644 --- a/packages/axelar-local-dev-cosmos/src/wasm/config.ts +++ b/packages/axelar-local-dev-cosmos/src/wasm/config.ts @@ -2,8 +2,5 @@ import path from "path"; import { ChainConfig } from "../types"; export const defaultConfig: ChainConfig = { - lcdPort: 1317, - rpcPort: 26657, - healthcheckEndpoint: "health", dockerPath: path.join(__dirname, "../../docker/wasm"), };