Merge pull request 'Fix/refactor bitcoind recipe, upgrade bitcoind to 0.21' (#298) from chore/update_bitcoin-core into master

Reviewed-on: #298
This commit is contained in:
Râu Cao 2021-01-28 15:26:31 +00:00
commit 241f0807b3
3 changed files with 16 additions and 13 deletions

View File

@ -1,5 +1,5 @@
node.default['bitcoin']['version'] = '0.20.1' node.default['bitcoin']['version'] = '0.21.0'
node.default['bitcoin']['checksum'] = '4bbd62fd6acfa5e9864ebf37a24a04bc2dcfe3e3222f056056288d854c53b978' node.default['bitcoin']['checksum'] = '1a91202c62ee49fb64d57a52b8d6d01cd392fffcbef257b573800f9289655f37'
node.default['bitcoin']['username'] = 'satoshi' node.default['bitcoin']['username'] = 'satoshi'
node.default['bitcoin']['usergroup'] = 'bitcoin' node.default['bitcoin']['usergroup'] = 'bitcoin'
node.default['bitcoin']['network'] = 'mainnet' node.default['bitcoin']['network'] = 'mainnet'
@ -35,7 +35,7 @@ node.default['c-lightning']['log_level'] = 'info'
node.default['c-lightning']['public_ip'] = '148.251.237.73' node.default['c-lightning']['public_ip'] = '148.251.237.73'
node.default['lnd']['repo'] = 'https://github.com/lightningnetwork/lnd' node.default['lnd']['repo'] = 'https://github.com/lightningnetwork/lnd'
node.default['lnd']['revision'] = 'v0.11.1-beta' node.default['lnd']['revision'] = 'v0.12.0-beta'
node.default['lnd']['source_dir'] = '/opt/lnd' node.default['lnd']['source_dir'] = '/opt/lnd'
node.default['lnd']['lnd_dir'] = "/home/#{node['bitcoin']['username']}/.lnd" node.default['lnd']['lnd_dir'] = "/home/#{node['bitcoin']['username']}/.lnd"
node.default['lnd']['alias'] = 'ln2.kosmos.org' node.default['lnd']['alias'] = 'ln2.kosmos.org'

View File

@ -24,6 +24,7 @@ end
bash "compile_c-lightning" do bash "compile_c-lightning" do
cwd node['c-lightning']['source_dir'] cwd node['c-lightning']['source_dir']
code <<-EOH code <<-EOH
systemctl stop lightningd.service
./configure ./configure
make make
make install make install

View File

@ -37,23 +37,25 @@ ark 'bitcoind' do
url "https://bitcoincore.org/bin/bitcoin-core-#{node['bitcoin']['version']}/bitcoin-#{node['bitcoin']['version']}.tar.gz" url "https://bitcoincore.org/bin/bitcoin-core-#{node['bitcoin']['version']}/bitcoin-#{node['bitcoin']['version']}.tar.gz"
checksum node['bitcoin']['checksum'] checksum node['bitcoin']['checksum']
action :put action :put
notifies :run, 'execute[compile_bitcoin-core_dependencies]', :immediately
end end
execute "Compile bitcoin-core dependencies" do execute "compile_bitcoin-core_dependencies" do
cwd "/usr/local/bitcoind/depends" cwd "/usr/local/bitcoind/depends"
command "make NO_QT=1" command "make NO_QT=1"
not_if { ::File.directory?("/usr/local/bitcoind/depends/x86_64-pc-linux-gnu") } action :nothing
notifies :run, 'bash[compile_bitcoin-core]', :immediately
end end
execute "Configure, compile bitcoin-core" do bash "compile_bitcoin-core" do
cwd "/usr/local/bitcoind" cwd "/usr/local/bitcoind"
# FIXME only executes first array item? code <<-EOH
command [ ./autogen.sh
"./autogen.sh", ./configure --prefix=$PWD/depends/x86_64-pc-linux-gnu
"./configure --prefix=$PWD/depends/x86_64-pc-linux-gnu", make
"make" EOH
] action :nothing
not_if { ::File.exist?("/usr/local/bitcoind/src/bitcoind") } notifies :restart, "systemd_unit[bitcoind.service]", :delayed
end end
link "/usr/local/bin/bitcoind" do link "/usr/local/bin/bitcoind" do