Web3.eth.sendTransaction

Source: Internet
Author: User

If you want to start learning Ethereum dapp development immediately, you can visit the excellent online interactive tutorials provided by the Wisdom Network: Ethereum Dapp Practical Introductory Tutorial Ethereum to center e-commerce application development Combat

Send a transaction to the network. If the transaction was created by a contract, use Web3.eth.getTransactionReceipt () to obtain the address of the contract after the transaction is completed.

Call:

Web3.eth.sendTransaction (Transactionobject [, callback])

Parameter: Transactionobject:object-The transaction object to be sent.
From:string-The address of the specified sender. If not specified, use Web3.eth.defaultAccount. To:string-(optional) The destination address of the transaction message, if it is a contract creation, is not filled. value:number| String| BigNumber-(optional) The amount of money carried in the transaction, in Wei units. If the contract creates a transaction, it is the initial fund. gas:number| String| BigNumber-(optional) default is automatic, trading can be used gas, unused gas will be returned. gasprice:number| String| BigNumber-(optional) is automatically determined by default, the gas price of the trade, the default is the average of the network gas price. Data:string-(optional) or a byte string containing related data, or the code to initialize if it is a contract creation. Nonce:number-(optional) integer, using this value, allows you to overwrite your own, the same nonce that is being pending in the transaction 11. Function-callback functions, which are used to support asynchronous execution of 7.

return value: String-32 byte of the transaction hash string. expressed in 16 binary.

Example:

//compiled solidity source code using Https://chriseth.github.io/cpp-ethereum/var code = " 603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b60076

00435028060005260206000f3 "; Web3.eth.sendTransaction ({Data:code}, function (err, address) {if (!err) console.log (address);//"0x7f9fade1c0d57a 7af66ab4ead7c2eb7b11a91385 "}); 
Related Keywords:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.