Skip to content

Instantly share code, notes, and snippets.

@sogoagain
sogoagain / bitcoin-core_simple-functional-test.py
Last active May 1, 2023 12:31
Simple functional test example for Bitcoin Core
from test_framework.util import (
assert_equal,
assert_approx
)
from test_framework.test_framework import BitcoinTestFramework
class SimpleFunctionalTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)
@sogoagain
sogoagain / bitcoin-core.zshrc
Last active April 27, 2023 12:48
Setting up .zshrc to help with Bitcoin Core development
# Bitcoin Core
bitcoin_func_test() {
local args=()
for arg in "$@"
do
args+=(test/functional/${arg}*)
done
test/functional/test_runner.py "${args[@]}"
}
@sogoagain
sogoagain / bitcoin-key-to-address.go
Last active March 30, 2024 14:45
Generate bitcoin address from private key
// This code has not been professionally audited.
// Use at own risk.
package main
import (
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
@sogoagain
sogoagain / git.sh
Last active February 27, 2023 07:25
Tips for Using Git
# How to delete the local branches for which the remote tracking branches have been pruned.
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d
# To delete all local Git branches except the master branch
git branch | grep -v "master" | xargs git branch -d