created utility script to create run from clightning. sorted out location and permissions for rtl to access.

This commit is contained in:
b0xxer 2024-02-18 10:27:42 -06:00
parent 57c83ea393
commit 3076cae8c2
6 changed files with 48 additions and 5 deletions

1
hosts
View File

@ -37,6 +37,7 @@ bitcoin_rpcpassword=8BaOf-luoLM-5zA8V0ozLOtqzZZch2knK9gWIBfafDw
bitcoin_rpcauth=n0xb0x:413f1f82906117464e662853bce33577$80a039d800184a1cffd1de5468b5b2a7442ab1d368a13782e5283e575a9f57b2 bitcoin_rpcauth=n0xb0x:413f1f82906117464e662853bce33577$80a039d800184a1cffd1de5468b5b2a7442ab1d368a13782e5283e575a9f57b2
electrs_version=0.10.2 electrs_version=0.10.2
rtl_version=0.15.0 rtl_version=0.15.0
rtl_password=n0xb0x
lnbits_version=0.12.1 lnbits_version=0.12.1
zerotier_network= zerotier_network=
#Update wariness - 1 = very reluctant to update, 0 = eager to update #Update wariness - 1 = very reluctant to update, 0 = eager to update

View File

@ -1,6 +1,5 @@
--- ---
- name: main
- hosts: n0xb0x - hosts: n0xb0x
roles: roles:

View File

@ -30,6 +30,18 @@
notify: rebuild_rtl notify: rebuild_rtl
tags: [apps,rtl] tags: [apps,rtl]
- name: rtl - Copy checkrunes.sh
ansible.builtin.template:
src: rtl/checkrunes.sh.j2
dest: ~/containers/rtl/checkrunes.sh
mode: '0700'
tags: [apps,rtl]
- name: rtl - Run checkrunes.sh
ansible.builtin.command:
cmd: ~/containers/rtl/checkrunes.sh
creates: ~/vol/rtl/data/rtl.macaroon
- name: rtl - Copy rtl-node.container file - name: rtl - Copy rtl-node.container file
ansible.builtin.template: ansible.builtin.template:
src: rtl/rtl-node.container.j2 src: rtl/rtl-node.container.j2

View File

@ -13,11 +13,11 @@
"lnNode": "Core Lightning Testnet # 1", "lnNode": "Core Lightning Testnet # 1",
"lnImplementation": "CLN", "lnImplementation": "CLN",
"Authentication": { "Authentication": {
"runePath": "/RTL/.lightning/bitcoin" "runePath": "/RTL/data/rtl.macaroon"
}, },
"Settings": { "Settings": {
"userPersona": "OPERATOR", "userPersona": "OPERATOR",
"themeMode": "DAY", "themeMode": "NIGHT",
"themeColor": "PURPLE", "themeColor": "PURPLE",
"bitcoindConfigPath": "", "bitcoindConfigPath": "",
"logLevel": "INFO", "logLevel": "INFO",
@ -27,5 +27,6 @@
} }
} }
], ],
"multiPass": "n0xb0x" "multiPass": "{{rtl_password}}"
} }

View File

@ -0,0 +1,31 @@
#!/bin/sh
RUNEFILE=~/vol/rtl/data/rtl.macaroon
running=$(podman ps --filter "name=systemd-clightning-node" --format json | jq -r .[].State)
if [ -e $RUNEFILE ];
then
echo "Macaroon $RUNEFILE already exist"
exit 1
fi
if [ "$running" == "running" ]
then
# Its running
checkrune=$(podman exec -it systemd-clightning-node lightning-cli showrunes | jq -r .runes[0].unique_id)
if [ "$checkrune" -eq 0 ];
then
# Rune exist, get it and output to $RUNEFILE
rune=$(podman exec -it systemd-clightning-node lightning-cli showrunes | jq -r .runes[0].rune)
else
# Rune doesn't exist, create it and output to $RUNEFILE
rune=$(podman exec -it systemd-clightning-node lightning-cli createrune | jq -r .runes[0].rune)
fi
echo "LIGHTNING_RUNE=\"$rune\"" > $RUNEFILE
exit 0
else
echo "Can't find systemd-clightning-node running."
# exit 1
fi

View File

@ -8,7 +8,6 @@ PodmanArgs=--pod bitcoin-pod
# Use volume # Use volume
Volume=/home/{{ansible_user}}/vol/rtl/data:/RTL/data:Z Volume=/home/{{ansible_user}}/vol/rtl/data:/RTL/data:Z
Volume=/home/{{ansible_user}}/vol/rtl/RTL-Config.json:/RTL/RTL-Config.json:Z Volume=/home/{{ansible_user}}/vol/rtl/RTL-Config.json:/RTL/RTL-Config.json:Z
Volume=/home/{{ansible_user}}/vol/clightning:/RTL/:ro,Z
[Service] [Service]
# Restart service when sleep finishes # Restart service when sleep finishes