Skip to content

Instantly share code, notes, and snippets.

View weex's full-sized avatar
updated profile 🤔

David Sterry weex

updated profile 🤔
View GitHub Profile
@weex
weex / gist:21ec2d613db4ffc612743d61d8604fe2
Created January 5, 2017 08:08
Fee flipping to -1.0 on restart of streamconfirmed
sqlite> select * from transactions;
1|9d82746075d3e0ce74c071799629824e8116e30bc2241636b8ae07cef0fe492c|1|2|226|10.9513274336283|2017-01-05 07:52:07.863906|2017-01-05 07:53:08.151285|60.287379|1063712|00000000f391e5c9bfe0b3d9b5fa0b0045d1c48e74ed215c06dee763332e25ce
2|06aaffe3c90d3181022328a589048e325458a12b970579805969d36891c97021|5|5|918|10.1960784313725|2017-01-05 07:52:37.948572|2017-01-05 07:53:08.202849|30.254277|1063712|00000000f391e5c9bfe0b3d9b5fa0b0045d1c48e74ed215c06dee763332e25ce
3|719b2a6a8e3ca2d8040614d9b5bcc9865baa979393b919423554332be6ee85b1|||223|-1.0|2017-01-05 07:53:08.034532||||
4|6ecd2b10becd62f81cd1bd3e6554d0a8100ba7beadfc7fdd795803328b49ef55|||226|-1.0|2017-01-05 07:54:08.332436||||
5|6ac25401ef82b4e553b28c61a80aacfbd937a4f7d203c91060b97ee7797e0b9b|||192|-1.0|2017-01-05 07:54:08.376398||||
6|54a3d4f832992262dcb157a393b9b11b9491247f13f930f2234fd785dc31c23d|||600|-1.0|2017-01-05 07:54:08.414363||||
7|d843470b9506ea5cfa13de4c37d5d6558cfade9b7372935717326e6908705e3b|||242|-1.0|2017-01-05 07:54
@weex
weex / olsign-no-msg-signing.py
Created December 30, 2016 02:41
olsign.py modded
#!/usr/bin/env python
#
# Sign a multisig transaction proposed by a Coinkite user. Require plaintext extended private
# key that was used when creating the account (ie. the co-signer's key).
#
import click, simplejson, requests, tempfile, time
from simplejson import JSONDecodeError
from pycoin import ecdsa
from pycoin.key.BIP32Node import BIP32Node
from pycoin.tx.script import der
@weex
weex / main.c
Created June 8, 2016 03:18
Particle Photon IoT board - Blink Bitcoin Price
#include "application.h"
#include "HttpClient/HttpClient.h"
int led2 = D7;
int count = 0;
int thousands;
int hundreds;
int tens;
int ones;
CScript([x('02f719f009fb8eb20ccdbfda7d38f378ed2f103ac0a6768df830740c6835c46519'), OP_CHECKSIGVERIFY, 2, x('026bc363139ebc1cad8e6eee402507d2b4874f5450585f1e6a1cd30a63ecdfc9dc'), x('029fcafbe2dced6fe79865b265ea90387c5411658ca11449999d5020a9f67bb005'), 2, OP_CHECKMULTISIG])
@weex
weex / gist:c8ddfe0c4b4a61a00dc0
Created January 6, 2016 23:55
Syncing Bitcoin Core on the 21BC
twenty@bitcoin-computer-i7ju:~/code/up$ time bitcoin-cli getinfo && date
{
"version" : 110000,
"protocolversion" : 70002,
"blocks" : 333173,
"timeoffset" : -2,
"connections" : 8,
"proxy" : "",
"difficulty" : 40007470271.27126312,
"testnet" : false,

Keybase proof

I hereby claim:

  • I am weex on github.
  • I am dsterry (https://keybase.io/dsterry) on keybase.
  • I have a public key whose fingerprint is D981 9683 2341 575F B403 C8CF 8029 A76D 14B2 4807

To claim this, I am signing this object:

[
{
"name": "dns/1",
"url": "http://10.244.249.223:12005/"
},
{
"name": "hashfs/1",
"url": "http://10.244.249.223:8000/"
},
{
@weex
weex / coreapi.md
Last active December 18, 2015 16:31

Bitcoin Core API Endpoint

This service provides access to a number of the functions provided by a full node running Bitcoin Core 0.11.2.

Example of getting the current network difficulty:

21 buy —maxprice 99 url http://10.244.34.100:8332/api/getdifficulty

Here's a list of available commands that you can run through this tool. Each one costs 99 sat to run.

@weex
weex / gist:fcf0b3f179c2883927f0
Last active December 8, 2015 09:08
Up Directory Service for Machine-payable Endpoints

Up

A directory service for machine-payable endpoints

Being able to find machine-payable endpoints is essential to building interesting applications both for machine and human consumption. To help with this, I wrote a directory service backed by a crawler and now with a text-based browser front-end.

The best intro is probably to use the endpoint browser. First, it will prompt you for confirmation and purchase the latest directory results for 250 satoshis. Then it will let you curl each endpoint through a menu. Get it from here, unzip the files and start it with:

"use strict";
// Dependencies.
var Bitcoin = require('bitcoinjs-lib');
var Buffer = require('buffer');
var generateHdWallet = require('./generateHdWallet');
var constants = require('./constants');
var utils = require('./utils');