Author: Not specified Language: javascript
Description: Not specified Timestamp: 2017-07-27 10:46:06 +0000
View raw paste Reply
  1. var _greeting = "Hello World!"
  2. var greeterContract = web3.eth.contract(greeterCompiled.greeter.info.abiDefinition);
  3.  
  4. var greeter = greeterContract.new(_greeting,{from:web3.eth.accounts[0], data: greeterCompiled.greeter.code, gas: 300000}, function(e, contract){
  5.     if(!e) {
  6.  
  7.       if(!contract.address) {
  8.         console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");
  9.  
  10.       } else {
  11.         console.log("Contract mined! Address: " + contract.address);
  12.         console.log(contract);
  13.       }
  14.  
  15.     }
  16. })
View raw paste Reply