Skip to content

Instantly share code, notes, and snippets.

@bitgord
Created December 5, 2016 02:40
Show Gist options
  • Save bitgord/fb2e46282b89dcb6132ddf99452f42fa to your computer and use it in GitHub Desktop.
Save bitgord/fb2e46282b89dcb6132ddf99452f42fa to your computer and use it in GitHub Desktop.
Introduction to Etheream transactions using Blockcypher's API
//Get token from BlockCypher when you create an account at blockcypher.com
//Create rawTx object
{ nonce: '0x13',
to: '',
gasPrice: '',
gasLimit: '',
value: '',
data: '' }
//Increment the nonce
var rawTx = Object.assign(rawTx, { nonce: '[[update]]' })
//Sign transaction
var tx = new EthTx(rawTx)
tx.sign(pKey1x)
//Serialize
tx.serialize().toString('hex')
//Copy raw transaction data output from above
//Run from command line
curl -sd '{"tx": "[[raw transaction data]]"}' https://api.blockcypher.com/v1/eth/main/txs/push?token=[[insert token]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment