Wednesday, December 27, 2017

Truffle


Development

How to bootstrap a contract:
truffle init
truffle create contract NewContract
truffle create migration NewContract
truffle create test NewContract
truffle migrate --reset



Console:

How to get into console:
truffle console

How to call a contract's function in Truffle Terminal:
FlipCoin.deployed().then(function(instance){app = instance})
app.adopt(23) . //call method on contract class

How to check balance of an address in Truffle Terminal:
web3.eth.getBalance("0x627306090abaB3A6e1400e9345bC60c78a8BEf57")
web3.eth contains lots of methods

No comments:

Post a Comment