Life Cycle of a XinFin XDC Network Transaction

Voting.deployed().then(function(instance) {
instance.voteForCandidate(‘Ruslan’, {gas: 140000, from: web3.eth.accounts[0]}).then(function(r) {
console.log(“Voted successfully!”)
})
})
txnCount = xdc3.eth.getTransactionCount(xdc3.eth.accounts[0])
var rawTxn = {
nonce: xdc3.toHex(txnCount),
gasPrice: xdc3.toHex(100000000000),
gasLimit: xdc3.toHex(140000),
to: ‘xdc633296baebc20f33ac2e1c1b105d7cd1f6a0718b’,
value: xdc3.toHex(0),
data: ‘0xcc9ab24952616d6100000000000000000000000000000000000000000000000000000000’
};
const privateKey = Buffer.from(‘e331b6d69882b4ab4ea581s88e0b6s4039a3de5967d88dfdcffdd2270c0fd109’, ‘hex’)const txn = new EthereumTx(rawTxn)
txn.sign(privateKey)
const serializedTxn = txn.serialize()
transactionId = sha3(serializedTxn)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store