|
| 1 | +## Start self-serving community poll on IoTeX blockchain |
| 2 | + |
| 3 | +We have deployed a registration contract [io17nq7vnm3wcs5a2cmhwhcnhwtwv4s6lxuv7qqj5](https://iotexscan.io/address/io17nq7vnm3wcs5a2cmhwhcnhwtwv4s6lxuv7qqj5) that allows you to quickly start a community poll. |
| 4 | + |
| 5 | +Follow the steps in this guide to create your poll. |
| 6 | + |
| 7 | +## Drafe the poll and publish in IoTeX forum |
| 8 | + |
| 9 | +1. Draft the poll with your favorite text editor. |
| 10 | + |
| 11 | +2. Post a forum thread under “Ecosystem” and tag it with “delegates” and “governance”, entitled it with “[Community Poll] a great enhancement - Proposal #X”. See this [example](https://community.iotex.io/t/community-poll-self-staking-bonus-and-extend-unstaking-period-proposal-5/724) |
| 12 | + |
| 13 | +3. Paste the content to https://emn178.github.io/online-tools/keccak_256.html and generate a keccak-256 hash. **This hash would be the unique ID for the poll's content**. Post the content hash back to the forum thread. |
| 14 | + |
| 15 | +## Register the poll on IoTeX blockchain |
| 16 | + |
| 17 | +1. Go to https://abi.hashex.org/ paste the poll registration contract ABI from https://github.com/iotexproject/iotex-bootstrap/blob/master/poll/poll.abi, click Parse |
| 18 | + |
| 19 | +2. Select function register() from the “Function type” drop-down, and fill in the parameter. |
| 20 | + |
| 21 | +3. bytecode will be generated in the text box at the bottom, click Copy |
| 22 | + |
| 23 | +4. Register the poll, by running the following command: (paste the bytecode after -b) |
| 24 | + |
| 25 | +`ioctl action invoke io17nq7vnm3wcs5a2cmhwhcnhwtwv4s6lxuv7qqj5 -s {YOUR_ADDRESS} -l 3000000 --endpoint api.iotex.one:443 -b bytecode` |
| 26 | + |
| 27 | +you will see output like below: |
| 28 | +``` |
| 29 | +Action has been sent to blockchain. |
| 30 | +Wait for several seconds and query this action by hash:284b40c21ef3cd9a3f2fd833800a8e806650ebda98a94dc31f51bb6997202d15 |
| 31 | +``` |
| 32 | + |
| 33 | +## Update the poll hash in IoTeX forum |
| 34 | + |
| 35 | +1. Post the tx hash returned above to the forum thread. **This tx hash would be the unique ID for the poll's registration on the blockchain**. |
| 36 | + |
| 37 | +2. Fill out the following JSON blob and post it to the same forum thread and @tian who will populate frontend using this blob. Replace **TODO** with the actual content/option of your poll. |
| 38 | + |
| 39 | +`{ |
| 40 | + "status": 1, |
| 41 | + "contractAddress": "TODO: YOUR CONTRACT ADDRESS", |
| 42 | + "title": "TODO: your proposal's title", |
| 43 | + "description": "TODO: your proposal's content in plain text or HTML", |
| 44 | + "start": "TODO: start date with timezone", |
| 45 | + "end": "TODO: end date with timezone", |
| 46 | + "proposer": "TODO: your name", |
| 47 | + "category": "General", |
| 48 | + "maxNumOfChoices": 2, // TODO: max number of choices |
| 49 | + "options": [{"id": "1", "description": "TODO"}, {"id": "2", "description": "TODO"}], |
| 50 | + "id": 5, //TODO: your proposal ID |
| 51 | + }` |
| 52 | + |
| 53 | + ## Publish the poll in IoTeX member portal |
| 54 | + |
| 55 | + Give it 24 hour, the poll will show up on https://member.iotex.io/polls, hooray! |
0 commit comments