CardanoSolutions/kupo

support matches on outputs from the cli

Closed this issue · 2 comments

Describe your idea, in simple words.

Have kupo understand cardano-cli output.

Why is it a good idea?

The cardano cli will build what it calls a stake address.

cardano-cli stake-address build --stake-verification-key-file stake.vkey $CARDANO_NODE_MAGIC

This does not output a thing that kupo understands. (Kupo error : cannot parse)

Reading CIP-0019, CIP-0005, and eventually finding (this SE)[https://cardano.stackexchange.com/questions/2215/cardano-cli-verification-key-bech32-encoding] suggests a kupo friendly input is

cat stake.vkey | jq '.cborHex' | cut -c 6-69 | bech32 stake_vk

Surely... this isn't what you have to do?! But I've no idea what is.

Are you willing to work on it yourself?

Ummm. Yes but you code so beautifully I daren't

KtorZ commented

Hey!

This does not output a thing that kupo understands. (Kupo error : cannot parse)

I am curious to see what this outputs on your end, because Kupo does parse stake addresses just fine. Trying locally on my end:

cardano-cli stake-address build --stake-verification-key-file tmp.vk --mainnet
stake1uxuweccthd5qqgfh49uq592qr8mh7a78g89jjv0u74vnzasr3safd

Which I can feeds into kupo without any problem. I even added a test case just for it:

Test.Kupo.Options
  parseOptions(Pure)
    Test.Kupo.OptionsSpec[63:13]
        --node-socket ./node.socket --node-config ./node.config --in-memory --match stake1uxuweccthd5qqgfh49uq592qr8mh7a78g89jjv0u74vnzasr3safd [✔]

You're right! :)

I was totally unable to work out that if I use this version of stake address I don't use the prefix "*/...". It didn't occur to me that that would be the error of my ways.

Now I know, staring again at the docs I can see this information is present in diagram. Can't quite get my head around why stake_vk and stake aren't interchangeable.

Anyway. Thanks for your obscenely fast assistance with this.