Added rpcuser and rpcpassword options to bitcoin-node startup

This commit is contained in:
b0xxer 2024-02-13 10:20:15 -06:00
parent f0e6bce522
commit d83de2ce60
5 changed files with 16 additions and 6 deletions

1
hosts
View File

@ -30,6 +30,7 @@ registry_url=localhost
registry_user= registry_user=
registry_pass= registry_pass=
bitcoin_version=26.0 bitcoin_version=26.0
bitcoin_rpcuser=n0xb0x
bitcoin_rpcpassword=rVhfmriXjB8uFekmn7sLvnUiY610JaOx bitcoin_rpcpassword=rVhfmriXjB8uFekmn7sLvnUiY610JaOx
electrs_version=0.10.2 electrs_version=0.10.2
zerotier_network= zerotier_network=

View File

@ -1,6 +1,12 @@
--- ---
# handlers file for build # handlers file for build
# #
- name: restart_bitcoin
ansible.builtin.systemd_service:
name: bitcoin-node.service
scope: user
state: restarted
- name: rebuild_bitcoin - name: rebuild_bitcoin
ansible.builtin.shell: ansible.builtin.shell:
chdir: ~/Containers/bitcoin chdir: ~/Containers/bitcoin

View File

@ -10,6 +10,7 @@
- "4224:4224" - "4224:4224"
- "127.0.0.1:8332:8332" - "127.0.0.1:8332:8332"
- "8333:8333" - "8333:8333"
- "9735:9735"
- name: bitcoin - Create bitcoin data / conf directory - name: bitcoin - Create bitcoin data / conf directory
ansible.builtin.file: ansible.builtin.file:
@ -26,7 +27,9 @@
ansible.builtin.template: ansible.builtin.template:
src: bitcoin/bitcoin-node.container.j2 src: bitcoin/bitcoin-node.container.j2
dest: /home/{{ ansible_user }}/.config/containers/systemd/bitcoin-node.container dest: /home/{{ ansible_user }}/.config/containers/systemd/bitcoin-node.container
notify: reload_systemctl notify:
- reload_systemctl
- restart_bitcoin
- name: bitcoin - Create Containers/bitcoin Dir - name: bitcoin - Create Containers/bitcoin Dir
ansible.builtin.file: ansible.builtin.file:
@ -54,8 +57,8 @@
notify: rebuild_bitcoin notify: rebuild_bitcoin
- name: bitcoin - Copy btc_oneshot - name: bitcoin - Copy btc_oneshot
ansible.builtin.copy: ansible.builtin.template:
src: bitcoin/bin/btc_oneshot src: bitcoin/bin/btc_oneshot.j2
dest: ~/Containers/bitcoin/bin/btc_oneshot dest: ~/Containers/bitcoin/bin/btc_oneshot
notify: rebuild_bitcoin notify: rebuild_bitcoin

View File

@ -10,7 +10,7 @@ btc_init
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
# If IPv6 is in the container do both: # If IPv6 is in the container do both:
#set -- '-rpcbind=[::]:8332' '-rpcallowip=::/0' '-rpcallowip=0.0.0.0/0' #set -- '-rpcbind=[::]:8332' '-rpcallowip=::/0' '-rpcallowip=0.0.0.0/0'
set -- '-rpcbind=:8332' '-rpcallowip=0.0.0.0/0' set -- '-rpcbind=:8332' '-rpcallowip=0.0.0.0/0' '-rpcuser={{bitcoin_rpcuser}}' '-rpcpassword={{bitcoin_rpcpassword}}'
fi fi
exec bitcoind "$@" exec bitcoind "$@"

View File

@ -116,11 +116,11 @@
strategy = "periodic" strategy = "periodic"
[updates.periodic] [updates.periodic]
time_zone={{ update_schedule_timezone }} time_zone="{{ update_schedule_timezone }}"
[[updates.periodic.window]] [[updates.periodic.window]]
days = {{ update_schedule_days }} days = {{ update_schedule_days }}
start_time = {{ update_schedule_starttime }} start_time = "{{ update_schedule_starttime }}"
length_minutes = {{ update_schedule_length }} length_minutes = {{ update_schedule_length }}