Interacting with smart contracts

Just as we did before, you can use the Truffle console to interact with your smart contract, as follows:

$ truffle console

Your smart contract is always given the name Contract. We can access the smart contract using the following statement:


You will get a long output in which you can see abi, bytecode, and so on, as shown in the following screenshot:

Let’s look at the value of the name variable of the smart contract using the following statement:

truffle(development)>"0x3E9417399786347B6Ab38f59d3f00829d6bba7b8").then(function(instance) ...

Get Hands-On Blockchain for Python Developers 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.