- If you have not yet played the tutorial, please do so. It takes about an hour, but it's well worth the effort, as it gives you basic survival skills. This guide will assume you've completed it.
I hereby claim:
- I am djkazic on github.
- I am synthlock (https://keybase.io/synthlock) on keybase.
- I have a public key ASDrlbGcmHJnUqChG3NSgpHhorKPjey_HCSIv8SYhy_qlQo
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Allows you to use a [tank] and [reserve] pool | |
| # Set vars for best results | |
| if [ "$#" != 4 ]; then | |
| echo " Usage: ./defrag <src-pool> <src-dataset> <dest-pool> <grub-disk>" | |
| echo '' | |
| echo " Example: ./defrag tank os reserve /dev/sda" | |
| exit 1 | |
| fi |
I hereby claim:
- I am djkazic on github.
- I am kevin_lightning (https://keybase.io/kevin_lightning) on keybase.
- I have a public key ASBDAdIIp44kp3xvKVQtvu2uOOr8rlWMKtLehEV7Xr-H3go
To claim this, I am signing this object:
Today, LND supports using several database backends with the default being bbolt.
Postgres represents a more battle-tested deployment of a DB and comes with some features of interest that benefit performance and data durability:
- Async / sync replication
- Vacuum for dead tuples cleanup
- (with SQL schema) optimizations around index use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "crypto/sha256" | |
| "encoding/binary" | |
| "encoding/hex" | |
| "fmt" | |
| "math/big" | |
| "sort" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import secrets | |
| # secp256k1 parameters | |
| p = 2**256 - 2**32 - 977 | |
| a = 0 | |
| b = 7 | |
| def random_256bit_int(): | |
| # random 32-byte string interpreted as big-endian integer | |
| return int.from_bytes(secrets.token_bytes(32), "big") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import secrets | |
| from statistics import mean | |
| # secp256k1 parameters | |
| p = 2**256 - 2**32 - 977 | |
| b = 7 # y^2 = x^3 + 7 | |
| def is_quadratic_residue(n): | |
| """Return True if n is a quadratic residue mod p (including 0).""" | |
| if n == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import sys | |
| import secrets | |
| from statistics import mean | |
| p = 2**256 - 2**32 - 977 | |
| b = 7 # y^2 = x^3 + 7 | |
| def is_quadratic_residue(n): | |
| return n == 0 or pow(n, (p - 1) // 2, p) == 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import requests | |
| import json | |
| from base64 import b64encode | |
| RPC_USER = "bitcoin" | |
| RPC_PASSWORD = "bitcoin" | |
| RPC_HOST = "127.0.0.1" | |
| RPC_PORT = 8332 |