ARBProtocol / solana-jupiter-bot

ARB Protocol | Automated Arbitrage Bot Using Jupiter
MIT License
549 stars 208 forks source link

use "yarn start"show error! #76

Open hk8846 opened 1 month ago

hk8846 commented 1 month ago

I use "yarn start",then show error: \solana-jupiter-bot-main\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53 throw ex; ^

Error: Cannot find module 'rpc-websockets/dist/lib/client'

but I use "yarn" init all package in my project,please help me!!!

chlarsen commented 1 month ago

Same here. I guess the versions required in yarn.lock are out of date.

ngocbv commented 1 month ago

any insight? @hk8846 @chlarsen

T1CkShot commented 2 weeks ago

Try yarn install beforehand

chlarsen commented 2 weeks ago

Alas, this does not seem to do the trick. Tried a completely new install, tried both "yarn install" and "yarn" individually and in different order, yet no luck. Here is what I get:

$ yarn start
yarn run v1.22.22
$ node --no-deprecation ./src/index.js && node --no-deprecation ./src/bot/index.js
/home/chris/solana-jupiter-bot/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Cannot find module 'rpc-websockets/dist/lib/client'
Require stack:
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/node_modules/@solana/web3.js/lib/index.cjs.js
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/dist/index.js
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/index.js
- /home/chris/solana-jupiter-bot/src/wizard/Pages/Tokens.js
- /home/chris/solana-jupiter-bot/node_modules/import-jsx/index.js
- /home/chris/solana-jupiter-bot/src/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/node_modules/@solana/web3.js/lib/index.cjs.js:20:32)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/node_modules/@solana/web3.js/lib/index.cjs.js',
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/dist/index.js',
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js',
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/index.js',
    '/home/chris/solana-jupiter-bot/src/wizard/Pages/Tokens.js',
    '/home/chris/solana-jupiter-bot/node_modules/import-jsx/index.js',
    '/home/chris/solana-jupiter-bot/src/index.js'
  ]
}

Node.js v20.17.0
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any thoughts? Thank you!

T1CkShot commented 2 weeks ago

https://stackoverflow.com/questions/78566652/solana-web3-js-cannot-find-module-rpc-websockets-dist-lib-client

manually downgrade rpc-websockets package to 7.11.0 by setting it in the package json

chlarsen commented 2 weeks ago

Thank you again, @T1CkShot. I now get:

$ yarn start
yarn run v1.22.22
$ node --no-deprecation ./src/index.js && node --no-deprecation ./src/bot/index.js
/home/chris/solana-jupiter-bot/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/home/chris/solana-jupiter-bot/node_modules/@solana/web3.js/lib/index.cjs.js:4233:48)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/chris/solana-jupiter-bot/src/utils/index.js:7:44)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)

Node.js v20.17.0
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any ideas? A huge "Thank you!"

L2b2n commented 2 weeks ago

Install whis Node 16 , and run whis Node 18

chlarsen commented 2 weeks ago

Node v. 16 is too outdated, and yarn fails completely. Node v. 18 installs OK, with downgraded rpc-websockets. However the error reported by myself before is still the same.

L2b2n commented 2 weeks ago

Oh sry install whis 18 and run whis 16

T1CkShot commented 2 weeks ago

Try this, First upgrade @solana/web3.js by yarn upgrade @solana/web3.js then remove the node modules and reinstall with yarn install Also use node 18 instead of 20 and see if it works. @chlarsen

chlarsen commented 2 weeks ago

Thank you @T1CkShot! Here is what I did: I installed nodejs v18, which is routinely distributed with Debian bookworm:

apt install nodejs

Next I installed yarn:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt update
apt install yarn

I then run the following as non-privileged user:

cd
git clone https://github.com/ARBProtocol/solana-jupiter-bot.git
cd ./solana-jupiter-bot
yarn install
yarn upgrade @solana/web3.js
rm -rf ./node_modules
yarn install

Note: No downgrading of rpc-websocket seems to be required. I created a suitable .env, and then issued as non-privileged user:

yarn start

I get:

             ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
      network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
          rpc┃                                                                              ┃
     strategy┃                                                                              ┃
       tokens┃  ──────────────────── network ────────────────────                           ┃
 trading size┃                                                                              ┃
       profit┃ Select Solana Network:                                                       ┃
     slippage┃                                                                              ┃
     priority┃  ❯ mainnet-beta                                                              ┃
     advanced┃                                                                              ┃
      confirm┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What looks like an error looks more like a feature, not a bug on a bigger screen, because there is a message hidden outside the bot's main screen, which says: "You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot." Oops, let me run down to the supermarket and get some ARB :-). I shall report back later!

