There is a list of commands to interact with polls:
- POLL CREATE - creates poll transaction
- POLL VOTE - creates vote (in poll) transaction
- POLL LIST - lists actual polls in the net
- POLL DUMP - gets information about definite poll
Node Command - POLL CREATE
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
Link to original
Node Command - POLL CREATE
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
Link to originalJSON-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 LISTquestion
- subject of the pollstring in quotes, limit - 200 characters
options
- answer optionsstrings in quotes listed through commas, limit of a one answer - 100 characters, number of options - not more than 10
expire
- poll end timeoptional, time format is RCF822, use time of your system
max_votes_count
- maximum number of votes being acceptedoptional
delegated_key_required
- allows to vote only for users who has delegated keyoptional
vote_changing_allowed
- allows to change previously sent answer in the polloptional
token
- a name of the token which will be used to participate in the polloptional
fee
- validator’s commission, because poll is a transaction toow
- name of the wallet from which commission will be paidCurl 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:
Link to original { "type": 0, "result": "Datum 0x88DC38903DA6E616C91510BF51E4D57F0DC599F1CAA47B0BA20D82D8EB747D02 successfully added to mempool", "errors": null, "id": 1 }
Node Command - POLL VOTE
Creates vote transaction.
Command syntax:
poll vote
-net <net_name>
-hash <poll_hash>
-option_idx <option_index>
[-cert <delegate_cert_name>]
-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
-hash - hash of the poll transaction
-option_idx - index of answer option (count starts with 0)
-cert - certificate for signing poll transaction (optional, if not specified - transaction will be signed by wallet)
-fee - validator's commission
-w - name of the wallet from which commission will be paid and vote weight will be calculated
CLI Example
Command:
cellframe-node-cli poll vote -net foobar -hash 0xD4E174C886B0C90597E5E691E231D94F84591C5431D502F7470A37436B839FB5 -option_idx 1 -fee 0.05e+18 -w foobar_root_1
Response:
Datum 0x0B03A720E857D3289E7F4748B3CAB543B14B5AB54AF5FF55712BAD621449D97D successfully added to mempool
JSON-RPC Example
JSON-RPC Request - POLL VOTE
Creates vote transaction.
Request Structure
JSON object:
{
"method": "poll",
"subcommand": ["vote"],
"arguments": {
"net": "network_name",
"hash": "poll_hash",
"option_idx": "option_index",
"cert": "delegate_cert_name",
"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
hash
- hash of the poll transaction
option_idx
- index of answer option count starts with 0
cert
- certificate for signing poll transaction if needed optional, if not specified - transaction will be signed by wallet
fee
- validator’s commission
w
- name of the wallet from which commission will be paid and vote weight will be calculated
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{
"method": "poll",
"subcommand": ["vote"],
"arguments": {
"net": "foobar",
"option_idx": "0",
"fee": "0.05e+18",
"w": "foobar_master_0"
},
"id": "1"
}'
Response:
{
"type": 0,
"result": "Datum 0xA835DEEB0AAC90F161366E092C91CF8A03D24D1825D88D0690418C98950AC742 successfully added to mempool",
"errors": null,
"id": 1
}
Link to original
Link to original
Node Command - POLL VOTE
Creates vote transaction.
Command syntax:
poll vote
-net <net_name>
-hash <poll_hash>
-option_idx <option_index>
[-cert <delegate_cert_name>]
-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
-hash - hash of the poll transaction
-option_idx - index of answer option (count starts with 0)
-cert - certificate for signing poll transaction (optional, if not specified - transaction will be signed by wallet)
-fee - validator's commission
-w - name of the wallet from which commission will be paid and vote weight will be calculated
CLI Example
Command:
cellframe-node-cli poll vote -net foobar -hash 0xD4E174C886B0C90597E5E691E231D94F84591C5431D502F7470A37436B839FB5 -option_idx 1 -fee 0.05e+18 -w foobar_root_1
Response:
Datum 0x0B03A720E857D3289E7F4748B3CAB543B14B5AB54AF5FF55712BAD621449D97D successfully added to mempool
JSON-RPC Example
Link to originalJSON-RPC Request - POLL VOTE
Creates vote transaction.
Request Structure
JSON object:
{ "method": "poll", "subcommand": ["vote"], "arguments": { "net": "network_name", "hash": "poll_hash", "option_idx": "option_index", "cert": "delegate_cert_name", "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 LISThash
- hash of the poll transactionoption_idx
- index of answer optioncount starts with 0
cert
- certificate for signing poll transaction if neededoptional, if not specified - transaction will be signed by wallet
fee
- validator’s commissionw
- name of the wallet from which commission will be paid and vote weight will be calculatedCurl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{ "method": "poll", "subcommand": ["vote"], "arguments": { "net": "foobar", "option_idx": "0", "fee": "0.05e+18", "w": "foobar_master_0" }, "id": "1" }'
Response:
Link to original { "type": 0, "result": "Datum 0xA835DEEB0AAC90F161366E092C91CF8A03D24D1825D88D0690418C98950AC742 successfully added to mempool", "errors": null, "id": 1 }
Node Command - POLL LIST
Lists actual polls in the net.
Command syntax:
poll list
-net <net_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
CLI Example
Command:
cellframe-node-cli poll list -net riemann
Response:
#most of the results were missed to make this response readable
poll_tx: 0xD6AE0A94E7F1E162A3335ECED90758E76B2DBBA60D03B50C3CACC639E0269FDB
question: To be or not to be?
token: tKEL
poll_tx: 0x573C3A0ADCE1E337C48FE62D1A443DE7D134B97D0611B41280ED43E3FCBF0158
question: yes or no?
token: tKEL
poll_tx: 0xAC28B6AFD13ABAD8B125A2B9B7CE9D2349F88DDEF52A075394211D8485878A4B
question: 2: yes or no
token: tKEL
JSON-RPC Example
JSON-RPC Request - POLL LIST
Lists actual polls in the network.
Request Structure
JSON object:
{
"method": "poll",
"subcommand": ["list"],
"arguments": {
"net": "network_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
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{
"method": "poll",
"subcommand": ["list"],
"arguments": {
"net": "riemann",
},
"id": "1"
}'
Response:
{
"type": 2,
"result": #most of the results were missed to make this response readable
[
[
{
"poll_tx": "0xD6AE0A94E7F1E162A3335ECED90758E76B2DBBA60D03B50C3CACC639E0269FDB",
"question": "To be or not to be?",
"token": "tKEL"
},
{
"poll_tx": "0x28F128F092C115A58F355ED4CA2B2CCBC5F2D40AF92CA8421E62EC6A64D80555",
"question": "\"Potato",
"token": "tKEL"
},
{
"poll_tx": "0xA7628CBAAFBEBB0BE2783F6A2DBC2E4CA4F3B7E6458E68E586AE36659961C7EE",
"question": "question0904",
"token": "tKEL"
},
{
"poll_tx": "0x280FAEE576A53B95D5B6043B1A4772D52B19F4CE1F41F73A8A58F2E1167038C0",
"question": "question1004",
"token": "tKEL"
},
{
"poll_tx": "0x5187AD6ED85655E9A96003C1258BD4DADA1EA4C5F9DFB5378079C6E9C043AD51",
"question": "\"Potato",
"token": "tKEL"
}
]
],
"id": 1
}
Link to original
Link to original
Node Command - POLL LIST
Lists actual polls in the net.
Command syntax:
poll list
-net <net_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
CLI Example
Command:
cellframe-node-cli poll list -net riemann
Response:
#most of the results were missed to make this response readable
poll_tx: 0xD6AE0A94E7F1E162A3335ECED90758E76B2DBBA60D03B50C3CACC639E0269FDB
question: To be or not to be?
token: tKEL
poll_tx: 0x573C3A0ADCE1E337C48FE62D1A443DE7D134B97D0611B41280ED43E3FCBF0158
question: yes or no?
token: tKEL
poll_tx: 0xAC28B6AFD13ABAD8B125A2B9B7CE9D2349F88DDEF52A075394211D8485878A4B
question: 2: yes or no
token: tKEL
JSON-RPC Example
Link to originalJSON-RPC Request - POLL LIST
Lists actual polls in the network.
Request Structure
JSON object:
{ "method": "poll", "subcommand": ["list"], "arguments": { "net": "network_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 LISTCurl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{ "method": "poll", "subcommand": ["list"], "arguments": { "net": "riemann", }, "id": "1" }'
Response:
Link to original { "type": 2, "result": #most of the results were missed to make this response readable [ [ { "poll_tx": "0xD6AE0A94E7F1E162A3335ECED90758E76B2DBBA60D03B50C3CACC639E0269FDB", "question": "To be or not to be?", "token": "tKEL" }, { "poll_tx": "0x28F128F092C115A58F355ED4CA2B2CCBC5F2D40AF92CA8421E62EC6A64D80555", "question": "\"Potato", "token": "tKEL" }, { "poll_tx": "0xA7628CBAAFBEBB0BE2783F6A2DBC2E4CA4F3B7E6458E68E586AE36659961C7EE", "question": "question0904", "token": "tKEL" }, { "poll_tx": "0x280FAEE576A53B95D5B6043B1A4772D52B19F4CE1F41F73A8A58F2E1167038C0", "question": "question1004", "token": "tKEL" }, { "poll_tx": "0x5187AD6ED85655E9A96003C1258BD4DADA1EA4C5F9DFB5378079C6E9C043AD51", "question": "\"Potato", "token": "tKEL" } ] ], "id": 1 }
Node Command - POLL DUMP
Gets information about definite poll.
Command syntax:
poll dump
-net <net_name>
-hash <poll_hash>
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
-hash - hash of the poll
CLI Example
Command:
cellframe-node-cli poll dump -net riemann -hash 0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C
Response:
poll_tx: 0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C
question: Question_string
token: tKEL
can_change_status: false
delegated_key_required: false
results:
option_id: 0
option_text: Option0
votes_count: 0
votes_percent: 0
votes_sum: 0.0
votes_sum_datoshi: 0
votes_sum_weight: 0.0
option_id: 1
option_text: Option1
votes_count: 0
votes_percent: 0
votes_sum: 0.0
votes_sum_datoshi: 0
votes_sum_weight: 0.0
option_id: 2
option_text: OptionN
votes_count: 0
votes_percent: 0
votes_sum: 0.0
votes_sum_datoshi: 0
votes_sum_weight: 0.0
votes_count: 0
total_sum: 0.0
total_sum_datoshi: 0
JSON-RPC Example
JSON-RPC Request - POLL DUMP
Gets information about definite poll
Request Structure
JSON object:
{
"method": "poll",
"subcommand": ["dump"],
"arguments": {
"net": "network_name",
"hash": "poll_hash"
},
"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
hash
- hash of the poll tx
Curl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{
"method": "poll",
"subcommand": ["dump"],
"arguments": {
"net": "riemann",
"hash": "0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C"
},
"id": "1"
}'
Response:
{
"type": 2,
"result": [
{
"poll_tx": "0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C",
"question": "Question_string",
"token": "tKEL",
"can_change_status": false,
"delegated_key_required": false,
"results": [
{
"option_id": 0,
"option_text": "Option0",
"votes_count": 0,
"votes_percent": 0,
"votes_sum": "0.0",
"votes_sum_datoshi": "0",
"votes_sum_weight": "0.0"
},
{
"option_id": 1,
"option_text": "Option1",
"votes_count": 0,
"votes_percent": 0,
"votes_sum": "0.0",
"votes_sum_datoshi": "0",
"votes_sum_weight": "0.0"
},
{
"option_id": 2,
"option_text": "OptionN",
"votes_count": 0,
"votes_percent": 0,
"votes_sum": "0.0",
"votes_sum_datoshi": "0",
"votes_sum_weight": "0.0"
}
],
"votes_count": 0,
"total_sum": "0.0",
"total_sum_datoshi": "0"
}
],
"id": 1
}
Link to original
Link to original
Node Command - POLL DUMP
Gets information about definite poll.
Command syntax:
poll dump
-net <net_name>
-hash <poll_hash>
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
-hash - hash of the poll
CLI Example
Command:
cellframe-node-cli poll dump -net riemann -hash 0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C
Response:
poll_tx: 0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C
question: Question_string
token: tKEL
can_change_status: false
delegated_key_required: false
results:
option_id: 0
option_text: Option0
votes_count: 0
votes_percent: 0
votes_sum: 0.0
votes_sum_datoshi: 0
votes_sum_weight: 0.0
option_id: 1
option_text: Option1
votes_count: 0
votes_percent: 0
votes_sum: 0.0
votes_sum_datoshi: 0
votes_sum_weight: 0.0
option_id: 2
option_text: OptionN
votes_count: 0
votes_percent: 0
votes_sum: 0.0
votes_sum_datoshi: 0
votes_sum_weight: 0.0
votes_count: 0
total_sum: 0.0
total_sum_datoshi: 0
JSON-RPC Example
Link to originalJSON-RPC Request - POLL DUMP
Gets information about definite poll
Request Structure
JSON object:
{ "method": "poll", "subcommand": ["dump"], "arguments": { "net": "network_name", "hash": "poll_hash" }, "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 LISThash
- hash of the poll txCurl Example
Request:
curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{ "method": "poll", "subcommand": ["dump"], "arguments": { "net": "riemann", "hash": "0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C" }, "id": "1" }'
Response:
Link to original { "type": 2, "result": [ { "poll_tx": "0x687A7CDBC0E0108DED5E6BA1DE457E1ACB7FEC39A030D869411053F96199E23C", "question": "Question_string", "token": "tKEL", "can_change_status": false, "delegated_key_required": false, "results": [ { "option_id": 0, "option_text": "Option0", "votes_count": 0, "votes_percent": 0, "votes_sum": "0.0", "votes_sum_datoshi": "0", "votes_sum_weight": "0.0" }, { "option_id": 1, "option_text": "Option1", "votes_count": 0, "votes_percent": 0, "votes_sum": "0.0", "votes_sum_datoshi": "0", "votes_sum_weight": "0.0" }, { "option_id": 2, "option_text": "OptionN", "votes_count": 0, "votes_percent": 0, "votes_sum": "0.0", "votes_sum_datoshi": "0", "votes_sum_weight": "0.0" } ], "votes_count": 0, "total_sum": "0.0", "total_sum_datoshi": "0" } ], "id": 1 }