Node Deployment

Server Configuration

It is recommended to use Ubuntu 20 and above or CentOS 8 and above, and ensure a stable public IPv4 connection.

  • CPU: 2 Cores

  • Memory: 4 GB

  • Storage: 40 GB

Quick Deployment

# Log in to the remote server
ssh [email protected]
# See below for environment variable configuration requirements
export DOTSWAP_ACCOUNT_ADDRESS=tb1qmlp2ghv2xfv6h2ypmg9gt58uhmegse6c3tyhzq
export DOTSWAP_ACCOUNT_PRIVATE_KEY_HEX=853ac0c5ba7f629c20a8df8a86ae98e18a47c1262502e8a6ad0d074f3c2cf1af
export MNEMONIC='trumpet ten limb stay exact seven digital verify chronic solve face syrup'
export POOLS_BTC_DOGGOTOTHEMOON=tb1qmlp2ghv2xfv6h2ypmg9gt58uhmegse6c3tyhzq
export POOLS_BTC_BILLIONDOLLARCAT=tb1q7qfcw03psf3tla59ahdazu2huh7vru27k24qnl,tb1pau57plr6p56984zq9xlku5ferak2jjux5ljzajlr4t6ks6lm989s6ph428

curl -fsSL https://get.docker.com | bash -s docker
env | grep '^POOLS_' > .env
curl -fsSL https://images.swap.dotwallet.com/dotswap_dex/docker-compose-v2.yml | docker compose -p dotswap-dex -f - up -d --force-recreate

# If you need to run with sudo privileges, use the following script
sudo curl -fsSL https://get.docker.com | sudo bash -s docker
env | grep '^POOLS_' > .env
sudo curl -fsSL https://images.swap.dotwallet.com/dotswap_dex/docker-compose-v2.yml | sudo -E docker compose -p dotswap-dex -f - up -d --force-recreate

Remember to use your own address/private key/mnemonics

Manual Deployment

Docker Installation

The recommended way to deploy DOTSWAP DEX is using Docker. To install Docker, please refer to Docker's Installation Guide. For questions regarding Docker installation, please refer to Docker's Troubleshooting Guide.

# Install Docker
curl -fsSL https://get.docker.com | bash -s docker

Get Deployment Script

Download the latest configuration file docker-compose.yml from DOTSWAP.

Environment Variable Configuration

Before running DEX, you need to modify the following environment variables in docker-compose.yml:

  • DOTSWAP_ACCOUNT_ADDRESS: The wallet address to register with DotSwap Nexus as the Market Making Account.

  • DOTSWAP_ACCOUNT_PRIVATE_KEY: The private key of the wallet address to register with DotSwap Nexus, used to prove ownership of this address.

  • MNEMONIC: The wallet mnemonic phrase for allowing the independent DotSwap Nexus instance to sign transaction and provide liquidity.

  • POOLS_BTC_TOKEN: The key is the names of the involved tokens in a trading pair, and the value is the address information for providing liquidity. For example:

    • To provide liquidity for BTC and DOG•GO•TO•THE•MOON, the environment variable is configured as POOLS_BTC_DOGGOTOTHEMOON:addr

    • If BTC and DOG•GO•TO•THE•MOON are provided liquidity from different addresses (e.g. you're using Xverse wallet), the environment variable is configured as POOLS_BTC_DOGGOTOTHEMOON:addr1,addr2

    • Multiple trading pairs can be configured, but one address can only be configured for one trading pair.

    • Note that Token names should not contain the • symbol.

Configuration Example

Pay attention to the indentation level of the YAML configuration to ensure it is correct. If the value of a configuration item is a multi-line string, use | or > correctly to maintain the format and follow YAML's indentation rules.

services:
  service:
    environment:
      DOTSWAP_ACCOUNT_ADDRESS: tb1qmlp2ghv2xfv6h2ypmg9gt58uhmegse6c3tyhzq
      DOTSWAP_ACCOUNT_PRIVATE_KEY_HEX: 853ac0c5ba7f629c20a8df8a86ae98e18a47c1262502e8a6ad0d074f3c2cf1af
      MNEMONIC: trumpet ten limb stay exact seven digital verify chronic solve face syrup
      POOLS_BTC_DOGGOTOTHEMOON: tb1qmlp2ghv2xfv6h2ypmg9gt58uhmegse6c3tyhzq
      POOLS_BTC_BILLIONDOLLARCAT: tb1q7qfcw03psf3tla59ahdazu2huh7vru27k24qnl,tb1pau57plr6p56984zq9xlku5ferak2jjux5ljzajlr4t6ks6lm989s6ph428

Start Service

Check the docker-compose version; it needs to be greater than 1.21.0.

docker-compose -v
# docker-compose version 1.17.1 ❌
# or
docker compose verison  # Note: There is a typo in the original document, "verison" should be "version"
# Docker Compose version v2.32.4 ✅

Execute the following command in the terminal to start DOTSWAP DEX:

# Execute in the command line
docker compose -f docker-compose.yml up -d 
# or 
docker-compose -f docker-compose.yml up -d 

Access Service

After successful startup, you can access it via http://localhost:17610.

Security Operations

# Clear environment variables
unset DOTSWAP_ACCOUNT_PRIVATE_KEY_HEX
unset MNEMONIC

# Clear command history
history -c 

Last updated

Was this helpful?