olegmitrakhovich / Defi-Arb-Bot

arbitrage bot, looks for prices differences on uniswap and kyber. Uses flashloan to make a trade between 2 exchanges. #eattheblocks course
295 stars 92 forks source link

error #1

Closed wepobid closed 3 years ago

wepobid commented 4 years ago

internal/url.js:256 throw new ERR_INVALID_URL(input);

cnspot commented 4 years ago

me too,please give more information of install and run

olegmitrakhovich commented 4 years ago

sorry can you explain more about the error? never seen that before

mikule1 commented 4 years ago

internal/url.js:256 throw new ERR_INVALID_URL(input); ^

TypeError [ERR_INVALID_URL]: Invalid URL: undefined at onParseError (internal/url.js:256:9) at new URL (internal/url.js:332:5) at Object.helpers [as parseURL] (C:\Users\bip\IdeaProjects\Defi-Arb-Bot\node_modules\web3-providers-ws\src\helpers.js:14:20) at new WebsocketProvider (C:\Users\bip\IdeaProjects\Defi-Arb-Bot\node_modules\web3-providers-ws\src\index.js:70:29) at Object. (C:\Users\bip\IdeaProjects\Defi-Arb-Bot\run-arbitrage.js:9:3) at Module._compile (internal/modules/cjs/loader.js:1201:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10) at Module.load (internal/modules/cjs/loader.js:1050:32) at Function.Module._load (internal/modules/cjs/loader.js:938:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { input: 'undefined', code: 'ERR_INVALID_URL' }

mikule1 commented 4 years ago

Managed to run this. You need to create .env file in project root and link node url and private key

cnspot commented 4 years ago

.env file like this:

INFURA_URL="wss://mainnet.infura.io/ws/v3/XXXXXXXXXXXXXXXXXXXXXX" PRIVATE_KEY="69xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

olegmitrakhovich commented 4 years ago

this is correct, you need to make a .env file and get your own infura_url API key. Also, create a new ETH wallet address and extract your private key to store in your .env file just like cnspot mentioned above. Make sure your new wallet address has ETH inside.