QOSGroup / qmoon

the moon of QOS
Apache License 2.0
4 stars 8 forks source link

new table and component for proposals #144

Closed ewagmig closed 5 years ago

ewagmig commented 5 years ago

A new table should be added for proposal storage, and it should follow current architecture of the Qmoon as an extension to API exposed for external call.

ewagmig commented 5 years ago

data struct design for the table proposal is ongoing...

ewagmig commented 5 years ago

Take the following printout for example:

[vagrant@vagrant-192-168-1-190 ~]$ ./qoscli query proposals --node "tcp://192.168.1.221:26657"
[{"proposal_content":{"type":"gov/TextProposal","value":{"title":"myproposal","description":"the 1st proposal","deposit":"33500000"}},"proposal_id":"1","proposal_status":"Rejected","final_tally_result":{"yes":"0","abstain":"0","no":"0","no_with_veto":"0"},"submit_time":"2019-09-05T02:34:57.645497682Z","deposit_end_time":"2019-09-07T02:34:57.645497682Z","total_deposit":"33500000","voting_start_time":"2019-09-05T02:34:57.645497682Z","voting_start_height":"15658","voting_end_time":"2019-09-07T02:34:57.645497682Z"},{"proposal_content":{"type":"gov/TextProposal","value":{"title":"myproposal2","description":"the second proposal","deposit":"4"}},"proposal_id":"2","proposal_status":"Rejected","final_tally_result":{"yes":"100000000","abstain":"0","no":"0","no_with_veto":"0"},"submit_time":"2019-09-05T02:39:13.615666376Z","deposit_end_time":"2019-09-07T02:39:13.615666376Z","total_deposit":"12","voting_start_time":"2019-09-05T02:41:09.062980111Z","voting_start_height":"15732","voting_end_time":"2019-09-07T02:41:09.062980111Z"}]
ewagmig commented 5 years ago

However, for the other tally information inquiry, a new ABCI query should also be sent to Tendermint for the exact poll information:

[vagrant@vagrant-192-168-1-190 ~]$ ./qoscli query tally 2 --node "tcp://192.168.1.221:26657"
{"yes":"100000000","abstain":"0","no":"0","no_with_veto":"0"}
ewagmig commented 5 years ago

Something about votes:

./qoscli query votes 2 --node "tcp://192.168.1.221:26657"
[{"voter":"address1f66wr25emjtp5urfcpd02epwg5ply3xzcv2u20","proposal_id":"2","option":"Yes"},{"voter":"address1swsxrkgz73lqpsp562kz3k3c7tzmmgtyg74vd2","proposal_id":"2","option":"Yes"}]
ewagmig commented 5 years ago

new table added in latest commit 4a9ae6e

ewagmig commented 5 years ago

add the deposits query infos

[vagrant@vagrant-192-168-1-223 qos]$ ./qoscli query deposits 5 --node "tcp://192.168.1.221:26657"
[{"depositor":"address1tl0gdpdwjz2g77s7qcf0jvr4sxc0szw0nlk08t","proposal_id":"5","amount":"50"}]
ewagmig commented 5 years ago

proposals is ready:http://47.252.11.248:9527/nodes/aquarius-2001/proposals

ewagmig commented 5 years ago

@yangchuang64 for more progress

ewagmig commented 5 years ago

163 fix this part as @yangchuang64 support