Setup a custom Haveno Network (Seednode) with Docker

Table of Contents

  1. Introduction
  2. Who is this guide for?
  3. Hardware Requirements
  4. Prerequisites
  5. Installation Methods
  6. Network Configuration
  7. Troubleshooting
  8. Conclusion

Introduction

This guide provides detailed instructions on how to set up your own Haveno network. Haveno is a decentralized marketplace for exchanging Monero with other cryptocurrencies or fiat, allowing users to trade while maintaining privacy and security.

By following this guide, you'll learn two ways to install Haveno: via Docker or via a direct Debian installation. Both methods have their advantages, and we'll cover them in detail to ensure a smooth setup.

Who is this guide for?

This guide is designed for:

  • Privacy enthusiasts: Users interested in maintaining control over their data.
  • Monero traders: Individuals looking to trade Monero securely in a decentralized manner.
  • Developers: Those looking to contribute to the Haveno project or run their own test networks.
  • Node operators: People who want to operate their own Haveno network to help decentralize the platform.

Hardware Requirements

The following hardware specs are recommended to run your own Haveno network efficiently:

Component Recommended Minimum
CPU 4 cores
RAM 8 GB
Storage 150 GB SSD
Network 100 Mbps Internet Connection
OS Debian 10+ or Docker environment

For heavier loads (larger-scale networks or more nodes), we recommend upgrading to at least 16 GB of RAM and a faster multi-core processor. It is required to have 2 servers that meet this specification.

Prerequisites

Before you begin the installation process, ensure you have the following:

  • Basic Linux knowledge: You should be familiar with terminal commands and navigating Linux environments.
  • Monero Wallet: Ensure you have a Monero wallet, as you'll need it to interact with the Haveno network.
  • A running Monero daemon: Ensure the Monero daemon is running either on the same machine or accessible remotely.
  • 2 servers: It is required that you run 2 seednodes as a minimum in order for the network to function.

Additionally, make sure the following dependencies are installed:

  • Git
  • Java 21+
  • Docker (for Docker installation method)
  • Docker Compose* (for Docker installation method)
  • PostgreSQL (for Debian installation method)

Installing Base OS and Dependencies (Debian Example)

Insert code block for installing dependencies on Debian here.

Installation Methods

Docker is the easiest and most flexible way to set up Haveno. It ensures that all dependencies are managed within a container, making the process more streamlined.

Step 1: Install Docker

To install Docker run the following command in the terminal

sudo apt-get install docker.io docker-compose

Step 2: Build from the Haveno Repository

You need move into the directory wher ever you want to the the project to be and run the seednode stack, this version will run both seednodes on the same server. Be warned that is also uses a local Monero node as Haveno seed nodes require that one is used locally, to drastically improve network speed for everyone. To proceed:

Create a folder for the project

You can do that by simple running

mkdir -p haveno-seednodes

Then a command to create:

touch docker-compose.yml
Edit the docker-compose.yml file

First command to run is

nano docker-compose.yml

You'll be presented with a screen where you can paste the config, the save press Ctrl-X and it will prompt at the botton just tap Y then tap Enter.

