6 Commits

Author SHA1 Message Date
241f0807b3 Merge pull request 'Fix/refactor bitcoind recipe, upgrade bitcoind to 0.21' (#298) from chore/update_bitcoin-core into master
Reviewed-on: #298
2021-01-28 15:26:31 +00:00
fe0a955314 Merge pull request 'Update lnd to 0.12.0' (#299) from chore/update_lnd into chore/update_bitcoin-core
Reviewed-on: #299
2021-01-27 17:06:34 +00:00
65185b1a1b Update lnd to 0.12.0 2021-01-27 18:05:30 +01:00
0d2a04f8ba Refactor bitcoind recipe
Fixes various issues, like compilation not starting on subsequent
version updates, service not restarting after compilation, and a TODO
note on the compilation script itself.
2021-01-26 12:45:28 +01:00
152edbc958 Update bitcoind to 0.21 2021-01-26 12:45:17 +01:00
40fe403879 Stop c-lightning before compilation
See https://github.com/ElementsProject/lightning/issues/4346 for
potential issues with not doing that.
2021-01-26 12:33:09 +01:00
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