Adding bitcoin-node....

This commit is contained in:
b0xxer 2024-02-09 10:19:13 -06:00
parent d338b83925
commit 107c028bdb
6 changed files with 114 additions and 0 deletions

3
hosts
View File

@ -8,4 +8,7 @@
[bitb0x:vars]
ansible_user=b0xxy
ansible_password=b0xxy
registry_url=git.boxxy.net/b0xxer/
bitcoin_version=26.0
bitcoin_password=rVhfmriXjB8uFekmn7sLvnUiY610JaOx

4
requirements.txt Normal file
View File

@ -0,0 +1,4 @@
# A list of requirements to install before running
#ansible
#ansible-galaxy collection install containers.podman

View File

@ -1,2 +1,52 @@
---
# tasks file for bitcoin
#
- name: Create bitcoin-pod
containers.podman.podman_pod:
name: bitcoin-pod
state: started
ports:
- "50001:50001"
- "4224:4224"
- "127.0.0.1:8332:8332"
- "8333:8333"
- name: Create bitcoin data / conf directory
ansible.builtin.file:
path: ~/.bitcoin
state: directory
mode: '0755'
- name: Apply bitcoin.conf file to directory
become: yes
become_method: sudo
ansible.builtin.template:
src: bitcoin.conf.j2
dest: /home/b0xxy/.bitcoin/bitcoin.conf
setype: container_file_t
owner: b0xxy
- name: Copy bitcoin-node.container file
register: sysd_reload
ansible.builtin.template:
src: bitcoin-node.container
dest: /home/b0xxy/.config/containers/systemd
- name: Reload systemctl
ansible.builtin.systemd_service:
daemon_reload: True
when: sysd_reload['changed']==True
#- name: Create bitcoin-node container
#containers.podman.podman_container:
#name: bitcoin-node
#pod: bitcoin-pod
#image: git.b0xxy.net/b0xxer/bitcoin:26
#volume: /home/b0xxy/.bitcoin:/bitcoin/.bitcoin:Z
#state: created
#generate_systemd:
#path: ~/.config/containers/systemd/
#restart_policy: always
#time: 120
#names: true

View File

@ -0,0 +1,22 @@
[Unit]
Description=Bitcoin Node
[Container]
# Use the centos image
Image={{ registry_url }}/bitcoin:{{ bitcoin_version }}
PodmanArgs=--pod bitcoin-pod
# Use volume
Volume=/home/{{ansible_user}}/.bitcoin:/bitcoin/.bitcoin:Z
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
# ExecStartPre flag and other systemd commands can go here, see systemd.unit(5) man page.
# ExecStartPre=/usr/share/mincontainer/setup.sh
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target

View File

@ -0,0 +1,34 @@
# network
mainnet=1
testnet=0
# server
server=1
listen=1
listenonion=0
daemon=0
txindex=0
prune=0
disablewallet=1
printtoconsole=1
# rpc
rpcuser=bitcoinrpc
rpcpassword={{ bitcoin_password }}
#rpcconnect=127.0.0.1
#rpcport=8332
#rpcauth=xxx
# performance
dbcache=2000
maxconnections=40
maxuploadtarget=5000
# tor
#proxy=127.0.0.1:9050
#seednode=nkf5e6b7pl4jfd4a.onion
#seednode=xqzfakpeuvrobvpj.onion
#seednode=tsyvzsqwa2kkf6b2.onion
# validation
reindex-chainstate=0

View File

@ -14,6 +14,7 @@
- git
- avahi
- nss-mdns
- telnet
- cockpit
- cockpit-networkmanager
- cockpit-ostree