diff --git a/environments/development.json b/environments/development.json index a6f79ca..7f8bff0 100644 --- a/environments/development.json +++ b/environments/development.json @@ -16,6 +16,28 @@ }, "kosmos-dirsrv": { "master_hostname": "localhost" + }, + "bitcoin": { + "conf": { + "testnet": 1, + "irc": 1, + "dnsseed": 1, + "upnp": 1, + "checkblocks": 10, + "checklevel": 1, + "txindex": 1, + "whitelist": "127.0.0.1", + "listen": 1, + "server": 1, + "rpcport": 8332, + "rpcssl": 0, + "rpcuser": "bitcoind", + "rpcbind": "127.0.0.1:8336", + "port": 8335, + "gen": 0, + "zmqpubrawblock": "tcp://127.0.0.1:8337", + "zmqpubrawtx": "tcp://127.0.0.1:8338" + } } } } diff --git a/site-cookbooks/kosmos-bitcoin/attributes/default.rb b/site-cookbooks/kosmos-bitcoin/attributes/default.rb index 62d6aca..591a364 100644 --- a/site-cookbooks/kosmos-bitcoin/attributes/default.rb +++ b/site-cookbooks/kosmos-bitcoin/attributes/default.rb @@ -1,24 +1,22 @@ node.default['bitcoin']['username'] = 'bitcoind' node.default['bitcoin']['usergroup'] = 'bitcoind' node.default['bitcoin']['datadir'] = '/mnt/data/bitcoin' +node.default['bitcoin']['network'] = 'mainnet' node.default['bitcoin']['conf'] = { - testnet: 0, irc: 1, dnsseed: 1, upnp: 1, checkblocks: 10, checklevel: 1, txindex: 1, - whitelist: "127.0.0.1", + whitelist: '127.0.0.1', listen: 1, server: 1, - rpcport: 8332, rpcssl: 0, rpcuser: 'bitcoind', rpcbind: "127.0.0.1:8336", - port: 8335, gen: 0, - zmqpubrawblock: "tcp://127.0.0.1:8337", - zmqpubrawtx: "tcp://127.0.0.1:8338" + zmqpubrawblock: 'tcp://127.0.0.1:8337', + zmqpubrawtx: 'tcp://127.0.0.1:8338' } diff --git a/site-cookbooks/kosmos-bitcoin/recipes/snapd.rb b/site-cookbooks/kosmos-bitcoin/recipes/snapd.rb index 43e8153..5d233aa 100644 --- a/site-cookbooks/kosmos-bitcoin/recipes/snapd.rb +++ b/site-cookbooks/kosmos-bitcoin/recipes/snapd.rb @@ -55,7 +55,7 @@ template "#{bitcoin_datadir}/bitcoin.conf" do testnet_conf: node['bitcoin']['testnet_conf'], regtest_conf: node['bitcoin']['regtest_conf'] action :create - # notifies :reload, "service[bitcoind]", :delayed + notifies :restart, "systemd_unit[bitcoind.service]", :delayed end directory bitcoin_snapdir do @@ -93,8 +93,7 @@ systemd_unit 'bitcoind.service' do WantedBy: 'multi-user.target' } }) - verify false triggers_reload true - action :create + action [:create, :enable, :start] end