This example demonstrates a counter application.
This example requires an installation of:
- Install the IC SDK.
- Download the following project files from GitHub:
git clone https://github.com/dfinity/examples/
Begin by opening a terminal window.
Navigate into the folder containing the project's files and start a local instance of the Internet Computer with the commands:
cd examples/rust/counter
dfx start --background
cargo test
dfx deploy
dfx canister call counter set '(7)'
dfx canister call counter inc
dfx canister call counter get
The following output should be returned:
(8 : nat)
If you base your application on this example, we recommend you familiarize yourself with and adhere to the security best practices for developing on the Internet Computer. This example may not implement all the best practices.