- Creating a project
- Choosing an Ethereum client
- Compiling contracts
- Running migrations
- Testing your contracts
- Writing tests in Solidity
- Interacting with your contracts
- Package management via EthPM
- Package management via NPM
- Debugging your contracts
- Using the console
- Writing external scripts
- Using the build pipeline
- Contact the developers
Sometimes it's nice to work with your contracts interactively for testing and debugging purposes, or for executing transactions by hand. Truffle provides you an easy way to do this via an interactive console, with your contracts available and ready to use.
To fire up the console, simply run:
$ truffle console
When you load the console, you'll immediately see output like this:
$ truffle console truffle(development)>
This tells you you're running within a Truffle console using the
The console provides all the features available in the Truffle command line tool. For instance, you can type
migrate --reset within the console, and it will be interpreted the same as if you ran
truffle migrate --reset from outside the console. Truffle's console additionally has the following features:
- All of your compiled contracts are available and ready for use.
- After each command (such as
migrate --reset) your contracts are reprovisioned so you can start using the newly assigned addresses and binaries immediately.
web3library is made available and is set to connect to your Ethereum client.
- All commands that return a promise will automatically be resolved, and the result printed, removing the need to use
.then()for simple commands. e.g.,
truffle(default)> MyContract.at("0xabcd...").getValue.call(); 5