Skip to content
Kilian Rausch ⚡️ edited this page Jul 11, 2019 · 71 revisions

This article explains how to use xud-docker, a containerized xud environment for

  • simnet: this is where you start - private chains maintained by exchange union cloud instances, automatic channel management and allocation of coins, trading against bots | Status: live | Setup time: ~15 mins | Recommended available disk space: 5 GB
  • testnet: bitcoin testnet 3, litecoin testnet 4, ethereum ropsten | Status: in development | Setup time: ~5-10h | Recommended available disk space: 120 GB
  • mainnet: put your #reckless hat on | Status: in development | Setup time: ~1-3 days | Recommended available disk space: 500 GB
  • regtest: producing blocks locally | mainly for development | Status: not available

Requirements

  1. Linux, macOS or Windows with WSL 2

  2. docker >= 18.09

$ docker --version
Docker version 18.09.6, build 481bc77
  1. docker-compose >= 1.24
$ docker-compose --version
docker-compose version 1.24.0, build 0aa59064
  1. current user can run docker (without sudo)
$ docker run hello-world

If step 4 fails check these instructions. If you do not have docker installed yet, follow the official install instructions for docker and docker-compose.

How to run

Start the environment with

curl https://raw.githubusercontent.com/ExchangeUnion/xud-docker/master/xud.sh -o ~/xud.sh
bash ~/xud.sh
 

This guides you through a setup on first run, pulls all containers, starts syncing chains and opens

                           .___           __  .__   
          ___  _____ __  __| _/     _____/  |_|  |  
          \  \/  /  |  \/ __ |    _/ ___\   __\  |  
           >    <|  |  / /_/ |    \  \___|  | |  |__
          /__/\_ \____/\____ |     \___  >__| |____/
                \/          \/         \/           
--------------------------------------------------------------

xud ctl takes xucli commands, like getinfo or orderbook.

The status command shows status of underlying clients, which is useful to track the sync status for testnet/mainnet:

btc	Ready
lndbtc	Ready
ltc	Syncing 2.40% (26887/1116528)
lndltc	Waiting for sync
parity	Syncing 42.61% (2489756/5842588)
raiden	Waiting for sync
xud	Waiting for sync

Beware

Raiden currently requires direct channels with trading partners to swap reliably. We have a temporary check in place, that discards raiden-related orders (all pairs which include WETH, DAI...), if xud can't find a direct channel to the trading partner. You can switch this check off by setting raidenDirectChannelChecks=false in your xud.conf. Before you do that, read this explainer of the issue.

Other useful things

  • We recommend to open ports 8885 (xud), 9735 (lndbtc) & 10735 (lndltc) to enable other peers to open channels to you. Simnet does not necessarily need this.
  • xud ctl allows to use an underlying client's cli:
#Simnet
ltcctl --help

#Testnet/Mainnet
bitcoin-cli --help
lndbtc-lncli --help
litecoin-cli --help
lndltc-lncli --help
parity --help
raiden --help
xucli --help
  • Once everything is up and running, you can check existing orders of your connected peers with xucli orderbook and issue e.g. a buy order of 1 ltc with buy 1 ltc/btc 0.01.
  • Permanently set xud alias to launch xud ctl from anywhere: Add the line alias xud="bash ~/xud.sh" to the end of ~/.bashrc, then run source ~/.bashrc.
  • To inspect logs (use logs -f if you want to follow the log live):
#Simnet
logs ltcd/geth/lndbtc/lndltc/raiden/xud
#Testnet/Mainnet
logs bitcoind/litecoind/parity/lndbtc/lndltc/raiden/xud
  • Blockchain & wallet data is stored in
#Simnet
~/.xud-docker/simnet/data
#Testnet
~/.xud-docker/testnet/data
#Mainnet
~/.xud-docker/mainnet/data
  • Shutdown environment & remove all data
docker-compose down
# Use with caution: this step removes all `xud` blockchain and wallet data from your system. If you still have channels open or lost your seed mnemonic, you are risking to loose funds.
rm -rf ~/.xud-docker/
rm -rf ~/xud.sh

References

Help us to improve!

xud is in alpha stage, as well as this wiki. Please help us to improve by opening issues (or even better PRs) for xud, xud-docker, xud-simnet and this wiki.

Feel like talking? Chat with us on Discord!

Clone this wiki locally