若是你但愿立刻开始学习以太坊DApp开发,能够访问汇智网提供的出色的在线互动教程:git
发送一个交易到网络。若是交易是一个合约建立的,请使用web3.eth.getTransactionReceipt()在交易完成后获取合约的地址。github
调用:web
web3.eth.sendTransaction(transactionObject [, callback])
参数:网络
transactionObject
: Object - 要发送的交易对象。
返回值:异步
String
- 32字节的交易哈希串。用16进制表示。示例:函数
// 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" });