In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use web3.eth.sendRawTransaction". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "how to use web3.eth.sendRawTransaction" together.
If the transaction is a contract creation, use web3.eth.getTransactionReceipt() to get the address of the contract after the transaction completes.
Call:
web3.eth.sendRawTransaction(signedTransactionData [, callback])
Parameters:
signedTransactionData: String -signed transaction data in hexadecimal format.
callback: Function -callback function, used to support asynchronous execution 7.
Return value:
String -A 32-byte transaction hash string in hexadecimal format.
Examples:
var Tx = require('ethereumjs-tx');var privateKey = new Buffer('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex')var rawTx = { nonce: '0x00', gasPrice: '0x09184e72a000', gasLimit: '0x2710', to: '0x0000000000000000000000000000000000000000', value: '0x00', data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057'}var tx = new Tx(rawTx);tx.sign(privateKey);var serializedTx = tx.serialize();//console.log(serializedTx.toString('hex'));//0xf889808609184e72a00082271094000000000000000000000000000000000000000080a47f74657374320000000000000000000000000000000000000000000000000000006000571ca08a8bbf888cfa37bbf0bb965423625641fc956967b81d12e23709cead01446075a01ce999b56a8a88504be365442ea61239198e23d1fce7d00fcfc5cd3b44b7215fweb3.eth.sendRawTransaction(serializedTx.toString('hex'), function(err, hash) { if (! err) console.log(hash);// "0x7 f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2eb7b11a91385"}); Thank you for reading, the above is the content of "how to use web3.eth.sendRawTransaction", after learning this article, I believe you have a deeper understanding of how to use web3.eth.sendRawTransaction, and the specific use needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.