Updated: March 2019
This guide helps users migrate from 0.4.x releases to the newest version of the Broker at 0.5.x.
Many improvements have been made to the usability of the code in the 0.5.x release of the Broker.
At a high level, we have modified the following components of the Broker
The following guide will lead you through the process of upgrading your Sparkswap Broker from the
>= v0.4.0-beta releases to the newest
v0.5.x-beta Broker release.
At a high level, here are the steps required to migrate your Sparkswap Broker:
- Backup your
- Pull latest code for Sparkswap Broker
- Recreate containers
Estimated Work Time: 10 minutes
Migrating your Broker
In order to migrate your Broker to a new version, you are required to stop your Broker. This action will cancel all of your orders. Make sure you have suspended all orders before continuing. You can stop your Broker with the following command:
cd path/to/broker docker-compose stop sparkswapd
Before you begin
As a best practice for all changes that we make to our Broker, you need to backup your
/data directory in both
lnd_ltc. You can do this by dumping the files to disk using
docker cp. For more information see: docker cp
The following commands assume that you have all Sparkswap Broker containers running.
- Create an archive for the
cd path/to/broker docker-compose exec lnd_btc bash -c 'tar -czvf lnd-btc-data.tar.gz /data' docker-compose exec lnd_ltc bash -c 'tar -czvf lnd-ltc-data.tar.gz /data'
- Find the container's ID. The image name will be
- For each lnd container, copy the archive from the container to your host machine.
docker cp <container_id>:lnd-btc-data.tar.gz . # or docker cp <container_id>:lnd-ltc-data.tar.gz .
At this point, your wallet and lnd data is backed up in case of failure during migration. This backup is purely precautionary as this migration poses little risk to the cryptocurrency wallets associated with your Sparkswap Broker.
- Pull the latest code for the Sparkswap Broker
cd path/to/broker git fetch origin v0.5.2-beta git checkout origin/v0.5.2-beta
- In the broker folder, you need to update the Broker CLI.
npm uninstall broker-cli npm install -g ./broker-cli
- In the broker folder, you will need to backup and update your configurations for the Broker
mv .env .env.bak cp .env-mainnet-sample .env
With these commands, we have backed up your original
.env file and imported the mainnet sample file which contains a new format. You will now need to copy information over from your existing settings.
A detailed guide on what environment variables are required to be set for the Broker are located in Installation - Setup Your Environment File
If you have made any custom changes to your
.env file, you will need to port them to the newly created
.env file from above.
- In the broker folder, you need to recreate the project's containers using docker compose.
docker-compose up -d
You now have an upgraded Sparkswap Broker!