Skip to content

Instantly share code, notes, and snippets.

View Stadicus's full-sized avatar

Stadicus Stadicus

View GitHub Profile
@Stadicus
Stadicus / eclair.config
Last active February 4, 2024 22:29
Eclair Lightning node eclair.config for Medium article
eclair.node-alias="YOURNAME [eclair]"
eclair.node-color=68f442
### remove # to publish your ip address (others can connect to you)
### you can get your public ip using http://ip4.me
# eclair.server.public-ips=["1.2.3.4"]
eclair.api.enabled=true
eclair.api.password="PASSWORD_[F]"
eclair.bitcoind.rpcuser="raspibolt"
@Stadicus
Stadicus / lnd.service
Last active January 23, 2023 07:50
systemd service for LND Lightning Daemon
[Unit]
Description=LND Lightning Daemon
Requires=bitcoind.service
After=getpublicip.service
After=bitcoind.service
# for use with sendmail alert
#OnFailure=systemd-sendmail@%n
[Service]
@Stadicus
Stadicus / deezy-swap.sh
Last active January 9, 2023 09:16
deezy-swap.sh
#!/bin/bash
set -eu
# Deezy Swap: push Bitcoin Lightning liquidity to LND on-chain address
# --------------------------------------------------------------------------
# This script automates swapping Bitcoin Lightning funds to Bitcoin on-chain
# through deezy.io, an external service.
#
# Use at your own risk.
#
@Stadicus
Stadicus / setup_clightning.md
Last active December 29, 2022 11:41
Setup c-lightning on Digital Ocean

E-Commerce c-lightning node on Digital Ocean

Prerequisites

  • based on small Digital Ocean VPS (1CPU / 1GB RAM) with Ubuntu 16.04
  • SSH keys are recommended, but not described here
  • (sub) domain name necessary for SSL certificate

UFW & basic stuff

Login as "root"

@Stadicus
Stadicus / bitcoin-monitor.md
Last active December 19, 2022 19:58 — forked from ageis/bitcoin-monitor.md
Prometheus exporter for monitoring statistics of Bitcoin daemon

bitcoind-monitor.py

Updated to work with Bitcoin Core 16.0 and newer.

This is a script written in Python intended to run alongside a Bitcoin node and export statistics for monitoring purposes. It assumes the existence of bitcoin-cli in the PATH and access to the RPC interface over localhost.

It tracks stuff like: block height, difficulty, number of peers, network hash rate, errors, uptime in seconds, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, and transaction inputs and outputs. These Bitcoin metrics are refreshed once every 5 minutes.

How it works

@Stadicus
Stadicus / checkout-pull-requests.txt
Last active February 1, 2022 13:53
[alias] in .gitconfig
# Put the following "alias" in your `.gitconfig` file:
```
[alias]
pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^upstream || echo origin)} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
```
# Clone the RaspiBolt fork from your own GitHub user space (with SSH for write access)
$ git clone git@github.com:Stadicus/raspibolt.git
$ cd raspibolt
@Stadicus
Stadicus / 20-thundroid-welcome
Last active November 21, 2021 12:36
Thundroid: System overview MotD
#!/bin/sh
# by Stadicus
# make executable and copy script to /etc/update-motd.d/
# root must be able to execute bitcoin-cli and lncli
# set colors
color_red='\033[0;31m'
color_green='\033[0;32m'
color_yellow='\033[0;33m'
color_gray='\033[0;37m'
### (Optional) Autounlock LND wallet
Since version 0.13, LND can read the wallet password from a file.
There are many options to (more or less) securely store the password in a file.
LND [describes two options](https://github.com/lightningnetwork/lnd/blob/master/docs/wallet.md#auto-unlocking-a-wallet): an easy but insecure one, and a more secure option using additional software like a password mangager.
We explain an easy approach that is pretty secure for remote attacks (the main threat in our opinion), but not very secure if someone gains physical access to your RaspiBolt node. The main advantage of this method is that only the `root` user has access to the password, and it is exposed to the `bitcoin` group on startup in memory only.
* As user "admin", create a new directory, prepare it and create an empty file to which only `root` has access
@Stadicus
Stadicus / lnd.conf
Last active June 22, 2021 13:23
lnd.conf for Raspberry Pi
[Application Options]
debuglevel=debug
debughtlc=true
maxpendingchannels=5
alias=YOUR_NAME [LND]
color=#68F442
# for fixed ip allocation with custom port
#externalip=111.222.333.444:19735
#listen=0.0.0.0:19735

Keybase proof

I hereby claim:

  • I am stadicus on github.
  • I am stadicus (https://keybase.io/stadicus) on keybase.
  • I have a public key ASBkk8jwD0Cq7LNK8PvN_YuJrUwcT2Kh8kfFaoCigi4XeAo

To claim this, I am signing this object: