Skip to content

Instantly share code, notes, and snippets.

💭 is where I play.

Chris Troutner christroutner

💭 is where I play.
Block or report user

Report or block christroutner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

#WTFNode This is a dump of the logs from using wtfnode library to print out a list of Promises in the event loop after 50 minutes of reseting the production servers:

{"message":"wtfnode info: [WTF Node?] open handles:","level":"verbose","timestamp":"2019-06-20T09:18:56.091Z"}
{"message":"wtfnode info: - File descriptors: (note: stdio always exists)","level":"verbose","timestamp":"2019-06-20T09:18:56.091Z"}
{"message":"wtfnode info:   - fd 1 (stdio)","level":"verbose","timestamp":"2019-06-20T09:18:56.091Z"}
{"message":"wtfnode info:   - fd 2 (stdio)","level":"verbose","timestamp":"2019-06-20T09:18:56.091Z"}
{"message":"wtfnode info: - Sockets:","level":"verbose","timestamp":"2019-06-20T09:18:56.091Z"}
{"message":"wtfnode info:   - ::ffff: -> ::ffff:","level":"verbose","timestamp":"2019-06-20T09:18:56.091Z"}
christroutner /
Created May 19, 2019
Install IPFS on Ubuntu
tar -xvf go-ipfs_v0.4.20_linux-amd64.tar.gz
rm go-ipfs_v0.4.20_linux-amd64.tar.gz
cd go-ipfs
sudo ./
christroutner /
Last active Apr 13, 2019
BCH Mainnet Blockchain Size With Compression


I did a test of the size of the BCH mainnet blockchain, along with different compression formats. I tried 7zip on the highest compression setting, and that seemed to do the best. For comparison, I did a tar.gz file, as that is a common compression format for Linux:

  • 165 GB - Blockchain size uncompressed
  • 130 GB - tar.gz compressions
  • 113 GB - 7zip ultra compression
christroutner /
Last active Apr 16, 2019
BlockBook vs Insight API in


This document is an analysis of the endpoints in that rely on Insight API. Each endpoint is analyized with respect to replacing the use of Insight API.

My take-away from this analysis is that BlockBook API is very close to a drop-in replacement for Insight API. If there is ever any risk of Insight API ending support or getting forked off the network, BlockBook API would be an adaquate replacement. If the BITBOX team wants to be proactive, we could create additional endpoints and slowly begin to phase out Insight API, giving our users time to migrate.

There are approximately 5 endpoints on that call Insight API. Here is how they compare with BlockBook API:


View test-rate-limit.js
"use strict";
const axios = require("axios");
//const SERVER = ``;
const SERVER = `http://localhost:3000/v2/`;
// Inspect utility used for debugging.
const util = require("util");
util.inspect.defaultOptions = {

The purpose of this gist is to explore different formats for a new endpoint on with regard to SLP transaction details.

The examples below are based on this testnet TXID: 57b3082a2bf269b3d6f40fee7fb9c664e8256a88ca5ee2697c05b9457822d446

The above transaction was generated by the SLP SDK examples. An initial quantity of 1234 tokens was produced. Here is the token details. The TX above is sending 12.3 tokens from that initial quantity to testnet address bchtest:qqukhrjh45xttrfsu2vj7gsy0v7zqdm65cd8t4me9y.

The objective/scope of this new rest endpoint is to take a TXID as input, and produce the following convenient metadata as output:

  • sentFrom
  • sentTo
christroutner /
Last active Feb 1, 2019
Raspberry Pi - USB Flash Drive Configuration

Notes on how to permanently configure a USB flash drive.

  • Format the flash drive to ext4 as that is the native format for linux and Raspbian.

  • Give the flash drive a label. The label will be used by the system to detect the drive and mount it to a specific location.

tail -f /var/log/messages handy command to look at system messages.

christroutner /
Created Feb 1, 2019
Adding Swap Memory to Raspberry Pi

These are notes on how to bump up the swap memory on a Raspberry Pi B+ v3 to 2GB. That means it will have 1GB of RAM and 2GB of swap memory on the SD card. Best to use a class 10 SD card for this. Raspbian uses dphys-swapfile, which is a swap-file based solution instead of the "standard" swap-partition based solution. It is much easier to change the size of the swap.

The configuration file is:

/etc/dphys-swapfile The content is very simple. By default my Raspbian has 100MB of swap:

christroutner /
Created Jan 28, 2019
Raspberry Pi Initialization
# This is a bash shell script for running on a Raspberry Pi with a newly
# installed Raspbian OS. It prepares the device for use as a web server by
# deleting a lot of unused software, updating the OS, and installing Docker.
# Purge unneeded software
sudo apt-get --purge -y remove libreoffice libreoffice-avmedia-backend-gstreamer \
libreoffice-base libreoffice-base-core libreoffice-base-drivers libreoffice-calc \
libreoffice-common libreoffice-core libreoffice-draw libreoffice-gtk \
libreoffice-impress libreoffice-java-common libreoffice-math \
libreoffice-report-builder-bin libreoffice-sdbc-hsqldb libreoffice-style-galaxy \
You can’t perform that action at this time.