From 51fc8c899ec5c04faa69fe95949117076158bbf8 Mon Sep 17 00:00:00 2001 From: Esteban Abaroa Date: Sat, 7 Dec 2024 17:35:47 +0000 Subject: [PATCH] refactor(electron): change IPFS API port to 50019 --- electron/main.js | 4 ++-- electron/start-ipfs.js | 8 ++++---- electron/start-plebbit-rpc.js | 2 +- src/views/home/home.tsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/electron/main.js b/electron/main.js index fcdd4d55..60b8359f 100644 --- a/electron/main.js +++ b/electron/main.js @@ -168,7 +168,7 @@ const createMainWindow = () => { let serializedUrl = ''; // make an exception for ipfs stats - if (validatedUrl.toString() === 'http://localhost:5001/webui/') { + if (validatedUrl.toString() === 'http://localhost:50019/webui/') { serializedUrl = validatedUrl.toString(); } else if (validatedUrl.protocol === 'https:') { // open serialized url to prevent remote execution @@ -198,7 +198,7 @@ const createMainWindow = () => { let serializedUrl = ''; // make an exception for ipfs stats - if (validatedUrl.toString() === 'http://localhost:5001/webui/') { + if (validatedUrl.toString() === 'http://localhost:50019/webui/') { serializedUrl = validatedUrl.toString(); } else if (validatedUrl.protocol === 'https:') { // open serialized url to prevent remote execution diff --git a/electron/start-ipfs.js b/electron/start-ipfs.js index 9bbdbc1d..2f1722a9 100644 --- a/electron/start-ipfs.js +++ b/electron/start-ipfs.js @@ -69,10 +69,10 @@ const startIpfs = async () => { }); // use different port with proxy for debugging during env - let apiAddress = '/ip4/127.0.0.1/tcp/5001'; + let apiAddress = '/ip4/127.0.0.1/tcp/50019'; if (isDev) { - apiAddress = apiAddress.replace('5001', '5002'); - proxyServer.start({ proxyPort: 5001, targetPort: 5002 }); + apiAddress = apiAddress.replace('50019', '50029'); + proxyServer.start({ proxyPort: 50019, targetPort: 50029 }); } await spawnAsync(ipfsPath, ['config', 'Addresses.API', apiAddress], { env, hideWindows: true }); @@ -116,7 +116,7 @@ const start = async () => { } pendingStart = true; try { - const started = await tcpPortUsed.check(isDev ? 5002 : 5001, '127.0.0.1'); + const started = await tcpPortUsed.check(isDev ? 50029 : 50019, '127.0.0.1'); if (started) { return; } diff --git a/electron/start-plebbit-rpc.js b/electron/start-plebbit-rpc.js index 83a8fae6..8a3e07b9 100644 --- a/electron/start-plebbit-rpc.js +++ b/electron/start-plebbit-rpc.js @@ -14,7 +14,7 @@ const port = 9138; const defaultPlebbitOptions = { // find the user's OS data path dataPath: !isDev ? envPaths.data : path.join(dirname, '..', '.plebbit'), - ipfsHttpClientsOptions: ['http://localhost:5001/api/v0'], + ipfsHttpClientsOptions: ['http://localhost:50019/api/v0'], httpRoutersOptions: ['https://routing.lol', 'https://peers.pleb.bot'], }; diff --git a/src/views/home/home.tsx b/src/views/home/home.tsx index 4bc14372..cedf401c 100644 --- a/src/views/home/home.tsx +++ b/src/views/home/home.tsx @@ -176,7 +176,7 @@ export const Footer = () => { v{packageJson.version} {isElectron && ( - + node stats )}