Instantly share code, notes, and snippets.

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";
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"
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
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",
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)
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
View main.go
package main
import (
"bytes"
"encoding/hex"
"encoding/json"
"io/ioutil"
"log"
"net/http"
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()