Skip to content

Commit

Permalink
Connext on simnet (#97)
Browse files Browse the repository at this point in the history
* add connext, remove native simnet guide, misc wording fixes

* rm: native simnet guide

* fix: more raiden -> connext fixes

* fix: shorten wording to avoid line break on most screen sizes

* chore: simplify docker install instructions

* fix: misc

* fix: swap only needed for Pi models with less than 2GB of RAM

* fix: docker link formatting

* fix: add simnet create

* fix: switch simnet status to "live"

* ubuntu 18.04 -> 20.04

* fix: @sangaman @peartobear review

* fix: ubuntu 20.04 docker install instructions clarification

* fix: remove connext --help (there is no cli)
  • Loading branch information
kilrau authored May 15, 2020
1 parent 570bd95 commit 8fc01a1
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 280 deletions.
10 changes: 2 additions & 8 deletions BeastXUD.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,11 @@ Two options are available:

## Setup

1. [Download Ubuntu Server](https://ubuntu.com/download/server) onto your computer. Any other linux distribution supporting docker is also fine.
1. [Download Ubuntu Server 20.04 LTS](https://ubuntu.com/download/server) onto your computer. Any other linux distribution supporting docker is also fine. This guide was written assuming `Ubuntu Server 20.04 LTS`.
2. Insert a USB Stick into your computer and [create the a bootable USB Stick](https://ubuntu.com/tutorials/tutorial-create-a-usb-stick-on-ubuntu) with the ubuntu image you just downloaded.
3. Open your Mini PC, plug in RAM & drives, close it, connect it to your router via ethernet cable and to a power supply. Connect a screen via HDMI, a USB keyboard, the created bootable USB Stick, fire the Mini PC up and follow the the inital setup instructions.
4. Update ubuntu via `sudo apt update && sudo apt upgrade`
5. Install docker following the [official instructions](https://docs.docker.com/install/linux/docker-ce/ubuntu/). At the time of writing, ubuntu 19.10 was still not supported in the official docker repos. If you see an error along the lines `'docker-ce' has no installation candidate` in step 4 of the docker instructions, run this instead:
```bash
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
disco \
stable"
```
5. If you are using Ubuntu 20.04 LTS, install docker by running `sudo apt install docker.io`. Otherwise if you are using any version besides Ubuntu 20.04, follow the [official instructions](https://docs.docker.com/install/linux/docker-ce/ubuntu/) to install docker.
6. Add new user `xud`:
```bash
ubuntu@ubuntu:~$ sudo adduser xud
Expand Down
8 changes: 4 additions & 4 deletions Developer Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ xud@ubuntu:~$ nano ~/.xud-docker/simnet/simnet.conf
expose-ports = ["30009:10009"]
[lndltc]
expose-ports = ["31009:10009"]
[raiden]
expose-ports = ["25001:5001"]
[connext]
expose-ports = ["25040:5040"]
# CTRL+S, CTRL+X.
```
2. Start the `xud-simnet` with default settings as described [here](Market%20Maker%20Guide.md).
Expand Down Expand Up @@ -88,10 +88,10 @@ nomacaroons = false
port = 31009
certpath = "/home/<youruser>/lndltc/tls.cert"
macaroonpath = "/home/<youruser>/lndltc/data/chain/litecoin/simnet/admin.macaroon"
[raiden]
[connext]
disable = false
host = "localhost"
port = 25001
port = 25040
```
8. Now you can start your local `xud` instance and it should connect to the running `xud-simnet` docker environment. You can check that everything works with `~/xud/bin$ ./xucli -p 28886 getinfo`. Ready to test your changes on `xud-simnet`!

Expand Down
32 changes: 15 additions & 17 deletions Market Maker Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ This guide is written for individuals and entities looking to run xud in order t

## Three Networks

1. **Simnet**. `Status: maintenance | Mode: light | Required CPUs: 2 , RAM: 2 GB , Disk: 1 GB , Time: 15 mins`
1. **Simnet**. `Status: live | Mode: light | Required CPUs: 2 , RAM: 2 GB , Disk: 1 GB , Time: 15 mins`

Private chains which are maintained by Exchange Union. We’ll automatically open channels to you and push over some coins, you’ll be trading against our bots and anyone else running simnet. It’s the perfect playground to see how things work and get familiar with `xucli` commands. It’s easy: run the launch script, wait for about 15 minutes and you are ready to go. **You want to start with this!**
Private chains which are maintained by Exchange Union. We’ll automatically open channels to you and push over some coins, you’ll be trading against our bots and anyone else running simnet. It’s the perfect playground to see how things work and get familiar with `xucli` commands. It’s easy: run the launch script, create the environment, wait for about 15 minutes for your balance (`getbalance`) and you are ready to go. **You want to start with this!**

2. **Testnet**. `Status: maintenance | Mode: light/full | Required CPUs: 2/4 , RAM: 2/16 GB , Disk: 1/200 GB , Time: 15 mins/5-24h`

Expand All @@ -34,9 +34,9 @@ Since market makers should be online 24/7 and we are ushering in a post-cloud er

## Software

* Linux or macOS. [Windows WSL 2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install) support is currently experimental and not tested regularly. This guide was written using ubuntu 18.04.
* Linux or macOS. [Windows WSL 2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install) support is currently experimental and not tested regularly. This guide was written assuming Ubuntu 20.04 LTS.

* Docker >= 18.09. Check with `docker --version`. If you do not have docker installed yet, follow the official [install instructions](https://docs.docker.com/install/). Also make sure that the current user can run docker (without adding `sudo`). Test with `docker run hello-world`. If this fails, [follow these instructions](https://docs.docker.com/install/linux/linux-postinstall/).
* Docker >= 18.09. Check with `docker --version`. If you do not have docker installed yet and you are using Ubuntu 20.04 LTS, install docker by running `sudo apt install docker.io`. Otherwise if you are using any version besides Ubuntu 20.04, follow the [official install instructions](https://docs.docker.com/install/). Also make sure that the current user can run docker (without adding `sudo`). Test with `docker run hello-world`. If this fails, [follow these instructions](https://docs.docker.com/install/linux/linux-postinstall/).

# The Setup

Expand All @@ -52,7 +52,7 @@ xud@ubuntu:~$ nano ~/.xud-docker/mainnet/mainnet.conf
mode = "neutrino"
[litecoind]
mode = "neutrino"
# add these lines for raiden to use your infura account instead of a local geth node:
# add these lines for connext to use your infura account instead of a local geth node:
[geth]
mode = "infura"
infura-project-id = "abc"
Expand Down Expand Up @@ -152,7 +152,7 @@ mainnet > status
├───────────┼────────────────────────────────────────────────┤
│ lndltc │ Waiting for sync │
├───────────┼────────────────────────────────────────────────┤
raiden │ Container running
connext │ Waiting for sync
├───────────┼────────────────────────────────────────────────┤
│ xud │ Waiting for sync │
└───────────┴────────────────────────────────────────────────┘
Expand All @@ -175,7 +175,7 @@ mainnet > status
├───────────┼────────────────────────────────────────────────┤
│ lndltc │ Waiting for sync │
├───────────┼────────────────────────────────────────────────┤
raiden │ Container running
connext │ Waiting for sync
├───────────┼────────────────────────────────────────────────┤
│ xud │ Waiting for sync │
└───────────┴────────────────────────────────────────────────┘
Expand All @@ -198,7 +198,7 @@ mainnet > status
├───────────┼────────────────────────────────────────────────┤
│ lndltc │ Ready │
├───────────┼────────────────────────────────────────────────┤
raiden │ Ready │
connext │ Ready │
├───────────┼────────────────────────────────────────────────┤
│ xud │ Ready │
└───────────┴────────────────────────────────────────────────┘
Expand Down Expand Up @@ -226,13 +226,13 @@ mainnet > listpeers -j
"inbound": false,
"pairsList": [
"LTC/BTC",
"WETH/BTC",
"ETH/BTC",
"BTC/DAI",
"LTC/DAI"
],
"xudVersion": "1.0.0-beta",
"secondsConnected": 100,
"raidenAddress": "0xe802431257a1d9366BD5747F0F52bAd25A6C3092"
"connextAddress": "0xe802431257a1d9366BD5747F0F52bAd25A6C3092"
}
]
}
Expand All @@ -245,7 +245,7 @@ On Simnet simply wait for about 15 minutes and you'll have channels and are read
```bash
lndbtc-lncli newaddress p2wkh #Send BTC to this address
lndltc-lncli newaddress p2wkh #Send LTC to this address
getinfo -j #Send WETH/DAI to your raiden address
getinfo -j #Send ETH/ETH-ERC20 Tokens to your connext address
```

The next step will have an automated option in future, but currently is not trivial: choose a xud node to open a channel with. Ideally, these are nodes you expect to trade with regularly. If you are unsure, you can open a channel with our xud node available at xud1.exchangeunion.com. Opening a 0.1 btc channel would look like:
Expand Down Expand Up @@ -290,7 +290,7 @@ Balance:
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ LTC │ 21 │ 11 │ 10 │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
WETH │ 500 │ 500 │ 0 │
ETH │ 500 │ 500 │ 0 │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘
```

Expand All @@ -316,7 +316,7 @@ Balance:
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ LTC │ 21 │ 11 │ 10 │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
WETH │ 500 │ 500 │ 0 │
ETH │ 500 │ 500 │ 0 │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘
```

Expand Down Expand Up @@ -351,7 +351,6 @@ rpc-password = "pass"
zmqpubrawblock = "192.168.1.42:28332"
zmqpubrawtx = "192.168.1.42:28333"
```
* Raiden currently requires direct channels with trading partners. 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](https://github.com/ExchangeUnion/xud/issues/1068).
* Permanently set the alias `xud` to launch `xud ctl` from anywhere:
Add the line `alias xud="bash ~/xud.sh"` to the end of `~/.bashrc` or `~/.bash_aliases` on Linux and `bash_profile` on Mac, then `source` the file.
* `xud ctl` allows to use an L1/L2 client's cli:
Expand All @@ -361,12 +360,11 @@ litecoin-cli --help
geth --help
lndbtc-lncli --help
lndltc-lncli --help
raiden --help
xucli --help
```
* To inspect logs:
```bash
logs bitcoind/litecoind/geth/lndbtc/lndltc/raiden/xud
logs bitcoind/litecoind/geth/lndbtc/lndltc/connext/xud
```
* You can `exit` from `xud ctl` any time and re-enter with `bash ~/xud.sh`.
* A reboot of your host machine does **not** restart your `xud-docker` environment by default. You will need to run `bash ~/xud.sh` and `unlock` your environment.
Expand All @@ -386,5 +384,5 @@ rm -rf /custom/mainnet/dir
* [litecoind config options](https://litecoin.info/index.php/Litecoin.conf#litecoin.conf_Configuration_File)
* [geth config options](https://github.com/ethereum/go-ethereum/blob/master/README.md#configuration)
* [lnd config options](https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf)
* [raiden config options](https://raiden-network.readthedocs.io/en/stable/config_file.html)
* [connext config options](https://docs.connext.network/en/latest/userDocumentation/clientInstantiation.html#client-options)
* [xud config options](https://github.com/ExchangeUnion/xud/blob/master/sample-xud.conf)
2 changes: 1 addition & 1 deletion Native Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sudo npm install xud -g --unsafe-perm

## Daemonize `xud`

If you want to daemonize `xud` so it starts on boot without needing its own terminal, you can do this using `systemd`. The following sample `systemd` configuration was tested on Ubuntu 18.04:
If you want to daemonize `xud` so it starts on boot without needing its own terminal, you can do this using `systemd`. The following sample `systemd` configuration was tested on Ubuntu 20.04:

```bash
[Unit]
Expand Down
Loading

0 comments on commit 8fc01a1

Please sign in to comment.