Monitoring the Broker
Once your Broker Daemon is up, synced with the blockchains, and running, you can check on the internal logs of the broker and related services by running the following command in your
docker-compose logs -f
While you are actively using the broker, and particularly when you have outstanding orders, you should check on the status of your Broker and Payment Channel Network nodes at least once a day by running the following command in your
If either your Broker or either of your Payment Channel Network nodes have exited, you should take a look at the logs and potentially restart them. This is important to maintain the software's assumptions about atomicity of transactions.
Additionally, we provide utilities for troubleshooting the broker daemon and your orders, in the CLI.
Restarting the Broker
If you need to restart the Broker or any of its component parts because they went down or encountered any other issues, follow this guide.
Bring the services down
You'll first want to bring all of your services related to Sparkswap down.
Bringing your services down will cancel any outstanding orders you have and may interrupt orders already in progress.
sparkswap/broker directory which contains your
docker-compose.yml file, run:
This will stop all of your services, including the Broker, LND, and any blockchain nodes. You should not lose data during this process as data is persisted on disk.
Bring the services up
Once your services have shut down, you'll want to bring them back up together. In the same
sparkswap/broker directory, run:
docker-compose up -d
This will bring your services up, but run them in the background. You can check on their statuses following the steps outlined in Monitoring the Broker.
Why not just restart?
While it's possible to restart services individually using
docker-compose, we don't recommend it for typical use because of how the services rely on each other. If you have come across a unique situation, please contact support.
In general, there will be instances where your Broker will need to be restarted, or instances where the Broker has gone down but no data loss has occurred. When these instances occur, the Broker will need to have its wallets unlocked in order to function. This unlocking involves using the password that you chose during the creation of a wallet on the broker.
You will know you need to unlock your wallets if you run:
And see a message like:
Sparkswap Healthcheck ┌───────────────────┬───────────────────┐ │ Component │ Status │ ├───────────────────┼───────────────────┤ │ BTC Engine │ LOCKED │ ├───────────────────┼───────────────────┤ │ LTC Engine │ LOCKED │ ├───────────────────┼───────────────────┤ │ Relayer │ OK │ ├───────────────────┼───────────────────┤ │ BTC/LTC Orderbook │ OK │ ├───────────────────┼───────────────────┤ │ Daemon │ OK │ └───────────────────┴───────────────────┘
In order to unlock the wallets, you will need the passwords for all currencies (currently BTC and LTC).
For each currency you will need to run the following command:
sparkswap wallet unlock <currency-symbol>
This command will prompt you to enter in the wallet's password and will display a confirmation if the action was successful.
You can run a healthcheck to see that the engines are now unlocked:
You should expect to see the following response:
Sparkswap Healthcheck ┌───────────────────┬───────────────────┐ │ Component │ Status │ ├───────────────────┼───────────────────┤ │ BTC Engine │ OK │ ├───────────────────┼───────────────────┤ │ LTC Engine │ OK │ ├───────────────────┼───────────────────┤ │ Relayer │ OK │ ├───────────────────┼───────────────────┤ │ BTC/LTC Orderbook │ OK │ ├───────────────────┼───────────────────┤ │ Daemon │ OK │ └───────────────────┴───────────────────┘