Skip to content

Instantly share code, notes, and snippets.

@jamesob
jamesob / 00_p2p.log
Last active March 19, 2023 04:03
2023-03-17 reorg as seen from 4 desktops
b-03.slug | 2023-03-18T01:46:16.587175Z [] Requesting block 000000000000000000014bdfbf46969d9b1f290ad21f27f263e14881ef595627 from peer=2522
b-03.slug | 2023-03-18T01:46:16.587241Z [] Requesting block 00000000000000000001e34fc5c0db02f3061e9d14df1d2df8c03cb3d72d0218 from peer=2522
b-03.slug | 2023-03-18T01:46:17.819765Z [] received block 000000000000000000014bdfbf46969d9b1f290ad21f27f263e14881ef595627 peer=2522
b-03.slug | 2023-03-18T01:46:18.790264Z [] received block 00000000000000000001e34fc5c0db02f3061e9d14df1d2df8c03cb3d72d0218 peer=2522
b-03.slug | 2023-03-18T01:46:19.264997Z [] UpdateTip: new best=000000000000000000014bdfbf46969d9b1f290ad21f27f263e14881ef595627 height=781277 version=0x2f832000 log2_work=94.064302 tx=815168901 date='2023-03-18T01:41:17Z' progress=0.999999 cache=41.5MiB(220936txo) warning='90 of last 100 blocks have unexpected version'
b-03.slug | 2023-03-18T01:46:19.303297Z [] UpdateTip: new best=00000000000000000001e34fc5c0db02f3061e9d14df1d2df8c03cb3d72d0218 height=781278 v
@jamesob
jamesob / rework.md
Last active March 2, 2023 19:09
AJ/Greg-ish OP_VAULT rework

Required opcodes

  • OP_VAULT: spent to trigger withdrawal
  • OP_VAULT_RECOVER: spent to recover
  • OP_CTV: spent into final withdrawal target

Initial deposit

Output structure

@jamesob
jamesob / bitcoin-printstack.cpp
Last active January 24, 2023 18:11
Bitcoin script debugging
// For debugging bitcoin script execution (in EvalScript)
#include <logging.h>
template <typename T>
void print_bytes(const T& thing, std::string name)
{
std::string bytes;
for (auto c : thing) {
bytes += tfm::format("%02x ", c);
}
@jamesob
jamesob / connect-to-wework.sh
Created October 24, 2022 12:22
How to connect to WeWork's 802.1x wifi network (WeWorkWifi) with NetworkManager on Linux
# Go to wifi.we.co to get your credentials first
% nmcli con add con-name wework type wifi ssid WeWorkWiFi
% nmcli con edit wework
nmcli> set ipv4.method auto
nmcli> set 802-1x.eap peap
nmcli> set 802-1x.identity <YOUR_EMAIL>
nmcli> set 802-1x.phase2-auth mschapv2
nmcli> set wifi-sec.key-mgmt wpa-eap

commands index

bench name command
ibd.local.range.500000.555000 bitcoind -dbcache=8000 -debug=coindb -debug=bench -listen=0 -connect=0 -addnode=127.0.0.1:8888 -prune=9999999 -printtoconsole=0 -assumevalid=0

bench/ctv vs. $mergebase (absolute)

bench name x bench/ctv $mergebase
@jamesob
jamesob / instructions.md
Created January 2, 2022 02:33
Install Spotify to run under Debian/Sway natively
  1. Install Spotify in the usual way:
curl -fsSL https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/spotify.gpg
sudo apt update && sudo apt install spotify-client
  1. Compile stubs for X-specific calls that Spotify makes:
$ cat xstub.c
@jamesob
jamesob / rangediff.diff
Created November 18, 2021 21:55
git range-diff --color=never upstream/master jonasschnelli/2020/12/filterblocks_rpc HEAD
-: ---------- > 1: 608d8b4a62 rpc: move-only: consolidate blockchain scan args
1: 6a69dd267e ! 2: d836ce3f2f Add scanblocks RPC call - scan for relevant blocks with descriptors
@@ Metadata
Author: Jonas Schnelli <dev@jonasschnelli.ch>
## Commit message ##
- Add scanblocks RPC call - scan for relevant blocks with descriptors
+ rpc: add scanblocks - scan for relevant blocks with descriptors
+
+ Co-authored-by: James O'Beirne <james.obeirne@gmail.com>
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
util/syscall_sandbox.cpp:116:6: error: use of undeclared identifier '__NR_copy_file_range'
{__NR_copy_file_range, "copy_file_range"},
^
util/syscall_sandbox.cpp:271:6: error: use of undeclared identifier '__NR_pkey_alloc'
{__NR_pkey_alloc, "pkey_alloc"},
^
util/syscall_sandbox.cpp:272:6: error: use of undeclared identifier '__NR_pkey_free'
{__NR_pkey_free, "pkey_free"},
^
@jamesob
jamesob / utxo-dumpload.61.62.diff
Created May 27, 2021 20:50
utxo-dumpload.61 -> .62
$ git range-diff master utxo-dumpload.61 utxo-dumpload.62
1: a5d6f365c < -: --------- validation: fix up LoadBlockIndex and RewindBlockIndex for multiple chainstates
2: 356ad5d86 < -: --------- validation: parameterize VerifyDB by chainstate
-: --------- > 1: 24df1d6af validation: change UpdateTip for multiple chainstates
-: --------- > 2: f1c2115cf validation: fix CheckBlockIndex for multiple chainstates
-: --------- > 3: a1b9a476f move-only: unittest: add test/util/chainstate.h
-: --------- > 4: c42dc9aa9 test: refactor: separate CreateBlock in TestChain100Setup
-: --------- > 5: e70c94715 refactor: remove assertions preventing multiple chainstates
-: --------- > 6: 0e06cd361 test: validation: add unittest for UpdateTip behavior
@jamesob
jamesob / inflation.ipynb
Created September 24, 2020 21:01
crackpot inflation calculations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.