Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly use IPv4 comms since 'localhost' can be resolved differently. #658

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const Constants = Object.freeze({
'Error',
'Fatal',
],
lightnetMinaDaemonGraphQlEndpoint: 'http://localhost:8080/graphql',
lightnetAccountManagerEndpoint: 'http://localhost:8181',
lightnetArchiveNodeApiEndpoint: 'http://localhost:8282',
lightnetMinaDaemonGraphQlEndpoint: 'http://127.0.0.1:8080/graphql',
lightnetAccountManagerEndpoint: 'http://127.0.0.1:8181',
lightnetArchiveNodeApiEndpoint: 'http://127.0.0.1:8282',
});

export default Constants;
2 changes: 1 addition & 1 deletion src/lib/lightnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ function printUsefulUrls() {
]);
urls.push([
chalk.bold('PostgreSQL connection string'),
chalk.reset('postgresql://postgres:postgres@localhost:5432/archive'),
chalk.reset('postgresql://postgres:postgres@127.0.0.1:5432/archive'),
]);
}
console.log(boldTitle);
Expand Down
4 changes: 2 additions & 2 deletions tests/mocks/mocked-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import http, {
import { TestConstants, generateRandomInt } from '../utils/common-utils.js';

const applicationName = '⚡️[Mocked Endpoints Service]';
const host = 'localhost';
const host = '127.0.0.1';
const port = Number(
process.env.MOCKED_ENDPOINTS_SERVICE_PORT ??
TestConstants.mockedEndpointsServicePort
Expand All @@ -16,7 +16,7 @@ const port = Number(
// Start the mocked endpoints service.
const server: Server = http.createServer(createRequestListener());
server.listen(port, host, () => {
console.log(`${applicationName}: Is running on http://localhost:${port}`);
console.log(`${applicationName}: Is running on http://${host}:${port}`);
});

function createRequestListener(): RequestListener {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.describe('Users', () => {
);

const devServerPort = await portfinder.getPortPromise();
const devServerUrl = new URL(`http://localhost:${devServerPort}`);
const devServerUrl = new URL(`http://127.0.0.1:${devServerPort}`);
const projectName = crypto.randomUUID();
const { spawn, cleanup, path } = await prepareEnvironment();
let devServerProcess: ProcessPromise | undefined; // eslint-disable-line
Expand Down
8 changes: 4 additions & 4 deletions tests/utils/network-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
import { TestConstants } from './common-utils.js';

export function getMockedEndpointsServiceEndpoint(): string {
return `http://localhost:${
return `http://127.0.0.1:${
process.env.MOCKED_ENDPOINTS_SERVICE_PORT ??
TestConstants.mockedEndpointsServicePort
}`;
}

export async function getMinaGraphQlEndpoint(): Promise<string> {
const minaGraphQlEndpoint = `http://localhost:${
const minaGraphQlEndpoint = `http://127.0.0.1:${
process.env.MINA_GRAPHQL_PORT ?? TestConstants.minaGraphQlPort
}/graphql`;

Expand Down Expand Up @@ -252,11 +252,11 @@ async function getMinaAccountsManagerEndpoint(
? 'acquire-account'
: 'release-account';
const endpointPort = (await isEndpointAvailable(
`http://localhost:${accountsManagerPort}`,
`http://127.0.0.1:${accountsManagerPort}`,
false
))
? accountsManagerPort
: mockedAccountsManagerPort;

return `http://localhost:${endpointPort}/${endpointAction}`;
return `http://127.0.0.1:${endpointPort}/${endpointAction}`;
}
Loading