Interaction with the contract

Truffle also provides a console (a command-line interface) that allows interaction with the contracts. All deployed contracts are already instantiated and ready to use in the console. This is an REPL-based interface that means Read, Evaluate, and Print Loop. Similarly, in the geth client (via attach or console), REPL is used via exposing JSRE (JavaScript runtime environment). The console can be accessed by issuing the following command:

$ truffle console  

This will open a command-line interface, as shown here:

The truffle console

Once the console is available, various methods can be run in order to query the contract. ...

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.