Skip to content

Instantly share code, notes, and snippets.

Ryan Smith ryandotsmith

Block or report user

Report or block ryandotsmith

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
@ryandotsmith
ryandotsmith / SimpleChainExample.java
Last active Mar 2, 2016
A simple example of Chain's Java SDK
View SimpleChainExample.java
import com.chain.*;
import java.math.BigInteger;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
public class Main {
private static String projectID = "proj0ACRX7YMG091G";
@ryandotsmith
ryandotsmith / limiter.go
Created Jul 31, 2015
HTTP token bucket rate limiting
View limiter.go
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"
@ryandotsmith
ryandotsmith / tutorial.md
Last active Oct 22, 2015
Chain's Asset Wallet - Creating, Issuing, and Transferring Assets
View tutorial.md

Tutorial - Creating, Issuing, and Transferring Assets

Overview

In this tutorial, we will do the following:

  1. Create an App Wallet
  2. Add the App Wallet Details to the Chain SDK
  3. Create a new Asset in the App Wallet called "Gold Stars"
  4. Create Buckets in the App Wallet for the Treasury and two users - Devon and Ryan
  5. Issue 10 Gold Stars into the Treasury
@ryandotsmith
ryandotsmith / payload.json
Created Mar 18, 2015
Chain Notifications Webhook Payload
View payload.json
{
"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",
@ryandotsmith
ryandotsmith / x.html
Created Mar 17, 2015
Sending a transaction in the browser
View x.html
<!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>
View ok-http.rb
require 'json'
require 'net/http'
require 'thread'
require 'openssl'
require 'uri'
module Okhttp
class Conn
def initialize(url)
@ryandotsmith
ryandotsmith / op_return.rb
Created Feb 9, 2015
Chain.com OP_RETRURN Transaction - Create Bitcoin OP_RETURN Transactions in Ruby
View op_return.rb
require 'bitcoin'
require 'chain'
Chain.block_chain = 'testnet3'
Bitcoin.network = :testnet3
include Bitcoin::Builder
key = Bitcoin::Key.from_base58("cVVBKRBMoPLJSSMW7cM3hji7VmXz1zJWX3DypcjPcWpRBMEu2xF7")
builder = Bitcoin::Builder::TxBuilder.new
@ryandotsmith
ryandotsmith / main.go
Created Jan 15, 2015
Sending an OP_RETURN Bitcoin Transaction with Go using Chain's Bitcoin API
View main.go
package main
import (
"bytes"
"encoding/hex"
"encoding/json"
"io/ioutil"
"log"
"net/http"
@ryandotsmith
ryandotsmith / block-chain-u.js
Last active Aug 29, 2015
Block Chain U Code Examples Week 1 Lecture 1
View block-chain-u.js
var bitcoin = require('bitcoinjs-lib');
var Chain = require('chain-node');
var chain = new Chain({
blockChain: "testnet3"
});
/*
* key = bitcion.ECKey.makeRandom()
* key.toWIF()
You can’t perform that action at this time.