input-output-hk / voting-tools

Apache License 2.0
17 stars 10 forks source link

FR - Adding --output-format flag for raw(cbor) metadata output and --nonce flag #20

Closed gitmachtl closed 2 years ago

gitmachtl commented 3 years ago

Feature-Request:

Adding a --output-format flag with the values: txbody, txsigned and metadata Adding a --nonce flag to provide custom data instead of fixed value slotHeight

In --output-format metadata mode this would reduce the needed input-flags to:

./voter-registration --payment-address STRING 
                     --vote-public-key FILE 
                     --stake-signing-key FILE 
                     --nonce NONCE 
                     (--mainnet | --testnet-magic NATURAL) 
                     --output-format metadata 
                     --out-file FILE

The metadata out-file format should be binary(cbor) format so it can be attached to a transaction via the cardano-cli transaction build-raw --metadata-cbor-file flag.

This would also be in line with the cardano-hw-cli workflow for voting with hw-wallets, which also generates the metadata-cbor-file in raw(binary) format.

P.S.: Maybe it would also be an idea to rename the --payment-address flag into --rewards-payout-address flag, because maybe --payment-address is misleading here. The transaction including such a voting-registration-metadata can be paid by any wallet.

Tag: @disassembler

gitmachtl commented 3 years ago

The feature to just generate the voting-registration-metadata.cbor file would automatically introduce the ability to do it offline too.

gitmachtl commented 3 years ago

Recent changes in the Rewards-Payout should be reflected in changing the --payment-address STRING parameter into --rewards-address STRING for working with a metadata file output like:

./voter-registration --vote-public-key FILE 
                     --stake-signing-key FILE 
                     --reward-address STRING
                     --nonce NONCE 
                     (--mainnet | --testnet-magic NATURAL) 
                     --output-format metadata 
                     --out-file FILE
sevanspowell commented 3 years ago

@gitmachtl I can't give you a timeline, but we will be working on this :+1:

Thanks for the suggestion!

sevanspowell commented 2 years ago

Addressed in https://github.com/input-output-hk/voting-tools/pull/28