Skip to content

Instantly share code, notes, and snippets.

Ship it!

Pierre Rochard PierreRochard

Ship it!
View GitHub Profile
View gist:c8444b41307a413ad5c552501ba5198e
from twython import Twython
api_key = input('Enter the API key: ')
api_secret = input('Enter the API secret: ')
twitter = Twython(api_key, api_secret)
auth = twitter.get_authentication_tokens()
View bitcoin_pr_query.graphql
query($prNumber: Int = 15024){
rateLimit {
repository(owner: "bitcoin", name: "bitcoin") {
pullRequest(number: $prNumber) {
PierreRochard / your_lightning_commitment_transaction_with_htlcs
Created May 9, 2019
Your version of the commitment transaction that you are holding off-chain (with HTLCs)
View your_lightning_commitment_transaction_with_htlcs
# Based on a diagram posted by @pm47
| 2-of-2 multi-sig funding tx confirmed on-chain |
View lnd.js
// npm init -f
// npm install grpc --save
// npm install @grpc/proto-loader --save
const grpc = require('grpc');
const fs = require('fs');
const protoLoader = require('@grpc/proto-loader');
View lnd_crash.txt
2018-11-03 12:34:10.500 [INF] DISC: Broadcasting batch of 2 new announcements
2018-11-03 12:34:40.501 [INF] DISC: Broadcasting batch of 4 new announcements
2018-11-03 12:35:10.500 [INF] DISC: Broadcasting batch of 3 new announcements
2018-11-03 12:35:40.499 [INF] DISC: Broadcasting batch of 1 new announcements
2018-11-03 12:36:21.474 [INF] RPCS: [listchannels] fetched 3 channels from DB
2018-11-03 12:36:21.474 [INF] RPCS: [listchannels] fetched 3 channels from DB
2018-11-03 12:36:42.041 [INF] RPCS: [listchannels] fetched 3 channels from DB
2018-11-03 12:36:47.475 [INF] RPCS: [newaddress] addr=tb1qfs02pqxf4jq30x5wmeevtsm9jddtus7luhep3j
2018-11-03 12:36:56.303 [INF] RPCS: [sendcoins] addr=tb1qfs02pqxf4jq30x5wmeevtsm9jddtus7luhep3j, amt=0.0018 BTC, sat/kw=253
2018-11-03 12:36:56.316 [INF] LNWL: Inserting unconfirmed transaction 29b4a9242652c10a71c31eb252a2324b662da8dc2d5eebecf7772f2ce057e635
View gist:6a1c3ec7ec333996b977a309ac9e893a
PS C:\Users\pierre> .\Documents\lnd-neutrino.bat
C:\Users\pierre>C:\Users\pierre\Documents\lnd.exe --bitcoin.testnet --autopilot.allocation=1 --autopilot.minchansize=600000 --autopilot.maxchannels=10 --autopilot.private --bitcoin.node=neutrino --debuglevel=debug
2018-10-28 07:22:23.715 [WRN] LTND: open C:\Users\pierre\AppData\Local\Lnd\lnd.conf: The system cannot find the file specified.
2018-10-28 07:22:23.716 [INF] LTND: Version 0.5.0-beta commit=3b2c807288b1b7f40d609533c1e96a510ac5fa6d
2018-10-28 07:22:23.718 [INF] LTND: Active chain: Bitcoin (network=testnet)
2018-10-28 07:22:23.721 [INF] CHDB: Checking for schema update: latest_version=6, db_version=6
2018-10-28 07:22:23.739 [INF] RPCS: password RPC server listening on
2018-10-28 07:22:23.739 [INF] RPCS: password gRPC proxy started at
2018-10-28 07:22:23.740 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a w
PierreRochard /
Last active Sep 22, 2018
gRPC Windows C# Command

From C:\Users\pierre.nuget\packages\\1.14.1\tools\windows_x64\protoc.exe -I./protos .\protos\helloworld.proto --csharp_out .\csharp\Helloworld\Greeter\ --grpc_out .\csharp\Helloworld\Greeter\ --plugin=protoc-gen-grpc=C:\Users\pierre.nuget \packages\\1.14.1\tools\windows_x64\grpc_csharp_plugin.exe

From C:\Users\pierre.nuget\packages\\1.14.1\tools\windows_x64\protoc.exe -I.\protos --csharp_out .\csharp\RouteGuide\RouteGuide --grpc_out .\csharp\RouteGuide\RouteGuide .\protos\route_guide.proto --plugin=protoc-gen-grpc=C:\Users\pierre.nuget\packages\\1.14.1\tools\windows_x64\grpc_csharp_plugin.exe


  1. git clone
  2. git clone
View WindowsLightning.txt
Download the latest 64 bit Windows version of Bitcoin Core
Install it but don't run it
& 'C:\Program Files\Bitcoin\bitcoin-qt.exe' -testnet=1 -txindex=1 -zmqpubrawblock=tcp:// -zmqpubrawtx=tcp:// -rpcuser=test_user -rpcpassword=test_password -server=1
& 'C:\Program Files\Bitcoin\bitcoin-qt.exe' -testnet=0 -txindex=1 -zmqpubrawblock=tcp:// -zmqpubrawtx=tcp:// -rpcuser=test_user -rpcpassword=test_password -server=1
Let it sync
Download the latest 64 bit Windows version of LND
View berkeley_environment_bug.cpp
Process 94602 stopped
* thread #24, name = 'bitcoin-httpworker', stop reason = breakpoint 1.1
frame #0: 0x0000000100367524 bitcoin-qt`GetWalletEnv(wallet_path=0x00007000059890a8, database_filename="regtest3.dat") at db.cpp:79 [opt]
76 // emplace function if the key already exists. This is a little inefficient,
77 // but not a big concern since the map will be changed in the future to hold
78 // pointers instead of objects, anyway.
-> 79 return &g_dbenvs.emplace(std::piecewise_construct, std::forward_as_tuple(env_directory.string()), std::forward_as_tuple(env_directory)).first->second;
80 }
82 //
You can’t perform that action at this time.