Created
December 5, 2016 02:40
-
-
Save bitgord/fb2e46282b89dcb6132ddf99452f42fa to your computer and use it in GitHub Desktop.
Introduction to Etheream transactions using Blockcypher's API
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: '' } | |
//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