Update BasicSwap

Update BasicSwap to the latest release with Docker, basicswap-bash or from source, then upgrade its coin cores with --upgradecores when a release needs it.

An update usually has two parts. The first updates BasicSwap itself, and the second, needed only when a release moves to newer versions, upgrades the coin daemons it runs, which BasicSwap calls coin cores. Each part takes a few minutes, and you need to stop BasicSwap for both.

Before you update

  1. Read the release notes for the version you're updating to, on the BasicSwap blog or in the repository. They say whether the release upgrades any coin cores, changes the database, or needs a manual step.
  2. Let swaps in progress finish, or at least don't update in the middle of one you're watching closely. BasicSwap picks up where it left off after a restart, but there's no reason to add risk.
  3. Stop BasicSwap cleanly. Press Ctrl + C once in its terminal and wait until it has shut down every coin daemon and returned to the prompt, or run docker-compose stop in the basicswap/docker folder. Closing the terminal or killing the process can leave a coin's database needing a reindex.
  4. Back up the data folder, ~/coinswaps or /var/data/coinswaps with Docker, by copying it while BasicSwap is stopped. A new release may upgrade the database on its first start, and older versions aren't written for the upgraded database, so the copy is your way back to the version you had, as Back up and restore describes.

Update

basicswap-bash

With BasicSwap stopped, run the update command:

bsx-update

It updates the basicswap-bash scripts, BasicSwap and its Python dependencies, then upgrades the coin cores, so all that's left is to start BasicSwap again with basicswap-bash.

Docker

  1. In the basicswap/docker folder, stop BasicSwap if it's still running, make sure the repository points at the official one, and download the update:

    docker-compose stop
    git remote set-url origin https://github.com/basicswap/basicswap
    git pull
  2. Rebuild the image, with --no-cache so that any changed dependencies are installed as well:

    docker-compose build --no-cache
  3. If the release notes mention new coin core versions, upgrade them, which updates every coin in your install at once:

    docker-compose run --rm swapclient basicswap-prepare --datadir=/coindata --upgradecores
  4. Start BasicSwap again with the new image:

    docker-compose up

From source

  1. With BasicSwap stopped, set up the terminal and go to the source folder:

    export SWAP_DATADIR=$HOME/coinswaps
    . $SWAP_DATADIR/venv/bin/activate
    cd $SWAP_DATADIR/basicswap
  2. Clear the old build, make sure the repository points at the official one, and download the update:

    rm -rf build
    git remote set-url origin https://github.com/basicswap/basicswap
    git pull
  3. Install the new version into the virtual environment:

    pip3 install --require-hashes -r requirements.txt
    pip3 install .
  4. If the release notes mention new coin core versions, upgrade them, which updates every coin in your install at once:

    basicswap-prepare --datadir=$SWAP_DATADIR --upgradecores
  5. Start BasicSwap again on the new version:

    basicswap-run --datadir=$SWAP_DATADIR

After updating

The first start after an update can take longer than usual while BasicSwap upgrades its database and the coin daemons start. Once it's up, the footer of the web UI shows the version now running, and if a coin daemon won't start, Troubleshooting covers the usual fixes.

Docs