Creates poll transaction.

Command syntax:

poll create 
-net <net_name> 
-question <"Question_string"> 
-options <"Option1","Option2",..."OptionN"> 
[-expire <poll_expire_time_in_RCF822>] 
[-max_votes_count <Votes_count>] 
[-delegated_key_required] 
[-vote_changing_allowed] 
[-token <ticker>]
-fee <value_datoshi> 
-w <fee_wallet_name>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-question - subject of the poll (string in quotes, limit - 200 characters) 
-options - answer options (strings in quotes listed through commas, limit of a one answer - 100 characters, number of options - not more than 10)
-expire - poll end time (optional, time format is RCF822, use time of your system)
-max_votes_count - maximum number of votes being accepted (optional)
-delegated_key_required - allows to vote only for users who has delegated key (optional)
-vote_changing_allowed - allows to change previously sent answer in poll (optional)
-token - a name of the token which will be used to participate in poll (optional)
-fee - validator's commission, because poll is a transaction too
-w - name of the wallet from which commission will be paid

CLI Example

Command:

cellframe-node-cli poll create -net foobar -question "wen moon?" -options "soon","tomorrow","never" -fee 0.05e+18 -w foobar_root_0

Response:

Datum 0xD4E174C886B0C90597E5E691E231D94F84591C5431D502F7470A37436B839FB5 successfully added to mempool

JSON-RPC Example

JSON-RPC Request - POLL CREATE

Creates poll transaction.

Request Structure

JSON object:

{
  "method": "poll",
  "subcommand": ["create"],
  "arguments": {
    "net": "network_name",
    "question": "Question_string",
    "options": "Option1,Option2,...OptionN",
    "expire": "poll_expire_time_in_RCF822",
    "max_votes_count": "Votes_count",
    "delegated_key_required": "null",
    "vote_changing_allowed": "null",
    "token": "ticker",
    "fee": "value_datoshi",
    "w": "fee_wallet_name"
  },
  "id": "1"
}

Parameters: net (network_name) - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received using - Node Command - NET LIST question - subject of the poll string in quotes, limit - 200 characters options - answer options strings in quotes listed through commas, limit of a one answer - 100 characters, number of options - not more than 10 expire - poll end time optional, time format is RCF822, use time of your system max_votes_count - maximum number of votes being accepted optional delegated_key_required - allows to vote only for users who has delegated key optional vote_changing_allowed - allows to change previously sent answer in the poll optional token - a name of the token which will be used to participate in the poll optional fee - validator’s commission, because poll is a transaction too w - name of the wallet from which commission will be paid

Curl Example

Request:

curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{
  "method": "poll",
  "subcommand": ["create"],
  "arguments": {
    "net": "foobar",
    "question": "mypersonalvoting",
    "options": "yes,no,maybe",
    "fee": "0.05e+18",
    "w": "foobar_master_0"
  },
  "id": "1"
}'

Response:

{
  "type": 0,
  "result": "Datum 0x88DC38903DA6E616C91510BF51E4D57F0DC599F1CAA47B0BA20D82D8EB747D02 successfully added to mempool",
  "errors": null,
  "id": 1
}
Link to original