diff --git a/cypress/integration/spec_node_configured.js b/cypress/integration/spec_node_configured.js index ce3c6e348..2d2b49803 100644 --- a/cypress/integration/spec_node_configured.js +++ b/cypress/integration/spec_node_configured.js @@ -21,6 +21,7 @@ describe('Node Configured', () => { // unfortunately this results in weird effects in cypress run //cy.get('#pdf-wallet-download > img').click() cy.task("node:mine") + cy.wait(10000) cy.get('#btn_continue').click() cy.get('#btn_transactions').click() cy.get('#fullbalance_amount') diff --git a/cypress/integration/spec_wallet_send.js b/cypress/integration/spec_wallet_send.js index 0091f32e0..e66635fbe 100644 --- a/cypress/integration/spec_wallet_send.js +++ b/cypress/integration/spec_wallet_send.js @@ -21,9 +21,10 @@ describe('Send transactions from wallets', () => { // Download PDF // unfortunately this results in weird effects in cypress run //cy.get('#pdf-wallet-download > img').click() - cy.task("node:mine") cy.get('#btn_continue').click() cy.get('#btn_transactions').click() + cy.task("node:mine") + cy.wait(10000) cy.get('#wallets-loading-done-refresh', { timeout: 10000 }).click() cy.get('#fullbalance_amount') .should(($div) => { @@ -70,6 +71,7 @@ describe('Send transactions from wallets', () => { cy.get('#page_overlay_popup_cancel_button').click() // Send transaction cy.task("node:mine") + cy.wait(10000) cy.get('#btn_transactions').click() cy.get('#wallets-loading-done-refresh', { timeout: 10000 }).click() cy.reload() diff --git a/pyinstaller/bitcoind/SHA256SUMS.asc b/pyinstaller/bitcoind/SHA256SUMS.asc index 24204b4d4..94de32959 100644 --- a/pyinstaller/bitcoind/SHA256SUMS.asc +++ b/pyinstaller/bitcoind/SHA256SUMS.asc @@ -1,29 +1,29 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 -43416854330914992bbba2d0e9adf2a6fff4130be9af8ae2ef1186e743d9a3fe bitcoin-0.21.0-aarch64-linux-gnu.tar.gz -f028af308eda45a3c4c90f9332f96b075bf21e3495c945ebce48597151808176 bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz -695fb624fa6423f5da4f443b60763dd1d77488bfe5ef63760904a7b54e91298d bitcoin-0.21.0-osx64.tar.gz -6223fd23d07133a6bfa2aa3d2554a09dc1d790d28ce67b0085d3fdcc1c126e05 bitcoin-0.21.0-osx.dmg -f8b2adfeae021a672effbc7bd40d5c48d6b94e53b2dd660f787340bf1a52e4e9 bitcoin-0.21.0-riscv64-linux-gnu.tar.gz -1a91202c62ee49fb64d57a52b8d6d01cd392fffcbef257b573800f9289655f37 bitcoin-0.21.0.tar.gz -385a67cc4cf45558c05eb85fc500046cf033f816637fe0bff80d30debfca0128 bitcoin-0.21.0-win64-setup-unsigned.exe -1d0052c4ce80227fb6d0bc1c4e673ba21033e219c1f935d25f130ef7f43360d4 bitcoin-0.21.0-win64.zip -da7766775e3f9c98d7a9145429f2be8297c2672fe5b118fd3dc2411fb48e0032 bitcoin-0.21.0-x86_64-linux-gnu.tar.gz +28264751c982d30b9330e6c1475ddb9ed28be6a2601e8a5f33b6ba49a3d9f5f2 bitcoin-0.21.1-aarch64-linux-gnu.tar.gz +3a92e312ffd3ca92579d46ec52e3dcb1b09bbdd11fe7c6a735e8546c7d9975e0 bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz +1ea5cedb64318e9868a66d3ab65de14516f9ada53143e460d50af428b5aec3c7 bitcoin-0.21.1-osx64.tar.gz +2df15131cd18fd1941adc26f014012b437ccaadab39f1f5dc10282a68e8f9923 bitcoin-0.21.1-osx.dmg +259d74f13271dc51eb4db4b733fb1589038ff7819e849d2351e899f67de218c5 bitcoin-0.21.1-riscv64-linux-gnu.tar.gz +caff23449220cf45753f312cefede53a9eac64000bb300797916526236b6a1e0 bitcoin-0.21.1.tar.gz +afdd0f1717a74af01b88631d17a2f29f89d21ca2e3be0fec0678e7a1e20712d5 bitcoin-0.21.1-win64-setup-unsigned.exe +94c80f90184cdc7e7e75988a55b38384de262336abd80b1b30121c6e965dc74e bitcoin-0.21.1-win64.zip +366eb44a7a0aa5bd342deea215ec19a184a11f2ca22220304ebb20b9c8917e2b bitcoin-0.21.1-x86_64-linux-gnu.tar.gz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49DgxW8BVXXqPILBS/MatjgQ5BWJWpK +p4B6V0FYJ2ZpvaTWNBOllUTNRq7YACcKSAEyW3cD9aNPz4o8mb3O7LMr+qb2z0+4 +KZuubmOT3sJD37nsZ7DfmERQ7hFYHdlqvthCEQQyglasEZrsLnuCJQNGOSAT+ixM +8jPf3XFDNWm3QFS5icAmykzOWSV4Z0WcQfDjIRbcoXR09N5PgYavhSiwPqpfQ94/ +q2igiMmIPH8rlRySc9fKfpYomkWP4W1vfm/wIeSrNm2oNeedL4/4zcv4v6mmnQhO ++i1Npk1TY9+pMAh5xrjUxw3W1QgpVxttIlRmKw6StpVB2Lxl+bGAXp5N7hA8znWX +3AHSDYcdIVEpjvAWGpNPspsyrDv42zElgR8PqS462d/Go6HHhIqd+wHoRIEJTfXM +m6bC44Ak09Ayxu4IxxBw +=5612 -----END PGP SIGNATURE----- diff --git a/pyinstaller/bitcoind/bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz b/pyinstaller/bitcoind/bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz similarity index 73% rename from pyinstaller/bitcoind/bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz rename to pyinstaller/bitcoind/bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz index 667e1c1dc..536b411e2 100644 Binary files a/pyinstaller/bitcoind/bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz and b/pyinstaller/bitcoind/bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz differ diff --git a/pyinstaller/bitcoind/bitcoin-0.21.0-osx64.tar.gz b/pyinstaller/bitcoind/bitcoin-0.21.1-osx64.tar.gz similarity index 72% rename from pyinstaller/bitcoind/bitcoin-0.21.0-osx64.tar.gz rename to pyinstaller/bitcoind/bitcoin-0.21.1-osx64.tar.gz index 13cf9095b..8b5d67112 100644 Binary files a/pyinstaller/bitcoind/bitcoin-0.21.0-osx64.tar.gz and b/pyinstaller/bitcoind/bitcoin-0.21.1-osx64.tar.gz differ diff --git a/pyinstaller/bitcoind/bitcoin-0.21.0-win64.zip b/pyinstaller/bitcoind/bitcoin-0.21.1-win64.zip similarity index 74% rename from pyinstaller/bitcoind/bitcoin-0.21.0-win64.zip rename to pyinstaller/bitcoind/bitcoin-0.21.1-win64.zip index 6515c0f47..cbefc3116 100644 Binary files a/pyinstaller/bitcoind/bitcoin-0.21.0-win64.zip and b/pyinstaller/bitcoind/bitcoin-0.21.1-win64.zip differ diff --git a/pyinstaller/bitcoind/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz b/pyinstaller/bitcoind/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz similarity index 74% rename from pyinstaller/bitcoind/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz rename to pyinstaller/bitcoind/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz index 10fccab89..024c65d36 100644 Binary files a/pyinstaller/bitcoind/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz and b/pyinstaller/bitcoind/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz differ diff --git a/pyinstaller/specterd.spec b/pyinstaller/specterd.spec index 644608359..afaf75f04 100644 --- a/pyinstaller/specterd.spec +++ b/pyinstaller/specterd.spec @@ -14,7 +14,7 @@ if platform.system() == 'Windows': binaries = [("./windll/libusb-1.0.dll", ".")] packaged_software_datas = [ ('./torbrowser/tor-win64-0.4.5.7.zip', 'torbrowser'), - ('./bitcoind/bitcoin-0.21.0-win64.zip', 'bitcoind'), + ('./bitcoind/bitcoin-0.21.1-win64.zip', 'bitcoind'), ] elif platform.system() == 'Linux': if platform.processor() == 'aarch64': #ARM 64 bit @@ -33,8 +33,7 @@ elif platform.system() == 'Linux': break packaged_software_datas = [ ('./torbrowser/tor-browser-linux64-10.0.15_en-US.tar.xz', 'torbrowser'), - ('./bitcoind/bitcoin-0.21.0-x86_64-linux-gnu.tar.gz', 'bitcoind'), - ('./bitcoind/bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz', 'bitcoind'), + ('./bitcoind/bitcoin-0.21.1' + ('-arm-linux-gnueabihf.tar.gz' if "armv" in platform.machine() else '-x86_64-linux-gnu.tar.gz'), 'bitcoind') ] elif platform.system() == 'Darwin': find_brew_libusb_proc = subprocess.Popen(['brew', '--prefix', 'libusb'], stdout=subprocess.PIPE) @@ -42,7 +41,7 @@ elif platform.system() == 'Darwin': binaries = [(libusb_path.rstrip().decode() + "/lib/libusb-1.0.dylib", ".")] packaged_software_datas = [ ('./torbrowser/TorBrowser-10.0.15-osx64_en-US.dmg', 'torbrowser'), - ('./bitcoind/bitcoin-0.21.0-osx64.tar.gz', 'bitcoind'), + ('./bitcoind/bitcoin-0.21.1-osx64.tar.gz', 'bitcoind'), ] a = Analysis(['specterd.py'], diff --git a/src/cryptoadvance/specter/config.py b/src/cryptoadvance/specter/config.py index dec15dc28..b1e186f20 100644 --- a/src/cryptoadvance/specter/config.py +++ b/src/cryptoadvance/specter/config.py @@ -78,7 +78,7 @@ class BaseConfig(object): SPECTER_SSL_CERT_SERIAL_NUMBER = int( os.getenv("SPECTER_SSL_CERT_SERIAL_NUMBER", random.randrange(1, 100000)) ) - INTERNAL_BITCOIND_VERSION = os.getenv("INTERNAL_BITCOIND_VERSION", "0.21.0") + INTERNAL_BITCOIND_VERSION = os.getenv("INTERNAL_BITCOIND_VERSION", "0.21.1") # Block explorers URLs EXPLORERS_LIST = { diff --git a/src/cryptoadvance/specter/managers/node_manager.py b/src/cryptoadvance/specter/managers/node_manager.py index 80e4db177..89e57e7d7 100644 --- a/src/cryptoadvance/specter/managers/node_manager.py +++ b/src/cryptoadvance/specter/managers/node_manager.py @@ -1,6 +1,7 @@ import os import logging import secrets +import shutil from ..rpc import get_default_datadir from ..specter_error import SpecterError @@ -8,6 +9,7 @@ from ..persistence import write_node, delete_file from ..helpers import alias, load_jsons from ..node import Node from ..internal_node import InternalNode +from ..util.bitcoind_setup_tasks import setup_bitcoind_thread logger = logging.getLogger(__name__) @@ -91,6 +93,23 @@ class NodeManager: return self.nodes[node_name] raise SpecterError("Node %s does not exist!" % alias) + def update_bitcoind_version(self, specter, version): + stopped_nodes = [] + for node in (node for node in self.nodes.values() if not node.external_node): + if node.is_bitcoind_running(): + node.stop() + stopped_nodes.append(node.alias) + shutil.rmtree( + os.path.join(specter.data_folder, "bitcoin-binaries"), + ignore_errors=True, + ) + setup_bitcoind_thread(specter, version) + for node in (node for node in self.nodes.values() if not node.external_node): + node.version = version + write_node(node, node.fullpath) + for node_alias in stopped_nodes: + self.get_by_alias(node_alias).start(timeout=60) + def add_node( self, name, diff --git a/src/cryptoadvance/specter/server_endpoints/nodes.py b/src/cryptoadvance/specter/server_endpoints/nodes.py index 88b4e8a4a..93c5a4fc6 100644 --- a/src/cryptoadvance/specter/server_endpoints/nodes.py +++ b/src/cryptoadvance/specter/server_endpoints/nodes.py @@ -305,10 +305,22 @@ def internal_node_settings(node_alias): ) except Exception as e: flash(f"Failed to remove Bitcoin Core, error: {e}", "error") - + elif action == "upgrade_bitcoind": + if node.version != app.config["INTERNAL_BITCOIND_VERSION"]: + try: + app.specter.node_manager.update_bitcoind_version( + app.specter, app.config["INTERNAL_BITCOIND_VERSION"] + ) + except Exception as e: + flash( + f"Failed to upgrade Bitcoin Core version, error: {e}", "error" + ) + else: + flash("Bitcoin Core version is already up to date") return render_template( "node/internal_node_settings.jinja", node=node, + latest_bitcoind=app.config["INTERNAL_BITCOIND_VERSION"], node_alias=node_alias, specter=app.specter, rand=rand, diff --git a/src/cryptoadvance/specter/specter.py b/src/cryptoadvance/specter/specter.py index a3f1c707a..9739fc0c9 100644 --- a/src/cryptoadvance/specter/specter.py +++ b/src/cryptoadvance/specter/specter.py @@ -685,7 +685,7 @@ class Specter: self, self.bitcoind_path, "mainnet", - self.internal_bitcoind_version, + "0.20.1", ) write_node( internal_node, diff --git a/src/cryptoadvance/specter/templates/node/internal_node_settings.jinja b/src/cryptoadvance/specter/templates/node/internal_node_settings.jinja index f17ddd403..4ac5224e5 100644 --- a/src/cryptoadvance/specter/templates/node/internal_node_settings.jinja +++ b/src/cryptoadvance/specter/templates/node/internal_node_settings.jinja @@ -8,6 +8,13 @@