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: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,
CScript([x('02f719f009fb8eb20ccdbfda7d38f378ed2f103ac0a6768df830740c6835c46519'), OP_CHECKSIGVERIFY, 2, x('026bc363139ebc1cad8e6eee402507d2b4874f5450585f1e6a1cd30a63ecdfc9dc'), x('029fcafbe2dced6fe79865b265ea90387c5411658ca11449999d5020a9f67bb005'), 2, OP_CHECKMULTISIG])
@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;
@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 / 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 / gist:b64fa1a685efc45e1df2e6be21ba63c8
Created January 22, 2017 21:46
Test of tor-broadcast with bitcoind v0.13.2
This file has been truncated, but you can view the full file.
(envjm) vagrant@vagrant:~/data/joinmarket$ make test
PYTHONPATH=.:/home/vagrant/envjm
py.test --cov-report html --btcroot=/usr/bin/ --btcconf=/home/vagrant/.bitcoin/bitcoin.conf --btcpwd=GYRVQOHIJXDNTFWBZASPMELCKU --nirc=2 --ignore test/test_tumbler.py
============================================================ test session starts ============================================================
platform linux2 -- Python 2.7.12, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /home/vagrant/data/joinmarket, inifile:
plugins: cov-2.4.0
collected 94 items
test/test_addresses.py ..
@weex
weex / gist:d9c0cab3d7e1f879dbb07169922fa7b0
Created March 18, 2017 03:50
bitcoin-cli listunspent - json example
vagrant@vagrant:~/causeway$ bitcoin-cli listunspent
[
{
"txid": "363739b300147839c24dee857bc7224dbe2e5e506e5dca7486edc4f0c385d8c9",
"vout": 0,
"address": "mjrhuk5SnsySp9VGvhCwvfgK3pwYU6Jm4y",
"account": "",
"scriptPubKey": "76a9142f9cd08d70c44bab7eb889b8402131479ebfd44088ac",
"amount": 0.02500000,
"confirmations": 1,

JSON document format

In order to provide for easier parsing, verification and display of Rein documents, the document format is being changed from a colon-delimited form to the more standard JSON format. The JSON standard is well-known and widely-implemented with native support in Python, Javascript and many other languages.

Example signed document in the new format:

{
 "title": "Rein Job",
diaspora@diaspora:~/diaspora/config$ gem install bundler
Fetching bundler-2.2.19.gem
Successfully installed bundler-2.2.19
Parsing documentation for bundler-2.2.19
Installing ri documentation for bundler-2.2.19
Done installing documentation for bundler after 63 seconds
1 gem installed
diaspora@diaspora:~/diaspora/config$ script/configure_bundler
-bash: script/configure_bundler: No such file or directory
diaspora@diaspora:~/diaspora/config$ cd ..
...
10993 timing build:link:node_modules/sshpk Completed in 27ms
10994 timing build:link:node_modules/uglify-js Completed in 27ms
10995 timing build:link:node_modules/uuid Completed in 27ms
10996 timing build:link:node_modules/which Completed in 27ms
10997 timing build:link:node_modules/accord/node_modules/uglify-js Completed in 26ms
10998 timing build:link:node_modules/gulp-eslint/node_modules/eslint Completed in 26ms
10999 timing build:link:node_modules/gulp-eslint/node_modules/semver Completed in 26ms
11000 timing build:link:node_modules/html-minifier/node_modules/uglify-js Completed in 26ms
11001 timing build:link Completed in 34ms