Skip to content

Instantly share code, notes, and snippets.

💭
https://developer.bitcoin.com is where I play.

Chris Troutner christroutner

View GitHub Profile
@christroutner
christroutner / bch-blockchain-size.md
Last active Apr 13, 2019
BCH Mainnet Blockchain Size With Compression
View bch-blockchain-size.md

04/12/19

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
christroutner / blockbook-vs-insight.md
Last active Apr 16, 2019
BlockBook vs Insight API in rest.bitcoin.com
View blockbook-vs-insight.md

Overview

This document is an analysis of the endpoints in rest.bitcoin.com 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 rest.bitcoin.com that call Insight API. Here is how they compare with BlockBook API:

address/details/:address

View slp-token-links.md
View test-rate-limit.js
"use strict";
const axios = require("axios");
//const SERVER = `https://rest.bitcoin.com/v2/`;
const SERVER = `http://localhost:3000/v2/`;
// Inspect utility used for debugging.
const util = require("util");
util.inspect.defaultOptions = {
View slp-tx-details-brainstorming.md

The purpose of this gist is to explore different formats for a new endpoint on rest.bitcoin.com 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
christroutner / RPi-usb-flash.md
Last active Feb 1, 2019
Raspberry Pi - USB Flash Drive Configuration
View RPi-usb-flash.md

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.

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=176205

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

@christroutner
christroutner / RPi-swap.md
Created Feb 1, 2019
Adding Swap Memory to Raspberry Pi
View RPi-swap.md

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.

https://raspberrypi.stackexchange.com/questions/70/how-to-set-up-swap-space 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
christroutner / init-rpi.sh
Created Jan 28, 2019
Raspberry Pi Initialization
View init-rpi.sh
# 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 \
@christroutner
christroutner / electrumx-raspberry-pi.md
Last active Jan 19, 2019
Installing ElectrumX on a Raspberry Pi
View electrumx-raspberry-pi.md
@christroutner
christroutner / ccoinjoin-info.md
Last active Jan 2, 2019
Consolidating CoinJoin Information
View ccoinjoin-info.md
You can’t perform that action at this time.