This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Chain = require('chain-node'); | |
var chain = new Chain(blockChain: 'testnet3'); | |
var req = { | |
inputs: [{ | |
address: "mxLGQRD9p3MayF7WrUJsyuY4cZdPSH2yA4", | |
// Private key never leaves this process! | |
private_key: "cNX5yYSnj6Bd3BEjsfV6ZQyn8hQYYDQB79vjHNkv7NAPazo9GBJT", | |
}], | |
outputs: [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"inputs": [{ | |
"address": "mxLGQRD9p3MayF7WrUJsyuY4cZdPSH2yA4", | |
"signatures_required": 1, | |
"signatures": [{ | |
"address": "mxLGQRD9p3MayF7WrUJsyuY4cZdPSH2yA4", | |
"public_key": "<insert public key>", | |
"hash_to_sign": "ac366bdd3eb0ecd64d3d08a7d519d7fe5ceb263a499b135e3158fea04c87a89c", | |
"signature": "<insert signature>" | |
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+------------------+ +-------------------+ | |
| SDK/Your Process | | Chain API | | |
+------------------+ +-------------------+ | |
build transaction | |
+-------------------------------------> | |
transaction template | |
<-------------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bitcoin = require('bitcoinjs-lib'); | |
var Chain = require('chain-node'); | |
var chain = new Chain({ | |
blockChain: "testnet3" | |
}); | |
/* | |
* key = bitcion.ECKey.makeRandom() | |
* key.toWIF() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'net/http' | |
require 'thread' | |
require 'openssl' | |
require 'uri' | |
module Okhttp | |
class Conn | |
def initialize(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<p>Balance: <span id="balance"></span></p> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "94d50194-05c8-48bb-94d1-588edf3d286c", | |
"sequence": 163201, | |
"created_at": "2015-03-18T18:18:18.446537Z", | |
"delivery_attempt": 1, | |
"notification_id": "2d2f54c4-73c8-415f-88b7-2b13452f6851", | |
"type": "webhook", | |
"block_chain": "bitcoin", | |
"transaction": { | |
"hash": "da02037c03337c24439be90ff6cab0e4b9dec03cc4dbe08d8863763a52dcc0ef", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"sync" | |
"time" | |
"github.com/chain-engineering/papi/Godeps/_workspace/src/golang.org/x/net/context" | |
"github.com/chain-engineering/papi/api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Foraker, I wanted to give you a fresh code sample; not something that has been lying in my home dir. | |
# for a year. | |
# I was reading about tries the other day and decided to implement something in ruby. I built this code | |
# this morning and it has not gone through any refactorings. | |
# I want to showcase my ruby knowledge along with knowledge of data structures & algorithms. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PRECISION = 0.0001 | |
def newtonian_guess( guess,fx,fdx ) | |
loop do | |
better_guess = guess - ( fx.call( guess ).to_f / fdx.call( guess ).to_f ) | |
return better_guess if ((better_guess - guess).abs <= PRECISION) | |
guess = better_guess | |
end | |
end |