From 0f4de994cdbd98206998ec531c2e0fa21452c724 Mon Sep 17 00:00:00 2001 From: ZeXiang Date: Thu, 27 Jun 2024 10:12:00 +0800 Subject: [PATCH] docs: modify README --- power-oracle-node/README.md | 13 +++++++++++ powervoting-backend/README.md | 42 +++++++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/power-oracle-node/README.md b/power-oracle-node/README.md index cb31f2f..8588427 100644 --- a/power-oracle-node/README.md +++ b/power-oracle-node/README.md @@ -26,6 +26,19 @@ For deployment instructions, please refer to this document: [Deployment Guide](I Once the Oracle node is up and running, it continuously fetches data from specified sources, verifies the data, and transmits it to the blockchain. Smart contracts can then access this data and execute based on predefined conditions. +1. **Configure `configuration.yaml`**: + + Edit the `configuration.yaml` file according to your environment settings. + + ![Edit Configuration](img/1.png) + +2. **Run Tests**: + + ``` + cd /on-chain-voting/power-oracle-node/backend + go test ./... + ``` + ## Author The Oracle Node is developed by StorSwift Inc. diff --git a/powervoting-backend/README.md b/powervoting-backend/README.md index 7c653f7..90891ff 100644 --- a/powervoting-backend/README.md +++ b/powervoting-backend/README.md @@ -1,18 +1,37 @@ # StorSwift Power Voting -## 1. Overview +## Overview Power Voting dApp utilizes timelock based on smart contract technology to achieve fair and private voting. Before the voting deadline, no one’s voting results will be seen by others, and the voting process will not be disturbed by other participant’s voting results. After the voting deadline, anyone can count the votes in a decentralized manner, and the results of the counting will executed and stored by smart contract and will not be manipulated by any centralized organization or individual. Power Voting dApp aims to become the infrastructure of DAO governance. -## 2. Problem +## Deployment + +For deployment instructions, please refer to the [Deployment Guide](Install.md). + +## Usage + +1. **Configure `configuration.yaml`**: + + Edit the `configuration.yaml` file according to your environment settings. + + ![Edit Configuration](img/1.png) + +2. **Run Tests**: + + ``` + cd /on-chain-voting/powervoting-backend + go test ./... + ``` + +## Problem In the community voting process governed by DAO, since the voting data of other community members can be seen before the vote counting time, the community members will be affected by the existing voting data before voting, and some members will even take advantage of a large number of voting rights in their hands to vote at the end of the voting process to make the voting results are reversed, resulting in unfair voting. In the centralized voting process, since the vote counting power is in the hands of the centralized organization, it will cause problems such as vote fraud and black box operation of vote counting, resulting in the voting results being manipulated by others, which cannot truly reflect the wishes of the community. -## 3. Solution +## Solution Power Voting dApp stores voting information on the blockchain, and all voting operations are executed on the chain, which is open and transparent. @@ -20,24 +39,29 @@ When community members vote, they use the timelock technology to lock the voting After the counting time arrives, any voting participant can initiate a vote count without being affected by any centralized organization. -## 4. Timelock +## Timelock When creating a proposal, the creator will enter a voting expiration time, and Power Voting dApp will store the proposal content and voting expiration time together on the blockchain. When user votes on a proposal, Power Voting dApp will call Drand Timelock API to encrypt user's voting data and store the encrypt data into contract, the encrypt data won't be decrypt until the proposal expiration time. When proposal expiration time reached, Power Voting dApp will call Drand Timelock API to decrypt user's voting data to count the proposal. Power Voting dApp will lock all users' voting content and not allow anyone to query voting content until voting expiration time, to make sure no one can know the voting information of other members before voting expiration time reaches. -## 5. Voting Power Snapshot +## Voting Power Snapshot -Power Oracle will request raw data from FileCoin, GitHub and other data sources to calculate role identity and voting power and save them into Power Oracle contracts. SP and Client respectively invoke the `PowerAPI.minerRawPower(filActorld)` and `DataCapAPI.balance(filActorld)` interfaces to retrieve power. Power Oracle contracts will store 60 days history of voting power. When users vote, only the percentage is recorded, not the actual voting power. During the vote counting process, a random weight will be selected from the 60 days history and multiplied by the percentage to calculate the vote. +Power Snapshot requests raw data from data sources such as FileCoin and GitHub, calculates role identities and voting weights, and saves them to the Power Snapshot service. SP and Client call the RPCs of `Filecoin.StateMinerPower` and `Filecoin.StateMarketBalance` to obtain weights respectively. The Power Snapshot service saves 60 days of voting weight history. When users vote, only the percentage is recorded, not the actual voting weight. During the counting process, a weight is randomly selected from the 60-day historical record and multiplied by the percentage to calculate the number of votes. -## 6. Power Voting Flowchart +## Power Voting Flowchart ![](img/flowchart.png) -## 7. Power Voting Sequence Chart +## Power Voting Sequence Chart ![](img/timing_diagram.png) -## 8. UCAN Design +## UCAN Design ![](img/ucan1.png) + ![](img/ucan2.png) +## Author + +The PowerVoting Backend is developed by StorSwift Inc. +