Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

David C kccheung

🎯
Focusing
View GitHub Profile
@fjahr
fjahr / bitcoin_debugging.md
Last active Aug 28, 2020
Debugging Bitcoin Core
View bitcoin_debugging.md

Moved to https://github.com/fjahr/debugging_bitcoin to allow for better collaboration.

This document is currently optimized for MacOS. If you would like to help me add Linux equivalent commands, please let me know.

Debugging Bitcoin Core

This guide is designed to give beginners of C++ development and/or people new to the bitcoin core code base an overview of the tools available for debugging issues as well as giving hints where issues may trip you up.

View pybybit.py
import hashlib
import hmac
import json
import time
import urllib.parse
from threading import Thread
from collections import deque
from requests import Request, Session
from requests.exceptions import HTTPError
View volumebar_generator.py
import numpy as np
# expects a numpy array with trades
# each trade is composed of: [time, price, quantity]
def generate_volumebars(trades, frequency=10):
times = trades[:,0]
prices = trades[:,1]
volumes = trades[:,2]
ans = np.zeros(shape=(len(prices), 6))
candle_counter = 0
@vindard
vindard / lnd-channel-backup.md
Last active Sep 17, 2020
A script built off of @alexbosworth's backup script that monitors lnd's `channel.backup` file for changes and uploads those changes to Dropbox when detected.
View lnd-channel-backup.md

Lnd Automated Channel Backup Guide

This script was inspired by @alexbosworth's channel.backup backup script and my own .lnd folder backup script. It monitors lnd's channel.backup file for changes and uploads those changes to Dropbox when detected.

Setup Script

To get started, download the script:

$ cd && wget -qN https://gist.githubusercontent.com/vindard/e0cd3d41bb403a823f3b5002488e3f90/raw/4bcf3c0163f77443a6f7c00caae0750b1fa0d63d/lnd-channel-backup.sh
$ sudo chmod +x lnd-channel-backup.sh
View setup_npm.md

Install make

You will probably need build essential tools

# Ubuntu install build tools:
sudo apt-get install -y build-essential

Install Node.js

@bretton
bretton / lnd-backup-restore-migrate.md
Last active May 24, 2019
LND Backup, Restore, Migrate
View lnd-backup-restore-migrate.md
View ScriptlessScript_for_DLC.md

Scriptless Script for DLC

Scriptless Script

Assumptions

pk_script
<witness version 0x0X> <public key / EC point : P >

View bitcoind-lnd-config.md

Setup Bitcoin.conf

bitcoin.conf flags for LND integration

rpcpassword= // make a strong password
rpcuser=bitcoinrpc
server=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28332
@kccheung
kccheung / pyscript.py
Created Apr 30, 2018 — forked from n8henrie/pyscript.py
Python script template
View pyscript.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""pyscript.py
A simple python script template.
http://ajminich.com/2013/08/01/10-things-i-wish-every-python-script-did/
"""
import argparse
@ecurrencyhodler
ecurrencyhodler / LTC-Lightning-Network-lnd-Guide (Mac).md
Last active Oct 26, 2020
This is a step-by-step main net tutorial on how to setup a lightning network node for Litecoin on a Mac. It will take you from the beginning all the way through to becoming visible on a ln explorer. To send or recieve payments, refer to "Basic lnd Commands."
View LTC-Lightning-Network-lnd-Guide (Mac).md

LTC-Lightning-Network-lnd-Guide

This is a step-by-step main net tutorial on how to setup a Lightning Network node for Litecoin on a Mac. It is specifically for the lnd client by the Lightning Labs. You can copy and paste most of the commands except for the times I've indicated in bold for you to input your own information. It would also be a good idea to backup your computer prior to starting just in case you need to start over.

Below is a legend. Refer to it as you come across terms or symbols you don’t understand. The first part of the tutorial is taken from the lnd github. However, everything else is written with the help of Patrick Walters taking me step by step through the process.

Legend

$ = This symbol means 1 line of code. Do not type “$” into your terminal. Simply input what follows then push enter.

Pubkey = Short for the public key that is generated from the private key w

You can’t perform that action at this time.