jito-labs / mev-bot

Other
806 stars 288 forks source link

The endpoint can only be paired with an `https.Agent`. You have, instead, supplied an `http.Agent` through `httpAgent` #4

Open rajgoesout opened 1 year ago

rajgoesout commented 1 year ago

When I run yarn start, I'm facing this error:

/Users/rajdeep/dev/jito-mev-bot/node_modules/jito-ts/node_modules/@solana/web3.js/lib/index.cjs.js:6192
          throw new Error('The endpoint `' + url + '` can only be paired with an `https.Agent`. You have, instead, supplied an ' + '`http.Agent` through `httpAgent`.');
                ^

Error: The endpoint `https://frankfurt.mainnet.rpc.jito.wtf` can only be paired with an `https.Agent`. You have, instead, supplied an `http.Agent` through `httpAgent`.
    at createRpcClient (/Users/rajdeep/dev/jito-mev-bot/node_modules/jito-ts/node_modules/@solana/web3.js/lib/index.cjs.js:6192:17)
    at new Connection (/Users/rajdeep/dev/jito-mev-bot/node_modules/jito-ts/node_modules/@solana/web3.js/lib/index.cjs.js:7132:23)
    at new JitoRpcConnection (/Users/rajdeep/dev/jito-mev-bot/node_modules/jito-ts/dist/sdk/rpc/connection.js:258:9)
    at file:///Users/rajdeep/dev/jito-mev-bot/build/src/clients/rpc.js:122:18
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)
mazgalesc commented 8 months ago

read the error again pls.. you will figure it out

Wiger123 commented 6 months ago

I meet the same problem, it seems like mev-bot misunderstood the url of https to http

ocoderr commented 6 months ago

I meet the same problem

staccDOTsol commented 5 months ago

I meet the same broblem

akSolkhatri commented 4 months ago

Anyone got the solution?

zzxn commented 4 months ago

Anyone got the solution?

Just delete the code that checks agent type...

smilesmile191 commented 3 months ago

read the error again pls.. you will figure it out

Please tell me how to solve it

yahdielo commented 3 months ago

read the error again pls.. you will figure it out

Please tell me how to solve it

change the endpoint https: to http: that should do it.

fabiankaeser82 commented 2 months ago

Please can someone help me tu run this ?

Whitence commented 1 month ago

easy,just comment out the agent

like this:

if (RPC_REQUESTS_PER_SECOND > 0) { connection = new Connection(RPC_URL, { commitment: 'processed', fetch: coalesceFetch(), disableRetryOnRateLimit: true, // httpAgent: keepaliveAgent, }); } else { connection = new Connection(RPC_URL, { // httpAgent: keepaliveAgent, disableRetryOnRateLimit: true, commitment: 'processed', }); }