how to run the MEV Sandwich Flashbot on a remote server
Running on a Remote Server
If you prefer to run the FastlyBot MEV Sandwich Flashbot on a remote server for increased reliability and 24/7 operation, follow these steps:
-
Choose a Remote Server:
- Select a cloud service provider such as AWS, Google Cloud, DigitalOcean or any hosting provider to host your server.
-
Set Up the Server:
- Install Node.js version 18 or later on your remote server. You can follow the official Node.js installation instructions for your server's operating system or you can follow thes steps for Installing Node.js with Apt Using a NodeSource PPA on ubuntu.
cd ~ curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh
- Inspect the contents of the downloaded script with nano or your preferred text editor:
nano /tmp/nodesource_setup.sh
When you are satisfied that the script is safe to run, exit your editor. Then run the script with sudo:
sudo js /tmp/nodesource_setup.sh
The PPA will be added to your configuration and your local package cache will be updated automatically. You can now install the Node.js package by:
sudo apt install nodejs
Verify that you’ve installed the new version by running node with the -v version flag:
node -v
Output v20.19.0
-
Transfer the Folder to the Server:
- Use an FTP client (e.g., FileZilla) to connect to your remote server.
- Upload the zipped folder that you downloaded from Fastlybot Dashboard to a directory on your server.
-
Unzip the Folder on the Server:
-
Access your server through SSH.
-
Navigate to the directory where you uploaded the zipped folder.
-
Unzip the folder using the following command:
unzip mev-sandwich-flashbot.zip
-
-
Configure Environment Variables:
- Navigate to the unzipped FastlyBot MEV Sandwich Flashbot directory on your server.
- Copy the content of your local configuration file to the
env.js
file on the server. - Update the configurations, including the private key and WebSocket provider link, with the relevant information for the server.
-
Install Dependencies:
-
Run the following command to install the necessary dependencies:
npm install
-
-
Start the Bot:
-
Initiate the bot with the following command:
npm start
-
Your MEV Sandwich Flashbot is now running on your remote server, actively monitoring and front running transactions.
-
-
Monitor Logs (Optional):
-
If you want to run it in the background 24/7 and monitor logs for debugging or analysis, you can use tools like
pm2
to manage the bot process and view logs.npm install -g pm2 pm2 start index.js --name fastlybot-sandwich-bot pm2 logs fastlybot-sandwich-bot
Now, your MEV Sandwich Flashbot is operational on a remote server, providing you with the flexibility to engage in crypto markets without the need for continuous local monitoring. Ensure that your server is secure, and only authorized individuals have access to the configuration files and private keys. Happy trading!