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 express to connect server | |
var express = require("express"); | |
var app = express(); | |
// require request to connect to blockchain.info api | |
var request = require("request"); | |
// request blockchain.info api in json and save api data in variables | |
request({ | |
url: "http://blockchain.info/stats?format=json", |
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
// download bitcore-lib | |
npm install bitcore-lib | |
// require bitcore | |
var bitcore = require("bitcore-lib"); | |
// copy the code from BitPay's example to create an OP RETURN | |
var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy'); | |
var utxo = { | |
"txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986", |
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
// You must have node and npm downloaded on your computer | |
// Download bitcoinjs library | |
npm install bitcoinjs-lib | |
// Require bitcoinjs-lib | |
var bitcoin = require("bitcoinjs-lib"); | |
// Make variable for keyPair | |
var keyPair = bitcoin.ECPair.makeRandom(); |
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
// Node and npm are required for this gist | |
// Install mongoose | |
npm install mongoose | |
// On https://mlab.com/create click on Free Sandbox and give your DB a name | |
// You are then given a database on the next screen | |
// Give your database a new username and password | |
// The mongo shell and MongoDB URI should now be visible |
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
// First you need to have node version 5 or newer | |
// Create a new project folder with a package.json file | |
mkdir [[new project name]] | |
cd [[new project name]] | |
npm init | |
// Install babel | |
npm install babel-preset-es2015 |
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
// First download node, create new folder | |
// Cd into new folder, npm and git init | |
// Create heroku app | |
heroku create | |
// install babel cli (to do compiling), babel presets (to compile the right features), express (web server) | |
npm install babel-cli babel-presets-es2015 express | |
// Create file .babelrs and add json |
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
// Node must be downloaded to beign | |
// Install ripple-lib // A JavaScript API for interacting with Ripple in Node.js and the browser | |
npm install ripple-lib | |
// In Node require ripple-lib | |
const {RippleAPI} = require('ripple-lib'); | |
// The object that is returned contains all the functionality to query the ripple network | |
// First you must connect to Ripples servers // Run this from node terminal |
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
// Node must be downloaded | |
// Install Ripple-Wallet package | |
npm install ripple-wallet | |
// In a node terminal require ripple wallet | |
var lib = require('ripple-wallet') | |
// Generate a Wallet | |
var RippleWallet = require('ripple-wallet') | |
RippleWallet.generate(); |
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
function getQueryVariable(variable) { | |
var query = window.location.search.substring(1); | |
var vars = query.split('&'); | |
for (var i=0; i < vars.length; i++) { | |
var pair = vars[i].split('='); | |
if (decodeURIComponent(pair[0]) == variable) { | |
return decodeURIComponent(pair[1]); | |
} | |
} |
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
// Start Mongod // From terminal run mongod | |
// start mongo shell // from terminal run mongo | |
// Create a new Collection | |
db.createCollection('[[name]]') | |
// Create a User | |
db.createUser( { "user" : "[[name]]", | |
"pwd": "[[password]]" } ) |