https://github.com/ivanceras/near-counter
A counter example implemented on blockchain
https://github.com/ivanceras/near-counter
Last synced: over 1 year ago
JSON representation
A counter example implemented on blockchain
- Host: GitHub
- URL: https://github.com/ivanceras/near-counter
- Owner: ivanceras
- License: mit
- Created: 2022-03-30T11:19:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-20T18:49:06.000Z (over 4 years ago)
- Last Synced: 2024-05-23T07:54:38.217Z (about 2 years ago)
- Language: Rust
- Size: 203 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-Gitpod.md
- License: LICENSE
Awesome Lists containing this project
README
Counter example in Rust - Gitpod version
==================================================
This README is specific to Gitpod and this example. For local development, please see [README.md](README.md).
## Description
In Gitpod, the counter will start automatically. Please look in the terminal for a link to follow.
This contract implements simple counter backed by storage on blockchain.
Contract in `contract/src/lib.rs` provides methods to increment / decrement counter and get it's current value or reset.
Plus and minus buttons increase and decrease value correspondingly. When button L is toggled, a little light turns on, just for fun. RS button is for reset. LE and RE buttons to let the robot wink at you.
## To Test
```
cd contract
cargo test -- --nocapture
```
## To Explore
- `contract/src/lib.rs` for the contract code
- `src/index.html` for the front-end HTML
- `src/main.js` for the JavaScript front-end code and how to integrate contracts
- `src/test.js` for the JS tests for the contract
## Data collection
By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.