Smart Contract Interaction
Last updated
Last updated
We’ve reached a key milestone—deploying our first smart contract. Now it’s time to interact with it! Be sure to save the smart contract address, usually the same as the transaction ID, as it’s essential for future interactions. If lost, you can recover it via the blockchain explorer.
With the contract deployed, you can now interact either directly through the IDE or by using the Circular Protocol APIs. As discussed earlier, there are two main ways to interact with your contract:
1. Directly through the IDE
2. Using Circular Protocol APIs for seamless integration.
Regular Transactions: These are submitted and executed as part of a blockchain block. To verify the outcome, you can check the blockchain explorer using the transaction’s unique ID.
Single Node Calls (SNCs): These aren’t full transactions but simple contract queries executed by a single node. The output is displayed in the IDE’s output section, similar to debugging.
Both interactions are easily managed within the IDE. To perform a regular transaction, simply enter the contract call into the Payload Terminal. Here’s an example to guide you:
For Single Node Calls we need to remember that the call will require a SNC method:
Instead of clicking the transaction icon, click the call icon to the left. Unlike a transaction, the call generates an immediate output, which will be displayed in the output section without creating a blockchain transaction.