Interactively working with Truffle
Truffle provides an interactive console using which developers can interact with the current blockchain environment and contracts. This helps to find the current values in state variables, execute methods within the contract, check the changes in state values, debug scenarios, send Ether, query for balances, and so on in the current environment. Basically, developers can do everything with deployment contracts and accounts that they normally would do on a live blockchain.
Truffle provides the console
command to enter the console environment. It changes the environment to the network available based on the Truffle configuration. If there is only one network configured, then it becomes the default environment. Otherwise, a network name can be passed along with the command, such as truffle console –network development
.
To exit the console environment, the .exit
command can be executed from within the console environment.
Within the...