Vertices Docs
  • Welcome ๐Ÿ‘จโ€๐Ÿ’ป
  • โš™๏ธ Vertices SDK
    • Quickstart
      • Unix
        • New account
        • Pay transaction
        • Application call
      • Microcontrollers
        • PlatformIO
        • ESP-IDF
        • Zephyr (soon)
    • API Reference
      • Providers
      • Accounts
      • Events
      • Transactions
      • Applications
    • Porting guide
      • Starting from scratch
      • New vertex
      • HTTP Client
      • Handling events
Powered by GitBook
On this page

Was this helpful?

  1. โš™๏ธ Vertices SDK
  2. Quickstart
  3. Unix

Application call

Interact with a decentralised application: store a value on the blockchain.

PreviousPay transactionNextMicrocontrollers

Last updated 3 years ago

Was this helpful?

We have set up a really simple stateful smart contract to test the application calls. This smart contract is expecting an integer as a parameter. It then stores the sum of values and the number of values as global states within the application and the last value sent as a local state in the user account.

The smart contract source can be found .

Once you've put some money into your account, you can run the Unix example program with the -a flag:

$ ./examples/unix/unix_example -a
๐ŸŸข [examples/unix/main.c:245] ๐Ÿ˜Ž Vertices SDK running on Unix-based OS
๐ŸŸข [examples/unix/main.c:140] ๐Ÿ”‘ Loading private key from: /Users/cyril/Documents/work/vertices/c-vertices-sdk/examples/unix/config/private_key.bin
๐ŸŸข [examples/unix/main.c:201] ๐Ÿ’ณ Alice's account E3PGTXKDOODVQ3E2ZB5PMJF2W3YOKIPUPLFDTESSP6562QE4GTLAKO4VXY
๐ŸŸข [examples/unix/main.c:278] ๐ŸŽ Running on testnet-v1.0 v.2.6.0
๐ŸŸข [src/account.c:42] ๐Ÿ‘› Added account to wallet: #0
๐ŸŸข [src/account.c:42] ๐Ÿ‘› Added account to wallet: #1
๐ŸŸข [examples/unix/main.c:293] ๐Ÿค‘ 2.907842 Algos on Alice's account (E3PGTXKDOODVQ3E2ZB5PMJF2W3YOKIPUPLFDTESSP6562QE4GTLAKO4VXY)
๐ŸŸข [src/algorand/algorand_transaction.c:435] ๐Ÿงพ Transaction executed, ID: WEXZJNY4UIVTZLYP2DXMZZTA5FMEEOLCQCVM6J66DZDCAW6YJWZQ
๐ŸŸข [src/account.c:104] ๐Ÿ‘› Deleted account from wallet: #0
๐ŸŸข [src/account.c:104] ๐Ÿ‘› Deleted account from wallet: #1

Here is the status of the transaction:

Opt-In

If the account calling the smart contract never opted in the application, it will be automatically done.

Now you can check the transaction status on , using the transaction ID printed WEXZJNY4UIVTZLYP2DXMZZTA5FMEEOLCQCVM6J66DZDCAW6YJWZQ.

AlgoExplorer for Testnet
here
Overview of the Smart Contract's behavior
Application call transaction