How to interact with contract in Truffle Console?

I successfully deployed a contract on Ropsten How do I interact with the contract on truffle console? I have tried

truffle console --network ropsten --verbose-rpc

let contract = await MyContract()
let contract = await MyContract.deployed()

Then try to call any methods but I keep getting

Uncaught TypeError: instance.getBalance is not a function


1 Like

Hi @jirosaito,

For an example see:

1 Like

Thank you, exactly what Iā€™m looking for. I was trying to find commands in the console but looks like I can just write a js script to run with console.log()

1 Like