Skip to content

Commit

Permalink
chore: update localhost to 127.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Aug 6, 2024
1 parent 3bbd4dd commit 9f11ed2
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[[axelar_bridge_evm]]
name = "Ethereum"
rpc_addr = "localhost:8500/0"
rpc_addr = "127.0.0.1:8500/0"
start-with-bridge = false

[[axelar_bridge_evm]]
name = "Avalanche"
rpc_addr = "localhost:8500/1"
rpc_addr = "127.0.0.1:8500/1"
start-with-bridge = false

[[axelar_bridge_evm]]
name = "Fantom"
rpc_addr = "localhost:8500/2"
rpc_addr = "127.0.0.1:8500/2"
start-with-bridge = false

[[axelar_bridge_evm]]
name = "Moonbeam"
rpc_addr = "localhost:8500/3"
rpc_addr = "127.0.0.1:8500/3"
start-with-bridge = false

[[axelar_bridge_evm]]
name = "Polygon"
rpc_addr = "localhost:8500/4"
rpc_addr = "127.0.0.1:8500/4"
start-with-bridge = false
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wasmd init "$MONIKER" --chain-id ${CHAIN_ID} --home ${HOME} > /dev/null 2>&1 &&
# edit the app.toml file to enable the API and swagger
sed -i '/\[api\]/,/\[/ s/enable = false/enable = true/' "$HOME"/config/app.toml
sed -i '/\[api\]/,/\[/ s/swagger = false/swagger = true/' "$HOME"/config/app.toml
sed -i '/\[api\]/,/\[/ s/address = "tcp:\/\/localhost:1317"/address = "tcp:\/\/0.0.0.0:1317"/' "$HOME"/config/app.toml
sed -i '/\[api\]/,/\[/ s/address = "tcp:\/\/127.0.0.1:1317"/address = "tcp:\/\/0.0.0.0:1317"/' "$HOME"/config/app.toml

