/counter

A Counter for the Internet Computer in C

Primary LanguageCApache License 2.0Apache-2.0

A Counter for the Internet Computer in C

Build Status

Overview

This repository provides a simple example that demonstrates how to build an application for the Internet Computer in C. The source files provided here are compiled down to WebAssembly via Clang and linked against WebAssembly build targets for libc and libtommath via LLD.

Prerequisites

See the workflow for installation details.

Deployment

dfx start --background
dfx canister create counter
dfx build
dfx canister install counter

Usage

Get

Get the value of the counter.

dfx canister call counter get

Set

Set the value of the counter.

dfx canister call counter set '(123456)'

Increment

Increment the value of the counter.

dfx canister call counter inc

Decrement

Decrement the value of the counter.

dfx canister call counter dec

Contribute

Feel free to join in. All are welcome. Open an issue!