diff --git a/nodes/bitcoin-2.json b/nodes/bitcoin-2.json index fc6a2c9..e873c80 100644 --- a/nodes/bitcoin-2.json +++ b/nodes/bitcoin-2.json @@ -18,6 +18,7 @@ "kosmos-base", "kosmos-base::default", "kosmos-bitcoin::source", + "kosmos-bitcoin::c-lightning", "kosmos-bitcoin::lnd", "kosmos-bitcoin::dotnet", "kosmos-bitcoin::nbxplorer", @@ -59,6 +60,7 @@ "run_list": [ "recipe[kosmos-base]", "recipe[kosmos-bitcoin::source]", + "recipe[kosmos-bitcoin::c-lightning]", "recipe[kosmos-bitcoin::lnd]", "role[btcpay]" ] diff --git a/site-cookbooks/kosmos-bitcoin/attributes/default.rb b/site-cookbooks/kosmos-bitcoin/attributes/default.rb index f7336e9..745055d 100644 --- a/site-cookbooks/kosmos-bitcoin/attributes/default.rb +++ b/site-cookbooks/kosmos-bitcoin/attributes/default.rb @@ -25,8 +25,12 @@ node.default['bitcoin']['conf'] = { zmqpubrawtx: 'tcp://127.0.0.1:8338' } +node.default['c-lightning']['repo'] = 'https://github.com/ElementsProject/lightning' +node.default['c-lightning']['revision'] = 'v0.9.2' +node.default['c-lightning']['source_dir'] = '/opt/c-lightning' + node.default['lnd']['repo'] = 'https://github.com/lightningnetwork/lnd' -node.default['lnd']['revision'] = 'v0.11.0-beta' +node.default['lnd']['revision'] = 'v0.11.1-beta' node.default['lnd']['source_dir'] = '/opt/lnd' node.default['dotnet']['ms_packages_src_url'] = "https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb" diff --git a/site-cookbooks/kosmos-bitcoin/recipes/c-lightning.rb b/site-cookbooks/kosmos-bitcoin/recipes/c-lightning.rb new file mode 100644 index 0000000..209d4f7 --- /dev/null +++ b/site-cookbooks/kosmos-bitcoin/recipes/c-lightning.rb @@ -0,0 +1,32 @@ +# +# Cookbook:: kosmos-bitcoin +# Recipe:: c-lightning +# + +build_essential +include_recipe "git" + +%w{ + autoconf automake libtool libgmp-dev libsqlite3-dev + python3 python3-mako net-tools zlib1g-dev + libsodium-dev gettext +}.each do |pkg| + apt_package pkg +end + +git node['c-lightning']['source_dir'] do + repository node['c-lightning']['repo'] + revision node['c-lightning']['revision'] + action :sync + notifies :run, 'bash[compile_c-lightning]', :immediately +end + +bash "compile_c-lightning" do + cwd node['c-lightning']['source_dir'] + code <<-EOH + ./configure + make + make install + EOH + action :nothing +end diff --git a/site-cookbooks/kosmos-bitcoin/recipes/lnd.rb b/site-cookbooks/kosmos-bitcoin/recipes/lnd.rb index 4708447..b730a8e 100644 --- a/site-cookbooks/kosmos-bitcoin/recipes/lnd.rb +++ b/site-cookbooks/kosmos-bitcoin/recipes/lnd.rb @@ -2,28 +2,6 @@ # Cookbook:: kosmos-bitcoin # Recipe:: lnd # -# The MIT License (MIT) -# -# Copyright:: 2020, Kosmos Developers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# include_recipe "git" include_recipe "golang"