# this is essential for sub-1s block times (or header times go crazy)
sed -i 's/"time_iota_ms": "1000"/"time_iota_ms": "10"/' "$HOME"/config/genesis.json
Expand Down
2 changes: 1 addition & 1 deletion packages/axelar-local-dev-cosmos/jest/jest.global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { startChains } from "../src/setup";
async function waitForRpc(chain: string, timeout = 120000): Promise<void> {
const start = Date.now();
const interval = 3000;
const url = `http://localhost/${chain}-rpc/health`;
const url = `http://127.0.0.1/${chain}-rpc/health`;
let status = 0;
while (Date.now() - start < timeout) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ setLogger(() => undefined);
describe("DockerService", () => {
it("should start containers successfully", async () => {
const testLcd = "cosmos/base/tendermint/v1beta1/node_info";
const healthAxelarRpc = await fetch("http://localhost/axelar-rpc");
const healthAxelarRpc = await fetch("http://127.0.0.1/axelar-rpc");
const healthAxelarLcd = await fetch(
`http://localhost/axelar-lcd/${testLcd}`
`http://127.0.0.1/axelar-lcd/${testLcd}`
);
const healthWasmRpc = await fetch("http://localhost/wasm-rpc");
const healthWasmLcd = await fetch(`http://localhost/wasm-lcd/${testLcd}`);
const healthWasmRpc = await fetch("http://127.0.0.1/wasm-rpc");
const healthWasmLcd = await fetch(`http://127.0.0.1/wasm-lcd/${testLcd}`);

expect(healthAxelarRpc.status).toBe(200);
expect(healthAxelarLcd.status).toBe(200);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fetch from "node-fetch";

export function fetchAxelarLcd(endpoint?: string) {
return fetch(`http://localhost/axelar-lcd/${endpoint}`).then((res) =>
return fetch(`http://127.0.0.1/axelar-lcd/${endpoint}`).then((res) =>
res.json()
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export class CosmosClient {
const defaultDenom = chain === "wasm" ? "uwasm" : "uaxl";
const chainInfo = {
denom: config.denom || defaultDenom,
lcdUrl: config.lcdUrl || `http://localhost/${chain}-lcd`,
rpcUrl: config.rpcUrl || `http://localhost/${chain}-rpc`,
wsUrl: config.wsUrl || `ws://localhost/${chain}-rpc/websocket`,
lcdUrl: config.lcdUrl || `http://127.0.0.1/${chain}-lcd`,
rpcUrl: config.rpcUrl || `http://127.0.0.1/${chain}-rpc`,
wsUrl: config.wsUrl || `ws://127.0.0.1/${chain}-rpc/websocket`,
};
gasPrice = gasPrice || GasPrice.fromString(`1${chainInfo.denom}`);

Expand Down
6 changes: 3 additions & 3 deletions packages/axelar-local-dev-cosmos/src/config/axelar/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const defaultAxelarConfig: ChainConfig = {
export const defaultAxelarChainInfo: Omit<CosmosChainInfo, "owner"> = {
prefix: "axelar",
denom: "uaxl",
lcdUrl: "http://localhost/axelar-lcd",
rpcUrl: "http://localhost/axelar-rpc",
wsUrl: "ws://localhost/axelar-rpc/websocket",
lcdUrl: "http://127.0.0.1/axelar-lcd",
rpcUrl: "http://127.0.0.1/axelar-rpc",
wsUrl: "ws://127.0.0.1/axelar-rpc/websocket",
};
6 changes: 3 additions & 3 deletions packages/axelar-local-dev-cosmos/src/config/wasm/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const defaultWasmConfig: ChainConfig = {
export const defaultWasmChainInfo: Omit<CosmosChainInfo, "owner"> = {
prefix: "wasm",
denom: "uwasm",
lcdUrl: "http://localhost/wasm-lcd",
rpcUrl: "http://localhost/wasm-rpc",
wsUrl: "ws://localhost/wasm-rpc/websocket",
lcdUrl: "http://127.0.0.1/wasm-lcd",
rpcUrl: "http://127.0.0.1/wasm-rpc",
wsUrl: "ws://127.0.0.1/wasm-rpc/websocket",
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AxelarListener {

constructor(config: Pick<CosmosChainInfo, "wsUrl">) {
this.wsMap = new Map();
this.wsUrl = config.wsUrl || `ws://localhost/axelar-rpc/websocket`;
this.wsUrl = config.wsUrl || `ws://127.0.0.1/axelar-rpc/websocket`;
}

private getOrInit(topicId: string) {
Expand Down
12 changes: 6 additions & 6 deletions packages/axelar-local-dev-cosmos/src/services/DockerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export class DockerService {
await this.waitForRpc(chain, options?.rpcWaitTimeout);
await this.waitForLcd(chain, options?.lcdWaitTimeout);

const rpcUrl = `http://localhost/${chain}-rpc`;
const lcdUrl = `http://localhost/${chain}-lcd`;
const wsUrl = `ws://localhost/${chain}-rpc/websocket`;
const rpcUrl = `http://127.0.0.1/${chain}-rpc`;
const lcdUrl = `http://127.0.0.1/${chain}-lcd`;
const wsUrl = `ws://127.0.0.1/${chain}-rpc/websocket`;

logger.log(`RPC server for ${chain} is started at ${rpcUrl}`);
logger.log(`LCD server for ${chain} is started at ${lcdUrl}`);
Expand Down Expand Up @@ -75,7 +75,7 @@ export class DockerService {

logger.log("Starting traefik container...");
await compose.upOne("traefik", config);
logger.log("Traefik started at http://localhost:8080");
logger.log("Traefik started at http://127.0.0.1:8080");
}

async stopAll() {
Expand Down Expand Up @@ -122,7 +122,7 @@ export class DockerService {
async waitForRpc(chain: CosmosChain, timeout = 120000): Promise<void> {
const start = Date.now();
const interval = 3000;
const url = `http://localhost/${chain}-rpc/health`;
const url = `http://127.0.0.1/${chain}-rpc/health`;
let status = 0;
while (Date.now() - start < timeout) {
try {
Expand All @@ -144,7 +144,7 @@ export class DockerService {
const testUrl = "cosmos/base/tendermint/v1beta1/node_info";
const start = Date.now();
const interval = 3000;
const url = `http://localhost/${chain}-lcd/${testUrl}`;
const url = `http://127.0.0.1/${chain}-lcd/${testUrl}`;
let result, network;
while (Date.now() - start < timeout) {
try {
Expand Down

0 comments on commit 9f11ed2

Please sign in to comment.