I'm following truffle tutorial to interact with a deployed contract and have a naive question. How do I run this block of multiline scripts in truffle(development)> without collapsing it into a single line?
var account_one = "0x1234..."; // an address
var account_two = "0xabcd..."; // another address
var meta;
MetaCoin.deployed().then(function(instance) {
meta = instance;
return meta.sendCoin(account_two, 10, {from: account_one});
}).then(function(result) {
// If this callback is called, the transaction was successfully processed.
alert("Transaction successful!")
}).catch(function(e) {
// There was an error! Handle it.
})
SyntaxError: Unexpected end of inputatMetaCoin.deployed().then(function(instance) {. – sinoTrinity Jan 17 '18 at 00:27exec ./somefile.jsfrom console. Before this you will need to usemigrateto deploy your contracts to a blockchain, which you can run with Ganache or truffle develop. – Roman Frolov Jan 17 '18 at 02:05