Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: takuma sato on November 22, 2021, 04:46:03 AM



Title: Correct way to update?
Post by: takuma sato on November 22, 2021, 04:46:03 AM
If im running 0.20 and I want to run 22.0 and I always compile from source, what I do is I download source code from this link:

https://bitcoincore.org/en/download/

The exact link:

https://bitcoincore.org/bin/bitcoin-core-22.0/bitcoin-22.0.tar.gz

I check that sha256 hash matches then I compile it and I overwrite whatever was on the bitcoin folder previously. Is this ok, or should I first delete the bitcoin folder, and the compile it or any other steps I may be missing?


Title: Re: Correct way to update?
Post by: ABCbits on November 22, 2021, 09:53:43 AM
I check that sha256 hash matches then I compile it and I overwrite whatever was on the bitcoin folder previously. Is this ok, or should I first delete the bitcoin folder, and the compile it or any other steps I may be missing?

I don't know definition of "correct" in this case, but here are few common recommendation.
1. For security purpose, you may want to verify the signature (which contain hash of the files).
2. Do not overwrite/delete the Bitcoin directory (which contain executable file), but rename/archive it in case compilation failed or newer version has unwanted bug/behavior.


Title: Re: Correct way to update?
Post by: takuma sato on January 09, 2022, 07:20:14 PM
I check that sha256 hash matches then I compile it and I overwrite whatever was on the bitcoin folder previously. Is this ok, or should I first delete the bitcoin folder, and the compile it or any other steps I may be missing?

I don't know definition of "correct" in this case, but here are few common recommendation.
1. For security purpose, you may want to verify the signature (which contain hash of the files).
2. Do not overwrite/delete the Bitcoin directory (which contain executable file), but rename/archive it in case compilation failed or newer version has unwanted bug/behavior.

Yeah I always check the SHA256 checksum of the files. I should check gpg sigs too but usually I check SHA256 on Bitcoin Core site and on the github page so its unlikely both get hacked at the same time.

https://github.com/bitcoin-core/guix.sigs/commit/74e11d73285a63c7a3e9fd5eac42054b5ee3014b

What I want to know is how to deal with the blockchain files. I guess the best solution is to have a dedicated blocks folder and then build the binaries from scratch on a new folder for each version so I don't overwrite anything and reuse the downloaded blockchain files and generate new chainstate ones.


Title: Re: Correct way to update?
Post by: pooya87 on January 10, 2022, 04:06:19 AM
Yeah I always check the SHA256 checksum of the files. I should check gpg sigs too but usually I check SHA256 on Bitcoin Core site and on the github page so its unlikely both get hacked at the same time.
Assuming something is unlikely is not the safe way of conducting things. You must always verify the signature of the files you download and more importantly you must make sure the PGP public key you have is the actual key that the real developer used to sign the binaries.


Title: Re: Correct way to update?
Post by: n0nce on January 11, 2022, 11:52:17 PM
What I want to know is how to deal with the blockchain files. I guess the best solution is to have a dedicated blocks folder and then build the binaries from scratch on a new folder for each version so I don't overwrite anything and reuse the downloaded blockchain files and generate new chainstate ones.

If you worry the file might be corrupted after upgrade, you just need to create a copy of Bitcoin directory (which contain block, chainstate and other files).
I'd also add stopping bitcoind before the upgrade and restarting it after. Like:

1) Stop Bitcoin Core
2) git pull, git checkout v22.0 ==> recompile
3) Start Bitcoin Core