From 2089999cc81ebae4df4200f55773ded3fc84038e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 22 May 2025 15:52:22 +0400 Subject: [PATCH] Upgrade bitcoind to 29.0, switch to cmake --- .../kosmos-bitcoin/attributes/default.rb | 4 ++-- .../kosmos-bitcoin/recipes/bitcoind.rb | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/site-cookbooks/kosmos-bitcoin/attributes/default.rb b/site-cookbooks/kosmos-bitcoin/attributes/default.rb index 6eca5d4..c95e033 100644 --- a/site-cookbooks/kosmos-bitcoin/attributes/default.rb +++ b/site-cookbooks/kosmos-bitcoin/attributes/default.rb @@ -1,5 +1,5 @@ -node.default['bitcoin']['version'] = '28.0' -node.default['bitcoin']['checksum'] = '700ae2d1e204602eb07f2779a6e6669893bc96c0dca290593f80ff8e102ff37f' +node.default['bitcoin']['version'] = '29.0' +node.default['bitcoin']['checksum'] = '882c782c34a3bf2eacd1fae5cdc58b35b869883512f197f7d6dc8f195decfdaa' node.default['bitcoin']['username'] = 'satoshi' node.default['bitcoin']['usergroup'] = 'bitcoin' node.default['bitcoin']['network'] = 'mainnet' diff --git a/site-cookbooks/kosmos-bitcoin/recipes/bitcoind.rb b/site-cookbooks/kosmos-bitcoin/recipes/bitcoind.rb index ba76f8b..f586a4b 100644 --- a/site-cookbooks/kosmos-bitcoin/recipes/bitcoind.rb +++ b/site-cookbooks/kosmos-bitcoin/recipes/bitcoind.rb @@ -34,7 +34,7 @@ end execute "compile_bitcoin-core_dependencies" do cwd "/usr/local/bitcoind/depends" environment ({'CC' => 'gcc-13', 'CXX' => 'g++-13', 'NO_QT' => '1'}) - command "make -j 2" + command "make -j $(($(nproc)/2))" action :nothing notifies :run, 'bash[compile_bitcoin-core]', :immediately end @@ -43,21 +43,13 @@ bash "compile_bitcoin-core" do cwd "/usr/local/bitcoind" environment ({'CC' => 'gcc-13', 'CXX' => 'g++-13', 'NO_QT' => '1'}) code <<-EOH - ./autogen.sh - ./configure --prefix=$PWD/depends/x86_64-pc-linux-gnu - make + cmake -B build --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake + cmake --build build -j $(($(nproc)/2)) + cmake --install build EOH action :nothing end -link "/usr/local/bin/bitcoind" do - to "/usr/local/bitcoind/src/bitcoind" -end - -link "/usr/local/bin/bitcoin-cli" do - to "/usr/local/bitcoind/src/bitcoin-cli" -end - bitcoin_user = node['bitcoin']['username'] bitcoin_group = node['bitcoin']['usergroup'] bitcoin_datadir = node['bitcoin']['datadir']