chlarsen commented 2 weeks ago

I added 14k ARB (token address: 4FKVLyhBAeLEvjZfWPfV4hqWAPkpjn94cRqi3raY3hy9) to my wallet, but the same error reappears, whenever I run 'yarn start':


You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

ARB PROTOCOL BOT SETUP TESTS

*************************

ARB PROTOCOL BOT SETUP TESTS

*************************

ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

*************************

                                            [ previous             ] next              [H]elp             [ESC]

               ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
        network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
            rpc┃                                                                              ┃
       strategy┃                                                                              ┃
         tokens┃  ──────────────────── network ────────────────────                           ┃
   trading size┃                                                                              ┃
         profit┃ Select Solana Network:                                                       ┃
       slippage┃                                                                              ┃
       priority┃  ❯ mainnet-beta                                                              ┃
       advanced┃                                                                              ┃
        confirm┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Yet, I have 14k ARB in my wallet, plus SOL for gas fees, etc. Thoughts?

snurfer0 commented 1 week ago

I added 14k ARB (token address: 4FKVLyhBAeLEvjZfWPfV4hqWAPkpjn94cRqi3raY3hy9) to my wallet, but the same error reappears, whenever I run 'yarn start':


You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

ARB PROTOCOL BOT SETUP TESTS

*************************

ARB PROTOCOL BOT SETUP TESTS

*************************

ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

*************************

                                            [ previous             ] next              [H]elp             [ESC]

               ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
        network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
            rpc┃                                                                              ┃
       strategy┃                                                                              ┃
         tokens┃  ──────────────────── network ────────────────────                           ┃
   trading size┃                                                                              ┃
         profit┃ Select Solana Network:                                                       ┃
       slippage┃                                                                              ┃
       priority┃  ❯ mainnet-beta                                                              ┃
       advanced┃                                                                              ┃
        confirm┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Yet, I have 14k ARB in my wallet, plus SOL for gas fees, etc. Thoughts?

delete line 217-240 from /src/utils/index.js

chlarsen commented 1 week ago

Thank you, the ARB issue has been sorted, the bot configured for a test run with ping pong trade, INF/USDC, 30 BPS slippage to avoid slippage errors for now, but I get:

Error: No routes found for the input and output mints
    at Vn (/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js:1:177824)
    at Yn.computeRoutes (/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js:1:192951)
    at async pingpongStrategy (/home/chris/solana-jupiter-bot/src/bot/index.js:64:18)
    at async watcher (/home/chris/solana-jupiter-bot/src/bot/index.js:452:4)

INF and USDC are recognised by the wizard and selected via TUI dropdown. Any thoughts? Thank you! C.

Krokodiler24 commented 2 days ago

Ich habe 14k ARB (Token-Adresse: 4FKVLyhBAeLEvjZfWPfV4hqWAPkpjn94cRqi3raY3hy9) zu meiner Brieftasche hinzugefügt, aber derselbe Fehler tritt erneut auf, wenn ich „yarn start“ ausführe:


You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

ARB PROTOCOL BOT SETUP TESTS

*************************

ARB PROTOCOL BOT SETUP TESTS

*************************

ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

*************************

                                            [ previous             ] next              [H]elp             [ESC]

               ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
        network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
            rpc┃                                                                              ┃
       strategy┃                                                                              ┃
         tokens┃  ──────────────────── network ────────────────────                           ┃
   trading size┃                                                                              ┃
         profit┃ Select Solana Network:                                                       ┃
       slippage┃                                                                              ┃
       priority┃  ❯ mainnet-beta                                                              ┃
       advanced┃                                                                              ┃
        confirm┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Dennoch habe ich 14.000 ARB in meiner Brieftasche, plus SOL für Gasgebühren usw. Was meint ihr?

Löschen Sie die Zeilen 217-240 aus /src/utils/index.js

@snurfer0
Hello, I have the same problem but you can't delete all of the lines 217 -240 then the export no longer works. Which lines do you have to delete for it to work?? these are the lines 217-240 for me

    return true;
} catch (err){
    console.clear(); // Clear console before displaying message
    displayMessage("You do not seem to be ARB ready!\n\nCheck the .ENV file to see your RPC is set up properly and your wallet is set to the correct private key.");
    process.exit(1);
}

};

module.exports = { createTempDir, storeItInTempAsJSON, createConfigFile, loadConfigFile, verifyConfig, calculateProfit, toDecimal, toNumber, updateIterationsPerMin, checkRoutesResponse, checkForEnvFile, checkArbReady, checkWallet, };