I'm attempting to run the greeter contract on the live network. I'm following the commands as per the official tutorial, which worked on a test network when I tried it a while ago (on a different machine).
On entering the commands I'm getting an undefined response, though all variables are correctly defined when manually called on the console.
On entering the final var greeter, I'm correctly prompted for the passphrase of the account being used, which seems to go through. However, the pasted script itself doesn't seem to be called - there's no console log output.
Any ideas what I've missed out?
[Note: There's plenty of ether in the account being used.]
[Note2: The console has truncated long lines in the below log. I've confirmed they copied correctly.]
> {g) public { greeting = _greeting; } function greet() constant returns (string) { return greeting; } }'
undefined
>
> var greeterCompiled = web3.eth.compile.solidity(greeterSource)
undefined
> var _greeting = "Reason has always existed, but not always in a reasonable form."
undefined
> var greeterContract = web3.eth.contract(greeterCompiled.greeter.info.abiDefinition);
undefined
> {,{from:web3.eth.accounts[0], data: greeterCompiled.greeter.code, gas: 1000000}, function(e, contract){
if(!e) {
if(!contract.address) {
{saction send: TransactionHash: " + contract.transactionHash + " waiting to be mined .");
} else {
console.log("Contract mined! Address: " + contract.address);
console.log(contract);
}
}
})
Please unlock account <account_address_removed>.
Passphrase:
Account is now unlocked for this session.
undefined
web3.eth.defaultAccount = web3.eth.accounts[0]? – jayD Feb 12 '16 at 21:19var greeter = greeterContract.new(_greeting,{from:web3.eth.accounts[0], data: greeterCompiled.greeter.code, gas: 300000}, function(e, contract){ if(!e) {
})
– jayD Feb 12 '16 at 21:27web3.eth.defaultAccountas you suggested, but that hasn't helped. It's not my code - it's the standard Greeter code from the tutorial on the wiki: https://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial. Which bit looks incorrect? – Richard Horrocks Feb 12 '16 at 21:34undefinedin javascript isn't a bad thing. Variable declarations always return undefined, its nothing to worry about. – Tjaden Hess Feb 14 '16 at 06:51