Answering SPO On-Chain Polls
This describes the process an SPO can take to participate in polls that are posted on-chain. Updated 5/25/2023 - to add note about paying transaction with multi-signature addresses.
Last updated
This describes the process an SPO can take to participate in polls that are posted on-chain. Updated 5/25/2023 - to add note about paying transaction with multi-signature addresses.
Last updated
In order to participate in Polls with these steps you need 8.0.0 CLI version. You only need the 8.0.0 CLI and not 8.0.0 node. Also, you only need 8.0.0 CLI on one relay and on your air gapped machine in order to use this method.
If you haven't upgraded to 8.0.0, you can see our guide here.
First we will need a signer-hash. So we will first go to our air gapped machine and create a hash file that we can move to our live environment.
⚠️ON AIR GAPPED MACHINE - this is where your node.vkey is stored.
Unlock cold keys folder by running the following:
chmod u+rwx $HOME/cold-keys
Run the following command on air gap machine to create signer-hash file.
cardano-cli stake-pool id \
--cold-verification-key-file $HOME/cold-keys/node.vkey \
--output-format hex > $HOME/cold-keys/pool.hex.id
You can view signer-hash to make sure it was successful by running:
cat $HOME/cold-keys/pool.hex.id
If successful copy file so you can move to live relay, now you can relock your keys by running:
chmod a-rwx $HOME/cold-keys
For this guide we will put files in our $NODE_HOME folder. Please move pool.hex.id to $NODE_HOME folder on a hot/live relay node.
First we need to get the poll.json file. This should be shared by Poll creator. Run this to download poll.json file for the parameter poll:
cd $NODE_HOME
wget https://raw.githubusercontent.com/cardano-foundation/CIP-0094-polls/main/networks/mainnet/fae7bda85acb99c513aeab5f86986047b6f6cbd33a8e11f11c5005513a054dc8/poll.json
To answer the poll using interactive method run the following on your live relay node. Please note this is the step where 8.0.0 CLI is required.
cd $NODE_HOME
cardano-cli governance answer-poll \
--poll-file poll.json > poll-answer.json
still on live relay node let's find UTXO with NO NFTs
cardano-cli query utxo \
--address $(cat payment.addr) \
--mainnet
Replace <SAMPLE UTXO>#0 including <> with a UTXO that you selected that didn't have an NFT. If you don't have a payment.addr file then replace that with your receive address.
Still on live relay node, build the transaction using the poll-answer.json and pool.hex.id by running:
cd $NODE_HOME
cardano-cli transaction build \
--babbage-era \
--mainnet \
--tx-in <SAMPLE UTXO>#0 \
--change-address $(cat payment.addr) \
--metadata-json-file poll-answer.json \
--json-metadata-detailed-schema \
--required-signer-hash $(cat pool.hex.id) \
--out-file answer.tx
You should be able to run the following to see your transaction details.
cardano-cli transaction view \
--tx-file answer.tx
Once again, we put our answer.tx file into our $NODE_HOME folder
⚠️ ON AIR GAPPED
Unlock cold keys folder by running the following:
chmod u+rwx $HOME/cold-keys
Now we will sign transaction with our node.skey and our payment.skey
cd $NODE_HOME
cardano-cli transaction sign \
--tx-body-file answer.tx \
--signing-key-file $HOME/cold-keys/node.skey \
--signing-key-file payment.skey \
--mainnet \
--out-file answer.tx.signed
If successful copy file so you can move to live relay, now you can relock your keys by running:
chmod a-rwx $HOME/cold-keys
We copy our answer.tx.signed file into our $NODE_HOME folder on our live relay and then run the following to submit it to chain:
cd $NODE_HOME
cardano-cli transaction submit \
--mainnet \
--tx-file answer.tx.signed
Now wait a few minutes for your transaction to get on-chain, then go to one of these tools to see your vote: https://adastat.net/polls https://cardanoscan.io/spo-polls/
https://github.com/cardano-foundation/CIP-0094-polls
Thanks to the following pools for helping to put together these guides. Please consider delegating to their pools to support them. Are you a pool? Consider buying them a coffee