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 install the dependencies - insert this to your package.json and run npm install | |
"sequelize": "^3.5.1", | |
"sqlite3": "^3.1.4" | |
// Require Sequelize | |
// (new Sequelize dependencies can be (undefined, undefined, undefined) for quick setup | |
// set dialect to a 'sqlite' db | |
// set storage to the file you want the db to be with a .sqlite at the end | |
var Sequelize = require('Sequelize'); |
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
// Run Command from Terminal | |
geth --rpc --rpcapi="db,eth,net,web3,personal" --rpcport "8545" --rpcaddr "127.0.0.1" --rpccorsdomain "localhost" console | |
// Check Sol is Configured | |
eth.getCompilers() | |
// In a New Terminal Window Run TestRPC | |
cd ~PATH-TO-FILE | |
testrpc |
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 sign up for an account with BiyPay and create a new API key | |
//Download bitpay-node | |
sudo npm install bitpay-node | |
//Go to node console and require bitpay-node | |
Bitpay = require('bitpay-node') | |
//Create new Bitpay client | |
var client = new Bitpay.Client({ apiKey: '' }) |
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.json | |
{ | |
"dependencies": { | |
"web3": "0.17.0-alpha", | |
"solc": "^0.4.4" | |
} | |
} | |
//Create file Ecrow.sol and create 3 variables: a buyer, a seller, and an arbiter | |
contract Escrow { |
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
//Smart Contracts are a series of Ethereum Virtual Machine OP Codes | |
//Solidity it higher level and is compiled to EVM bytecode | |
// package.json | |
{ | |
"dependencies": { | |
"web3": "0.17.0-alpha", | |
"solc": "^0.4.4" | |
} | |
} |
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
//Get token from BlockCypher when you create an account at blockcypher.com | |
//Create rawTx object | |
{ nonce: '0x13', | |
to: '', | |
gasPrice: '', | |
gasLimit: '', | |
value: '', | |
data: '' } |
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 get an API endpoint to the Ethereum mainnet from infura.io | |
var endpoint = "https://mainnet.infura.io/[[insert-passcode]]" | |
//Require and setup new Web3 | |
var Web3 = require("web3") | |
var EthTx = require("ethereumjs-tx") | |
//Create two accounts from TestRPC | |
var acct1 = "" | |
var acct2 = "" |
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
//Set Variable for PrivateKey in TestRPC | |
var pKey1 = "" | |
//Require EthTx | |
var EthTx = require("ethereumjs-tx") | |
//Create Buffer Encoded Class | |
var pKey1x = new Buffer(pKey1, 'hex') | |
//Create Raw Transaction Data Structure |
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.json | |
{ | |
"dependencies": { | |
"web3": "0.17.0-alpha", | |
"ethereumjs-util": "4.5.0", | |
"ethereumjs-tx": "1.1.2" | |
} | |
} | |
//Goto Node Console |
NewerOlder