I wanted to build Bitcoin Core myself, so I followed this official guide, but in the process I failed to realize that by cloning the git repo I would just get the latest source code, not the latest stable release. I have downloaded the full blockchain, created a wallet, deposited funds, but I am running a pre-release version, 24.99. Is it possible to downgrade to the latest stable release (24.0.1)? What are the consequences, do I need to redownload the blockchain, restore my wallet, etc?
2 Answers
You can build any of the stable releases by checking out a tagged branch. For v24.0.1
, this would be something like this:
git checkout v24.0.1
and then proceed with building, same as before. Regarding downgrading, generally speaking, you should have no issues when upgrading or downgrading between client versions but you should always check the release notes to see if there is a downgrade warning and any additional steps you might need to take.
In your case, there are no release notes yet, so make a backup of your wallet.dat
file before downgrading the client. In the very unlikely event that you have issues with your block data or chainstate data after downgrading, you can first try running -reindex-chainstate
before resorting to re-doing IBD.
EDIT: as mentioned in the comments, it is usually possible to use an older wallet.dat
file with a newer client but not always guaranteed that a newer wallet.dat
file can be used with an older client. Make sure you have a backup as you may need to sweep the funds to an intermediary wallet first and then transfer them to a newly created wallet on the downgraded client.
-
1To be honest even if Bitcoin Core's master is reasonably stable, downgrading a wallet from a development version to the previous release sounds inadvisable. There could have been any forward incompatible change that were made during the development cycle. I'm not even sure we have any guarantee of forward-compatibility between release generally? Feb 15 at 10:07
-
Good point regarding forward compatibility, as we mostly try to guarantee backward compatibility. I'll amend the answer.– josieFeb 15 at 10:19
If you have downloaded the source from the GitHub repo, you can simply checkout to the proper release branch and re-install the software following the tutorial again. Installing the binaries should not affect the user data.
To checkout to the proper branch just do:
git checkout v24.0.1
If the v24.0.1
tag happens not to be present in your local copy, you can fetch the tags from upstream:
> git checkout v24.0.1
error: pathspec 'v24.0.1' did not match any file(s) known to git
git fetch origin
git checkout v24.0.1
If you're concerned about potentially losing your wallet data, I'd recommend you make a backup of the user directory just to be safe. Given you're linking to a macOS installing guide, your user directory should be located at /Users/${USER}/Library/Application Support/Bitcoin/
.
24.0.1
and created a new wallet. I don't expect there'd be any issue in this particular case (i could be very wrong though!), but IMHO you should not expect any forward-compatibility guarantee between a development branch and the latest release.