Dexalot Hummingbot Stepping Stones Part II

Published by AVAX on

Installing Hummingbot and Gateway

Dexalotls keep stepping. You’ve seen how easy it is to enter the Avalanche-Dexalot-Hummingbot Dminer campaign by connecting your wallet. Now it’s time to install Hummingbot and Gateway and get you ready to run a bot on Dexalot. Hummingbot has recently added Docker Compose, enabling you to run both Humminbot and Gateway in the same workflow. This makes creating a bot to connect to Dexalot relatively easy. Follow along in this multipart series and start market making on Dexalot!

This tutorial will show you how to install Hummingbot and Gateway using Docker Compose on Windows WSL2.

You can also install them on Linux or Mac or from source.

Step 1 — install WSL2

Microsoft reduced the WSL2 installation process down to just one command for Windows 11 and Windows 10 version 2004 and higher (Build 19041 and higher).

Open a power shell or a command prompt window with admin privileges and run wsl.exe –install. Once you hit enter, the process will automatically;

  • enable the WSL optional features required;
  • install the Ubuntu distribution by default ( select 20.04),
  • and install the latest WSL Linux kernel version onto your machine.

When it’s completed, restart your machine — your distribution will start after you boot up again, completing the installation.

  • Now type wsl in the Powershell or in the Command prompt.

Notice that the first time WSL is executed, you will be asked to create a new default username/password; write this down.

With WSL installed, you now have a Linux Virtual Machine running under Windows. You can access your Ubuntu distribution from the start menu.

Check out the Hummingbot Windows installation page for more information and help.

Step 2 — install Docker Desktop

This installation includes Docker Compose along with Docker Engine and Docker CLI which are Compose prerequisites. Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services.

Verify that Docker Compose is installed correctly by checking the version in your Ubuntu terminal:

  • docker compose version

The output should be: Docker Compose version v2.17.2 or similar.

Step3 — Clone Hummingbot’s deploy-examples repository and download its Docker image

Open Ubuntu on Windows from your Start Menu and clone the Humminbot deploy-examples repository at a root location of your choice. The deploy-examples Github repository provides various examples of how to deploy Hummingbot and Gateway, including using Docker Compose.

Dexalot has been integrated on the development branch only, so switch to that branch if you are not already there.

  • git switch development

Now use the following commands to download the Docker image.

  • cd deploy-examples/hummingbot_gateway_compose
  • docker compose up -d

After the images have been downloaded, which may take a few minutes, you should see the following output:

[+] Running 3/3

⠿ Network hummingbot_gateway_compose_default Created

⠿ Container hummingbot Started

⠿ Container gateway Started

Step 4 — Set permissions, attach Hummingbot and generate certificates

In order to grant read/write permission to the hummingbot_files and gateway_files sub-folders, run the following command from where you added the deploy-examples directory:

  • sudo chmod -R a+rw ./hummingbot_files ./gateway_files ( you will need the password you created when you set up WSL2 above).

Now, attach to the hummingbot instance:

  • docker attach hummingbot

Follow the prompts and set your Hummingbot password and write it down. Do not forget this password. You will not be able to get it back (directions to reset your password). If everything goes correctly you will see:

Now run the following command to generate Gateway certificates:

  • gateway generate-certs

You’ll be prompted for a passphrase used to generate the certificates. This is the GATEWAY_PASSPHRASE environment variable in your docker-compose.yml file — write this down. Hummingbot will use the passphrase to generate the certificates and save them in the hummingbot_files/certs folder, where the Gateway instance will look for the certificates it needs.

Now exit Hummingbot with,

  • exit

and remove the Docker Compose project with,

  • docker compose down

You should see the following output:

[+] Running 3/3

⠿ Container gateway Removed

⠿ Container hummingbot Removed

⠿ Network hummingbot_gateway_compose_default Removed

Step 5 – Edit your .yml file with your new certifications and recreate your project

Use an IDE like VSCode or Nano to edit the docker-compose.yml file.

Edit the section that defines CONFIG_FILE_NAME environment variables by uncommenting out the two lines shown below. Add your passphrase you wrote down above when generating your certificates.

Save the edited file.

Now, recreate the Compose project:

  • cd deploy-examples/hummingbot_gateway_compose
  • docker compose up -d

Attach to the hummingbot instance again,

  • docker attach hummingbot and enter your password.

You should now see GATEWAY:ONLINE in the upper-right hand corner.

You may see some error messages in the right-sided pane but these are not necessarily critical to the functionality you may be using. Hummingbot is a local client software that you run on your own machine, so you have full control over how it’s configured. No one else can access your data and information! Learn more about the Hummingbot interface here.

That’s it, you are now ready to connect to Dexalot and start a bot!

When you are done exploring Hummingbot type:

  • stop
  • exit
  • docker compose down

If you have questions or need help, join the official Hummingbot Discord and ask for help in the #support channel. You can ask for assistance on Dexalot’s Discord too!

Author: Brad McFall

Editor: Dan Marcoulis

Graphics: Can Toygar

About Dexalot:

Dexalot is a revolutionary decentralized exchange bringing the traditional centralized exchange look and feel to a decentralized on-chain application. Its mission is to bring a truly inclusive and transparent environment where Dexalot users can trade crypto securely and efficiently, with no slippage or custody risk. It is built on Avalanche, the fastest smart contracts platform in the blockchain industry.

Website | Twitter | Telegram | Medium |Discord

Dexalot Hummingbot Stepping Stones Part II was originally published in Dexalot on Medium, where people are continuing the conversation by highlighting and responding to this story.


Categories: DEFI_NEWS