Skip to content

Instantly share code, notes, and snippets.

import codecs
import json
import os
import sys
import pprint
import grpc
from google.protobuf.json_format import MessageToJson
from tabulate import tabulate
>>> all_backup = bob.export_all_channel_backups()
>>> type(all_backup.single_chan_backups)
<class 'lnd_grpc.protos.rpc_pb2.ChannelBackups'>
>>> bob.verify_chan_backup(single_chan_backups=all_backup.single_chan_backups)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/satoshi/Documents/src/lnd_grpc/lnd_grpc/lightning.py", line 484, in verify_chan_backup
response = self.lightning_stub.VerifyChanBackup(request)
File "/Users/satoshi/Documents/src/lnd_grpc/.venv/lib/python3.7/site-packages/grpc/_channel.py", line 549, in __call__
return _end_unary_response_blocking(state, call, False, None)

Keybase proof

I hereby claim:

  • I am willcl-ark on github.
  • I am willcl_ark (https://keybase.io/willcl_ark) on keybase.
  • I have a public key ASDI5n7rvhxIhPw85s8Dk3rqN4_8kz7dzW6J7fZKknHnRQo

To claim this, I am signing this object:

"""lightning mesh proxy.
Usage:
proxy.py MY_PUBKEY REMOTE_PUBKEY REMOTE_GID
Arguments:
MY_PUBKEY my node pubkey
REMOTE_PUBKEY the pubkey of the remote node
REMOTE_GID the GID of the remote node
"""
@willcl-ark
willcl-ark / git_aliases_PRs.txt
Created April 23, 2020 08:52
git aliases to checkout and remove PRs easily
# Add this section to your global ~/.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"
pr-clean = "!git for-each-ref refs/heads/pr/* --format=\"%(refname)\" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
spr = "!f() { git fetch -fu ${2:-$(git remote |grep ^upstream || echo origin)} refs/pull-requests/$1/from:pr/$1 && git checkout pr/$1; }; f"
@willcl-ark
willcl-ark / will-clark-LPE.md
Created October 14, 2021 13:33
will-clark-LPE response

Will Clark - Protocol Engineer Take Home Question

Consider the following protocol spec:

Request format:

PACKET := HEADER | BODY

HEADER := LENGTH | TYPE
#!/usr/bin/env python3
"""
A script to check that generated out files which use special compilation units
do not contain any disallowed sections. See #18553 for additional context.
Special instructions include:
SSE42
SSE41

This was written in response to bitcoin/bitcoin#27578 and any other number of occurrences of the topic.

“Standardness policy” is a term for a transaction that would be consensus-legal, but our node doesn’t want to relay for various reasons. Clearly if it’s consensus valid we want to accept it to not split the network if a miner chooses a “weird” transaction to mine.

There are N motivations for policy that I know of:

  1. Anti-DoS: Only “cheap” things to validate get flooded to the network
  2. Security: Certain types of transactions may mess up certain systems for no good reason
  3. Upgrade hooks: We leave some things “forbidden” such that if we find a use for them later we don’t “confiscate” funds by refusing to relay e.g., a spend or pre-signed transaction
  4. Pro-decentralization: Make it simple/cheap for miners to build blocks that pay well
@willcl-ark
willcl-ark / core_log.diff
Created June 28, 2023 09:06
bitcoin core log patch
commit 39e9f43014e9aa9383cc792015e91774fa5b792b
Author: willcl-ark <will@256k1.dev>
Date: Thu Jun 15 09:08:05 2023 +0100
RPC: add 'log' rpc to set single
diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp
index 3828401642..4f1986695b 100644
--- a/src/rpc/node.cpp
+++ b/src/rpc/node.cpp