This guide is intended to help developers who want to contribute to
xud. Developers who want to build on top of
xud, are invited to check out the API Documentation.
Be sure to read the Contribution Guidelines for the repository before starting to work or opening a Pull Request.
The following development environments are known to be compatible with
xud and are recommended for developers that are unsure what tools to use.
Visual Studio Code is a cross-platform code editor that's compatible with most popular programming languages and extensible via a large collection of plug-ins.
Consider using the following plugins for working with
Adding the two files from this gist into a
.vscode folder within the folder where you've cloned
xud will automatically provide debug configurations and general settings that are helpful when developing
Auto restart on every file change under
dist folder with
nodemon --watch dist -e js bin/xud
nodemon --watch dist -e js bin/xud --lndbtc.disable=true --lndltc.disable=true
We recommend to connect the
xud instance you are developing on with the
xud-simnet. Combined with above restarting mechanism, this let's you instantly see how your changes behave in a real-world trading environment.
xud-simnet as described here
Exit from the opened
xud ctl session by typing
simnet_xud_1 docker image with
docker stop simnet-xud_1 command, we won't need it.
~/.xud-docker/simnet/data/lndbtc into somewhere you can easily access (such as your home directory).
Ensure you own the copied folders.
chown -R <user>: <copied_path>/lndbtc|lndltc
xud.conf as below.
[lnd.BTC]cltvdelta = 144disable = falsehost = "localhost"nomacaroons = falseport = 10010certpath = "<copied_path>/lndbtc/tls.cert"macaroonpath = "<copied_path>/lndbtc/data/chain/bitcoin/simnet/admin.macaroon"[lnd.LTC]cltvdelta = 576disable = falsehost = "localhost"nomacaroons = falseport = 20010certpath = "<copied_path>/lndltc/tls.cert"macaroonpath = "<copied_path>/lndltc/data/chain/litecoin/simnet/admin.macaroon"[raiden]disable = falsehost = "localhost"port = 5002
Now you can start
xud. Since it's using above configuation, it connects to the running docker environment. Ready to test your changes on xud-simnet!