Setting up a Raspberry Pi for Crypto Trading Bots

Here we have a complete tutorial on setting up your Raspberry Pi to run crypto trading bots for you with no downtime - just don't unplug it! Beginner friendly.

Setting up a Raspberry Pi for Crypto Trading Bots

Raspberry Pis are a range of very affordable and easy to use development boards, you can usually pick up a Raspberry Pi Zero W for under $10 depending on your location. Good news is, even their cheapest hardware, will be more than enough to power your own crypto trading bots for Saturn Network. If you do not move around too much and your home internet is reliable to keep your Raspberry Pi online day and night, then this could be an ideal solution for you. And of course, it is a lot of fun to build your own SaturnBox.

Terminal Example

Though if you don't like fiddling with hardware, remember we have a complete tutorial on setting up your own VPS for crypto trading bots.

Setting up a Raspberry Pi Zero W for crypto trading bots

For this tutorial, I am going to assume you have the Zero W model. I recommend it as it has WiFi support and is really small, which makes it easy to plug in somewhere where it will not be disturbed. Any Raspberry Pi will work perfectly though, so do not worry if you have a different model, the steps will be the same.

Materials

  • Raspberry Pi Zero W
  • microSD card (at least 8GB)
  • Power Supply (Micro USB cable)

Note that you will need to be able to flash your microSD card so will need to insert it into your computer or have a way to connect it. Most laptops have an SD slot, so you can use an SD adapter - SanDisk normally sells them together with a microSD card.

Raspbian Lite

Because we will only be interacting with our Raspberry Pi by command line to set up our crypto trading bots, we will use the Raspbian Lite version of the operating system. The lite simply means that it does not contain the GUI desktop in the operating system.

  1. Download the Raspbian Lite image from the official download page.
  2. Install Balena Etcher which we will use to flash your microSD card.
  3. Connect the microSD card to your computer, launch Etcher, select the Raspbian image file, select the SD card and flash it.

etcher_install

The flashing process may take a few minutes. One thing to remember is when Etcher finishes, it automatically unmounts your SD card. Remember to reinsert it, as we are not done yet!

Enable Wireless Networking and SSH Access

The Raspberry Pi Zero W has a built-in WiFi chip, you just need to provide the credentials to your wireless network to ensure it connects. With the SD card still in your computer, you should now see that Etcher has renamed the card to boot.

  1. Open the card's location and navigate to the /Volumes/boot/ directory.
  2. Create a new empty file called wpa_supplicant.conf.
  3. Open the file with your favourite text editor and fill it with the credentials for your wireless network, like this:
network={
  ssid="NETWORK_NAME"
  psk="NETWORK_PASSWORD"
  key_mgmt=WPA-PSK
}

Enable SSH

You will also need to enable SSH so that you can connect to your Raspberry Pi via command line. Assuming you are still in the /Volumes/boot/ directory, just create another empty file called ssh.

Connect to your board

Now it is finally time to connect to your Raspberry Pi! Insert the SD card into your Pi Zero W and connect it to your power source. It should power up, and immediately start booting up to connect to your wireless network - this could take up to 90 seconds. If you are on Windows, then I would recommend using Ubuntu On Windows. Linux or macOS users can simply launch their terminal application.

Your Pi should have the default hostname raspberrypi or raspberrypi.local along with the default password which is raspberry. Note that some suppliers change the default hostname. Using the hostname you should be able to SSH your board as:

~ ssh-keygen -R raspberrypi
~ ssh [email protected]

If this does not work for you, you will need to figure out the local IP address your router has assigned your Pi. The easiest way is to connect to your router's admin panel and check the devices connected to your WiFi network. Then you can SSH into your board as:

Change your default hostname

For security reasons, I recommend changing your default hostname and password. Once you have connected to your Pi, type in the following command sudo raspi-config. This will let you change the default hostname and password, make sure you write them down. Once those changes are made, you will need to reboot your Pi. You can do this with the following command: sudo shutdown -r now.

Once your board has rebooted, you can SSH back in using the new hostname and password that you just set.

Install the latest updates

And then the last thing you need to do before being ready to run crypto trading bots on your Pi would be to download and install the latest updates. Which you do with the following commands:

~ apt-get update -y
~ apt-get upgrade -y

Which crypto trading bots to run on your Raspberry Pi?

We have a full range of open-source crypto trading bots that you can run on your Pi to automate your trading strategies on Saturn Network. And with our Arbitrage bots being developed, now is the time to learn how to run them!

Here is our current list of crypto trading bots and tools, along with full tutorials on how to run them:

  • Pricewatch Bot - Execute buy or sell orders on Saturn following your trading strategy, a taker bot.
  • Market Maker Bot - Automatically create buy or sell orders following your strategy, engineered to keep a token's order book healthy.
  • GasToken Miner - Tokenize gas on Ethereum or Ethereum Classic by mining GST1 or GST2 tokens.
  • Airdrop Tool - Easily airdrop your token to hundreds of wallets after a successful bounty campaign.

Just remember to run any of our trading bots or tools, your Pi will need NodeJS installed. You can do that using the following commands:

~ sudo apt-get install build-essential
~ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

I would also recommend reading my tutorial on using Tmux to manage your processes, as it will provide you with a much better experience and let you create terminals like so:

Final Thoughts - could a SaturnBox happen?

Congratulations! You now have a working Pi connecting to your wireless network that can run your Saturn crypto trading bots for you with no downtime: your very own SaturnBox. Just don't unplug it or you may miss a profitable trade.

If you do follow this tutorial, would love to hear some feedback on your setup maybe even a photo? Come let us know on our forum!

In the future, I want to expand on these tutorials, covering setups for different brands of boards and creating scripts to make initial setups easier, monitoring for reboots to relaunch your trading bots automatically, or maybe even a modified OS so that we can truly say we are running a SaturnBox. Anything that can make our trading bots or tools be closer to a plug and play scenario, would be very beneficial.

This is not really something we can currently fit into our development plans but I believe this is something we can attempt to create together as a community, as Saturn DAO, so stay tuned!

Troubleshooting

Here are a couple of helpful links if anything goes wrong:

To never miss an update from Team Saturn be sure to follow us on Twitter, subscribe to our newsletter & join our community forum.

Loading...