Skip to content

Recovering from a jam

tuxcanfly edited this page Oct 25, 2014 · 20 revisions

In case btcsim is not responding, a clean shutdown can be forced by sending a Ctrl+C interrupt. This will interrupt any ongoing transactions, mining etc and pass the interrupt to the btcd and btcwallet background instances. btcd can take a while to shutdown, especially if it's in the process of mining a large block, so keep an eye on miner.log. Usually this should be sufficient for a clean recovery.

If it takes more than a couple of minutes after Ctrl+C and btcsim is still not responding, as a last resort, you can try these steps:

  • (Optional) Report an issue:

You can report an unresposive btcsim to github issues. Please include a full goroutine dump of the btcsim profiler to make it easier to debug the issue.

  • Find and kill the main btcsim process
  • Find and kill the background btcd, btcwallet launched by btcsim. To make finding the processes easier, btcsim writes a pidfile for every process launched which was not cleanly shutdown. The files are stored in the app data directory and it's safe to delete them after killing the processes.
  • If required, remove the datadir, logdir used by the above processes

Notes:

  • btcsim uses btcutil.AppDataDir for writing logs, pids etc:

    • POSIX (Linux/BSD): ~/.btcsim
    • Mac OS: $HOME/Library/Application Support/Btcsim
    • Windows: %LOCALAPPDATA%\Btcsim
    • Plan 9: $home/btcsim
  • btcsim uses ioutil.TempDir for getting a temp working directory, so you can find btcd and btcwallet instances by observing the datadir and logdir arguments in the processes

Clone this wiki locally