Innovation-Web-3-0-Blockchain / Arbitrage-Bot

Trading bot for executing arbitrage trades on Ethereum and other EVM compatible chains.
23 stars 10 forks source link

Error When starting the bot #3

Open dorohov7 opened 4 weeks ago

dorohov7 commented 4 weeks ago

An error occurs when launching the bot: “C:\Arbitrage-Bot-main>node bot.js C:\Arbitrage-Bot-main\helpers\initialization.js:26 provider = new hre.ethers.WebSocketProvider(wss://eth-mainnet.g.alchemy.com/v2/${process.env.Infura_API_KEY}); ^ TypeError: Cannot read properties of undefined (reading 'WebSocketProvider') at Object. (C:\Arbitrage-Bot-main\helpers\initialization.js:26:29) at Module._compile (node:internal/modules/cjs/loader:1546:14) at Module._extensions..js (node:internal/modules/cjs/loader:1691:10) at Module.load (node:internal/modules/cjs/loader:1317:32) at Module._load (node:internal/modules/cjs/loader:1127:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:217:24) at Module.require (node:internal/modules/cjs/loader:1339:12) at require (node:internal/modules/helpers:135:16) at Object. (C:\Arbitrage-Bot-main\bot.js:8:71)” Node.js v22.9.0

InnovationWeb3 commented 3 weeks ago

Hey, sorry for the delay. We’ve been really busy lately, but we’ll be back with new projects and updates on the current one.

Have you solved your issue yet? If not, please ensure that Infura_API_KEY is correctly set. At the top of the bot.js file, add the following line

console.log('Infura API Key:', process.env.Infura_API_KEY)

Then relaunch the bot. If the log shows something unexpected, that may not be the issue.

You can also try using this format instead

const provider = new ethers.providers.WebSocketProvider(wss://eth-mainnet.g.alchemy.com/v2/${process.env.Alchemy_API_KEY})

Additionally, ensure that the Node.js version you’re using is compatible with your dependencies. You might want to switch to an older version; we plan to update this project with the newest Node version in October.

Let us know if this solves the issue.

dorohov7 commented 1 week ago

  After making adjustments according to your advice, this is what appeared on the terminal: «C:\Users\doroh\Arbitrage-Bot>node bot.js Infura API Key: undefined node:internal/modules/cjs/loader:1443     throw err;     ^   SyntaxError: C:\Users\doroh\Arbitrage-Bot\config.json: Unexpected token / in JSON at position 81     at parse ()     at Module._extensions..json (node:internal/modules/cjs/loader:1440:39)     at Module.load (node:internal/modules/cjs/loader:1203:32)     at Module._load (node:internal/modules/cjs/loader:1019:12)     at Module.require (node:internal/modules/cjs/loader:1231:19)     at require (node:internal/modules/helpers:177:18)     at Object. (C:\Users\doroh\Arbitrage-Bot\bot.js:7:16)     at Module._compile (node:internal/modules/cjs/loader:1364:14)     at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)     at Module.load (node:internal/modules/cjs/loader:1203:32)   Node.js v18.20.4   C:\Users\doroh\Arbitrage-Bot>»  

   

Воскресенье, 29 сентября 2024, 3:42 +04:00 от Innovation Web 3.0 @.***>:     Hey, sorry for the delay. We’ve been really busy lately, but we’ll be back with new projects and updates on the current one. Have you solved your issue yet? If not, please ensure that Infura_API_KEY is correctly set. At the top of the bot.js file, add the following line console.log('Infura API Key:', process.env.Infura_API_KEY) Then relaunch the bot. If the log shows something unexpected, that may not be the issue. You can also try using this format instead const provider = new ethers.providers.WebSocketProvider(wss://eth-mainnet.g.alchemy.com/v2/${process.env.Alchemy_API_KEY}) Additionally, ensure that the Node.js version you’re using is compatible with your dependencies. You might want to switch to an older version; we plan to update this project with the newest Node version in October. Let us know if this solves the issue. — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you are subscribed to this thread. Message ID: <Innovation-Web-3-0-Blockchain/Arbitrage-Bot/issues/3/2381025251 @ github . com>    

Анатолий Дорохов Отправлено из Почты Mail