Skip to content

Instantly share code, notes, and snippets.

View royalgarter's full-sized avatar

Tom (Tung Pham Thanh) royalgarter

View GitHub Profile
@royalgarter
royalgarter / lnd.service
Created May 23, 2019 13:53 — forked from mariodian/lnd.service
LND Systemd script
[Unit]
Description=LND Lightning Daemon
Requires=bitcoind.service
After=bitcoind.service
[Service]
ExecStart=/home/satoshi/go/bin/lnd
ExecStop=/home/satoshi/go/bin/lncli stop
PIDFile=/home/satoshi/.lnd/lnd.pid
@royalgarter
royalgarter / lightning node.md
Created May 12, 2019 06:40 — forked from dougvk/lightning node.md
Start a lightning full node

Run the lightningd node on mainnet

root@docker-s-6vcpu-16gb-nyc3-01:~# mkdir -p /scratch/bitcoin/mainnet/clightning
root@docker-s-6vcpu-16gb-nyc3-01:~# docker run --rm --name lightning --network container:bitcoind_mainnet -v /scratch/bitcoin/mainnet/bitcoind:/root/.bitcoin -v /scratch/bitcoin/mainnet/clightning:/root/.lightning --entrypoint /usr/bin/lightningd cdecker/lightningd:master --network=bitcoin --log-level=debug

Check the log output

...
lightningd(1): Hello world from 03e71ed1bbedcf41d97e06ef3dfe4cdf79e871e9a3c809ab32b78e71dea45bf78c aka SLICKERGOPHER #03e71e (version v0.5.2-2016-11-21-1414-g5eceaa7)!
@royalgarter
royalgarter / setup-zeromq.sh
Created May 12, 2019 06:38 — forked from katopz/setup-zeromq.sh
Setup zeromq in Ubuntu 16.04
#!/usr/bin/bash
# Download zeromq
# Ref http://zeromq.org/intro:get-the-software
wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz
# Unpack tarball package
tar xvzf zeromq-4.2.2.tar.gz
# Install dependency

Running a Full Node

Before you begin you'll need to have about 100GB of disk space available to store the Bitcoin blockchain plus additional database information. Both 64bit Mac OS X and GNU/Linux are currently supported. The process of downloading the blocks and indexing can take upwards of 4 hours, depending on Internet connection and other factors. So it's suggested to plan accordingly and let the node syncronize while you're away. It's also possible to use an existing Bitcoin data directory, which will speed up the process.

Step 1: Install Node.js v0.12

It's recommended to install the Node Version Manager, as this makes it simple to switch between different Node.js versions. We will specifically need to install and run v0.12. Please follow the directions at https://github.com/creationix/nvm#install-script and then run:

nvm install v0.12.7
@royalgarter
royalgarter / install-redis.sh
Created December 16, 2018 04:04 — forked from clzola/install-redis.sh
Bash script for installing Redis on Ubuntu 16.04
#!/bin/bash
# Install the Build and Test Dependencies
apt-get update
apt-get install -y curl build-essential tcl
# Download and Extract the Source Code
cd /tmp
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
@royalgarter
royalgarter / update-dokku-stack.sh
Created June 12, 2018 03:46 — forked from egerlach/update-dokku-stack.sh
Update stack underlying apps running on dokku
#!/bin/bash
# before you can use this, you need to run (as root):
# git clone https://github.com/tt/stack-images.git /root/stack-images
# git clone https://github.com/gliderlabs/herokuish.git /root/herokuish
# First, we need to get our base ubuntu images up to date
docker pull ubuntu-debootstrap:14.04
docker pull ubuntu:trusty # for postgresql
@royalgarter
royalgarter / node_prune.sh
Created November 24, 2017 02:32 — forked from gpittarelli/node_prune.sh
Prunes very-likely-uneeded files from node_modules directories
#!/usr/bin/env bash
# Port of https://github.com/tj/node-prune to bash
# Also,
# - fixed "*.ts" being overzealous and killing .d.ts files
# - added some more file types from https://github.com/npm/npm/issues/5264#issuecomment-259800486
#
# See also:
# - https://github.com/timoxley/cruft
# - https://yarnpkg.com/en/docs/cli/autoclean
# - https://github.com/ModClean/modclean