-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add oep-64 #64
Open
lucas7788
wants to merge
11
commits into
ontio:master
Choose a base branch
from
lucas7788:upmaster
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add oep-64 #64
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
86006d0
add oep-11
lucas7788 c67390c
update voter
lucas7788 1d60677
update
lucas7788 d81585e
update
lucas7788 e41eb85
update
lucas7788 36ba6ef
update
lucas7788 c7eb710
update
lucas7788 997b0d2
update
lucas7788 bc4d0b3
update
lucas7788 d69c6a8
update
lucas7788 de12344
add oep
lucas7788 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
<pre> | ||
OEP: 64 | ||
Title: Governance Change Standard | ||
Author: | ||
Type: Standard | ||
Status: Accepted | ||
Created: 2018-07-03 | ||
</pre> | ||
|
||
==Abstract== | ||
|
||
The OEP-64 proposal is a standard interface for the '''Governance Change Standard'''. | ||
All consensus nodes and candidate nodes can participate in the governance of ontology by creating and voting on topics. | ||
The admin node will be used instead of all consensus nodes and candidate nodes. | ||
`Topic` is used to represent a major update of ontology, including the initiator address, topic title, topic detail, start voting time and end voting time. | ||
The admin node can create a topic. All the admin nodes can approve or reject the topic. Non admin nodes cannot create or participate in the topic voting. | ||
The voting weight of the admin node is expressed by the number of ont pledged by the node. | ||
`Topic` needs to be approved by most nodes before it is updated to the Ontology main network. During the voting process, the number of votes for and against will be counted. | ||
The number of votes in favor is greater than the number of votes in opposition and the number of votes in favor is more than 50%, | ||
the update of the Topic representative will be updated to the Ontology main network. | ||
|
||
|
||
==Motivation== | ||
|
||
'''Governance Change Standard''' interace allows the community to update the governace strategy of Ontology blockchain in order to adapt to new developments. | ||
|
||
==Specification== | ||
|
||
===Methods=== | ||
|
||
====listAdmins==== | ||
|
||
<pre> | ||
def listAdmins() | ||
</pre> | ||
|
||
Returns the address array that contains all the admins. | ||
|
||
====createTopic==== | ||
|
||
<pre> | ||
def createTopic(admin, topic, startTime, endTime) | ||
</pre> | ||
|
||
An admin can invoke this method to create a new topic. | ||
The parameters are of the following type: | ||
|
||
{| class = "wikitable" | ||
! style = "text-align:center;"| Parameter | ||
! Type | ||
|- | ||
| admin | ||
| 20 byte address | ||
|- | ||
| topic | ||
| string | ||
|- | ||
| startTime | ||
| UNIX timestamp | ||
|- | ||
| endTime | ||
| UNIX timestamp | ||
|} | ||
|
||
====listTopics==== | ||
|
||
<pre> | ||
def listTopics() | ||
</pre> | ||
|
||
Returns all the topic hashes. | ||
|
||
====getTopic==== | ||
|
||
<pre> | ||
def getTopic(hash) | ||
</pre> | ||
|
||
Returns the corresponding [topicTitle,topicDetail], for example, ['Update the Governance Strategy, mortgage unlocking cycle changed from 2 months to 1 month','Update the Governance Strategy, mortgage unlocking cycle changed from 2 months to 1 month']. | ||
The parameter <code>hash</code> should be a 32-byte hash that corresponds to a topic. | ||
|
||
====cancelTopic==== | ||
|
||
<pre> | ||
def cancelTopic(hash) | ||
</pre> | ||
only the Topic creator has the right to invoke this method. | ||
|
||
The parameter <code>hash</code> should be the 32-byte hash of the topic name. | ||
|
||
|
||
====getTopicInfo==== | ||
|
||
<pre> | ||
def getTopicInfo(hash) | ||
</pre> | ||
|
||
Returns the <code>topicInfo</code> which includes 'admin, topicTitle, topicDetail, voter address, startTime, endTime, approve amount, reject amount, status, topicHash'. | ||
|
||
The parameter <code>hash</code> should be the 32-byte hash of the topic name. | ||
|
||
Response description: | ||
|
||
* <code>admin</code>: Creator of the topic | ||
* <code>topic_title</code>: Topic title | ||
* <code>topic_detail</code>: Topic details | ||
* <code>startTime</code>: Start time for voting on the topic | ||
* <code>endTime</code>:End time for voting on the topic | ||
* <code>approve amount</code>: Total number of voters that approve the topic, sum of the weights of approving voters | ||
* <code>reject amount</code>: Total number of voters that reject the topic, sum of the weights of rejecting voters | ||
* <code>status</code>: Status of the topic, <code>0</code> represents <code>cancelled</code>, <code>1</code> represents <code>normal</code> | ||
* <code>topicHash</code>: Topic hash | ||
|
||
====voteTopic==== | ||
|
||
<pre> | ||
def voteTopic(hash, voter, approveOrReject) | ||
</pre> | ||
|
||
Voters can invoke this method to approve or reject a topic. | ||
|
||
The parameter <code>hash</code> is the topic hash. | ||
The parameter <code>voter</code> is one of the voters set by an admin. | ||
The parameter <code>approveOrReject</code> is a boolean value, true implies approve, false implies reject. | ||
|
||
|
||
====getVotedInfo==== | ||
|
||
<pre> | ||
def getVotedInfo(hash, voter) | ||
</pre> | ||
|
||
Voters can invoke this method to query own voted Info, approve or reject. | ||
|
||
The parameter <code>hash</code> is the topic hash. | ||
The parameter <code>voter</code> is one of the voters set by an admin. | ||
|
||
Return value is 1 or 2, 1 means approve, 2 means reject, other means not voted | ||
|
||
====getVotedAddress==== | ||
|
||
<pre> | ||
def getVotedAddress(hash) | ||
</pre> | ||
|
||
Users can invoke this method to query all voted address and vote result of a topic. | ||
The parameter <code>hash</code> is the topic hash. | ||
|
||
Return value is array of all the address and vote result. | ||
|
||
====getTopicInfoListByAdmin==== | ||
|
||
<pre> | ||
def getTopicInfoListByAdmin(admin) | ||
</pre> | ||
|
||
Users can invoke this method to query all topicInfo of a admin. | ||
The parameter <code>admin</code> is the topic creator. | ||
|
||
Return value is array of topicInfo. | ||
|
||
|
||
===Events=== | ||
|
||
====createTopic==== | ||
|
||
<pre> | ||
CreateTopicEvent = RegisterAction("createTopic", "hash", "topic") | ||
</pre> | ||
|
||
The event must be triggered when topic are created. | ||
|
||
====VoteTopicEvent==== | ||
|
||
<pre> | ||
VoteTopicEvent = RegisterAction("voteTopic", "hash", "voter") | ||
</pre> | ||
|
||
The event must be triggered on any successful calls to <code>voteTopic</code>. | ||
|
||
===Implementation=== |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to
listGovNodes
?