-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitcoind.rb
54 lines (47 loc) · 1.16 KB
/
bitcoind.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#install dependencies
%w[build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-all-dev].each do |pkg|
package pkg do
action :install
end
end
#checkout correct version of bitcoin
git "#{node['cryptonet-opsworks']['bitcoind']['src_prefix']}/bitcoin" do
repository node['cryptonet-opsworks']['bitcoind']['repo']
revision node['cryptonet-opsworks']['bitcoind']['revision']
action :sync
end
bash "build-and-install-bitcoind" do
cwd "#{node['cryptonet-opsworks']['bitcoind']['src_prefix']}/bitcoin"
code <<-EOF
./autogen.sh
./configure --disable-wallet
make
make install
EOF
end
#setup config file
directory "/home/ubuntu/.bitcoin" do
owner 'ubuntu'
group 'ubuntu'
action :create
end
template '/home/ubuntu/.bitcoin/bitcoin.conf' do
owner 'ubuntu'
group 'ubuntu'
action :create
end
#set permissions on /bitcoin folder
directory "/bitcoin" do
owner 'ubuntu'
group 'ubuntu'
action :create
end
#start as service
template "/etc/init/bitcoind.conf" do
source "bitcoind.upstart.erb"
mode 0644
end
service 'bitcoind' do
provider Chef::Provider::Service::Upstart
action :start
end