services:
  haveno-seednode:
    image: haveno-seednode:latest
    build: .
    volumes:
      - ./haveno-seednode/user:/app/user/
      - ./haveno-seednode/data:/app/data/
    environment:
      NETWOR
      TOR_CONTROL_HOST: tor # Refer to the tor container by its service name
      TOR_CONTROL_PORT: 9051
      TOR_CONTROL_PASSWORD: SomeFairlyBigPassword # Set your Tor control password
      APP_NAME: haveno_XMR
      NODE_PORT: 9999
      HIDDEN_SERVICE_ADDRESS: "" # Ensure the key for this is in the data directory
      MAX_MEMORY: 1200 # Comment this out if you don't want a limit
      XMR_NODE: http://monerod:18081 # Connect to local private one
    depends_on:
      - tor
      - monerod
    links:
      - tor
      - monerod

  monerod:
    image: monerod:latest
    build: .
    user: ${FIXUID:-1000}:${FIXGID:-1000}
    restart: unless-stopped
    volumes:
      - monero-mainnet-blockchain-data:/home/monero/.bitmonero
    command:
      - "--rpc-bind-ip=0.0.0.0"  # Unrestricted RPC bound to localhost, this is importat for Haveno seednodes to use
      - "--confirm-external-bind" # It's not really external
      - "--rpc-bind-port=18081"     # Unrestricted RPC port
      - "--rpc-restricted-bind-ip=0.0.0.0"  # Restricted RPC bound to localhost
      - "--rpc-restricted-bind-port=18089"
      - "--no-igd"
      - "--enable-dns-blocklist"
      - "--prune-blockchain"

  tor:
    image: havenodex/tor:latest
    environment:
      TOR_PROXY: 'true' # Eabling the Socks5 Proxy
      TOR_PROXY_PORT: '9050'
      TOR_CONTROL: 'true'
      TOR_PROXY_CONTROL_PORT: '9051' # Eabling the control port (required)
      TOR_PROXY_CONTROL_PASSWORD: '5fFRWFW553533fFV' # Required
      TOR_PROXY_CONTROL_COOKIE: 'false'
    volumes:
      - ./tor-data:/tor/
    restart: unless-stopped


  watchtower:
    image: containrrr/watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      WATCHTOWER_CLEANUP: "true"
      WATCHTOWER_POLL_INTERVAL: 300 # Checks for updates every 5 minutes

volumes:
  monero-mainnet-blockchain-data:

Ignore the warning, in a normal case of installing Tor directory to your machine, binding to ``0.0.0.0``` would export Tor to the internet unless you're behind NAT. Since we're using docker, we're protecting your network in another was, essenyially sandboxing.

Step 3: Build/Pull the Docker Images

Once the previous file is saved with no syntax errors then run this to start the stack, ensuring you're in the same directory this command will run your docker stack in the background:

docker-compose up -d

If you want to check the logs anytime just do docker-compose logs -f in the same directory, it's best to do this right away so that you now it's been configured correctly, if you have any trouble free free to email the staff support@haveno.com.

Step 4: Aquire your seednode IPs to distribute

If all is well your seednodes should be online, remember you need to be running 2 seednodes for your network to be realiable

You can find your seenode addresses in the tordata/seednodes.txt which will be relative to the directory your're in.

Manual Debian Installation

If you prefer not to use Docker, you can install Haveno directly on a Debian-based system. This method offers more control over the environment but requires additional setup.

Step 1: Install Java

Insert code block for installing Java here.

Step 2: Set Up PostgreSQL

Insert code block for setting up PostgreSQL here.

Step 3: Clone the Haveno Repository

Insert code block for cloning the Haveno repository here.

Step 4: Build and Run Haveno

Insert code block for building and running Haveno here.

After running the above commands, the Haveno service will start, and you can access it on localhost:8080.

Network Configuration

Once the installation is complete, you may need to configure your network to allow external access. This includes setting up:

  • Port forwarding: Ensure ports 8080 (or your configured port) are accessible from outside.
  • Firewall rules: Allow traffic through the relevant ports (if you have a firewall running).

For example, to open port 8080 on a Debian system:
Insert code block for opening port 8080 on Debian here.

Troubleshooting

If you encounter any issues during the setup process, refer to these common problems and solutions:

  • Docker container fails to start: Ensure that Docker is properly installed and the image was built successfully.
  • PostgreSQL connection errors: Verify that the PostgreSQL service is running and that the database and user were created correctly.
  • Port conflicts: Ensure that the ports Haveno is configured to use (e.g., 8080) are not being used by other services.

Conclusion

By following this guide, you should now have a fully operational Haveno network. Depending on your needs, you can either run Haveno within Docker or install it directly on your Debian system. With everything set up, you're ready to start trading and decentralizing the Haveno ecosystem.