# Answering SPO On-Chain Polls

{% hint style="info" %}
Credits to <img src="https://earncoinpool.com/images/coin_v3.png" alt="" data-size="line"> [Earn Coin Pool](https://earncoinpool.com/) for documenting the procedure.
{% endhint %}

{% hint style="danger" %}
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.<br>

If you haven't upgraded to 8.0.0, you can see our guide [here](https://ecp.gitbook.io/how-to-guides-for-coincashew-method-cardano-spos/maintenance-and-daily-operations/how-to-guides-for-spos-using-coincashew-method/update-node-and-cli-to-8.0.0).
{% endhint %}

## Step 1 - Prepare files

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.

{% hint style="success" %}
⚠️ON AIR GAPPED MACHINE - this is where your node.vkey is stored.
{% endhint %}

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
```

## Step 2 - Move pool.hex.id file to Live Relay Node&#x20;

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.

## Step 3 - Answer Poll&#x20;

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:

{% hint style="info" %}
For future polls the address below will need to be updated to the correct URL for the poll.json file related to that poll.
{% endhint %}

```
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
```

## Step 4 - Build Transaction

still on live relay node let's find UTXO with NO NFTs

```
cardano-cli query utxo \
--address $(cat payment.addr) \
--mainnet
```

{% hint style="warning" %}
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.
{% endhint %}

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
```

{% hint style="info" %}
When paying transaction with multi-signature addresses, you must add to the transaction build:\
&#x20;“--witness-override 3” to calculate the correct transaction fees.&#x20;

We use 3 in this example because we are using 3 private keys to sign the transaction later. Please adjust for your situation.
{% endhint %}

## Step 5 - Inspect Transaction

You should be able to run the following to see your transaction details.

```
cardano-cli transaction view \
--tx-file answer.tx
```

## Step 6 - Copy answer.tx to Air gapped and Sign the Transaction&#x20;

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
```

## Step 7 - Copy answer.tx.signed to Live Relay Node and Submit to Chain&#x20;

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
```

## Congratulations you did it!

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/>

## Additional Resources

<https://github.com/cardano-foundation/CIP-0094-polls>

## Contributors&#x20;

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

![](https://img.cexplorer.io/a/5/7/2/1/pool12wpfng6cu7dz38yduaul3ngfm44xhv5xmech68m5fwe4wu77udd.png) [Apex Cardano Pool - Ticker: APEX](https://cexplorer.io/pool/pool12wpfng6cu7dz38yduaul3ngfm44xhv5xmech68m5fwe4wu77udd)

![](https://img.cexplorer.io/7/e/1/9/f/pool16cdtqyk0fvxzfkhjg3esjcuty4tnlpds5lj0lkmqmwdjyzaj7p8.png)  [Earn Coin Pool - Ticker: ECP](https://cexplorer.io/pool/pool16cdtqyk0fvxzfkhjg3esjcuty4tnlpds5lj0lkmqmwdjyzaj7p8)

&#x20;![](https://img.cexplorer.io/9/0/1/d/4/pool1zn4wnk52kmfjy9mw4z85p6wn9kzrn94l9h5gys8r2k2w57mdnhh.png) [Envy Stake Pool - Ticker ENVY](https://cexplorer.io/pool/pool1zn4wnk52kmfjy9mw4z85p6wn9kzrn94l9h5gys8r2k2w57mdnhh)

![](https://img.cexplorer.io/f/4/3/4/6/pool1qhs3cf9ymc2nvmrd2j8cs36cj9jdqgnqk6s9ngyvy2lz5s8rak8.png) [PANL Stake Pool - Ticker PANL](https://cexplorer.io/pool/pool1qhs3cf9ymc2nvmrd2j8cs36cj9jdqgnqk6s9ngyvy2lz5s8rak8)&#x20;

![xSPO Alliance Logo](https://2549074837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8PjW7zFPfe4PgCsPtkZx%2Fuploads%2F0sqzqoHnqVXizi2RHABd%2FxSPO_NFT_64x64.png?alt=media\&token=1c1b130e-26df-4b1e-8e0e-e85fae1ee73e) [xSPO Alliance](http://xspo-alliance.org/discord)
