https://github.com/nthe/lisk-dapp-polls
Decentralized polling application on Lisk.
https://github.com/nthe/lisk-dapp-polls
application blockchain distributed javascript lisk polling
Last synced: 13 days ago
JSON representation
Decentralized polling application on Lisk.
- Host: GitHub
- URL: https://github.com/nthe/lisk-dapp-polls
- Owner: nthe
- Created: 2020-03-22T16:50:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-31T18:17:49.000Z (about 5 years ago)
- Last Synced: 2024-07-24T10:34:21.526Z (almost 2 years ago)
- Topics: application, blockchain, distributed, javascript, lisk, polling
- Language: JavaScript
- Homepage:
- Size: 419 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Decentralized voting app on Lisk
## Installation
Check out [Lisk SDK examples](https://github.com/LiskHQ/lisk-sdk-examples) and official [lisk.io documentation](https://lisk.io/documentation/lisk-sdk/index.html) for setup instructions.
## Description
Below is the short description of states and transactions.
### Poll states
Each poll is set to created when created. Closed poll cannot be re-opened. Polls and their results cannot be deleted.
1.**Created** state
- everyone can view the poll
- noone can vote
- the owner can open the poll
2.**Opened** state
- everyone can view the poll
- everyone can vote and change their vote
- noone can see the results
- the owner can close the poll
3.**Closed** state
- everyone can view the poll
- everyone can display results
- noone can change the vote
### Transactions
In order to achieve all mentioned states, three transactions were created.
- create poll
- update poll
- vote
Polls and votes are stored on the senders account in following form.
```js
// PollState = [ "created", "opened", "closed" ]
{
...
"address": string,
"balance": BigNum,
"asset": {
"polls" [
{
"id": uuid, // pollId
"title": string,
"options": [
{
"text": string,
"id": int // optionId
}
],
"state": PollState
}
],
"votes": {
[pollId]: [optionId]
}
},
...
}
```