In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to use web3.eth.sendTransaction". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Send a transaction to the network. If the deal was created by a contract, use web3.eth.getTransactionReceipt () to get the address of the contract after the transaction is completed.
Call:
Web3.eth.sendTransaction (transactionObject [, callback])
Parameters:
TransactionObject: Object-the transaction object to be sent.
From: String-the address of the specified sender. If not specified, web3.eth.defaultAccount is used.
To: String-(optional) the destination address of the transaction message. If it is a contract creation, it is not filled in.
Value: Number | String | BigNumber-(optional) the amount of currency carried by the transaction, in wei. If the contract creates a transaction, it is the initial fund.
Gas: Number | String | BigNumber-(optional) default is automatic, gas can be used for transactions, and unused gas will be returned.
GasPrice: Number | String | BigNumber-(optional) the gas price of the transaction is determined automatically by default. The default is the average network gas price.
Data: String-(optional) or a byte string containing the relevant data, or, in the case of contract creation, the code to be used for initialization.
Nonce: Number-(optional) integer, using this value, allows you to override your own transactions in the same nonce, which are in pending 11.
Function-callback function to support asynchronous execution of 7.
Return value:
String-32 byte transaction hash string. Expressed in hexadecimal.
Example:
/ / compiled solidity source code using https://chriseth.github.io/cpp-ethereum/var code = "603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3"; web3.eth.sendTransaction ({data: code}, function (err, address) {if (! err) console.log (address); / / "0x7f9fade1c0d57a7af66ab4ead7c2eb7b11a91385"}); that's all for "how to use web3.eth.sendTransaction". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.