I have a validator that uses Address
in datum. I also have an address generated (payment.vkey
, payment.skey
, payment.addr
, stake.vkey
, stake.skey
, stake.addr
). I'm able to get PubKeyHash
using command line like this:
cardano-cli address key-hash --payment-verification-key-file payment.vkey
That gives an addressPaymentCredential
that I'm able to embed to datum when building the transaction in cli. It has the same information as (addressPaymentCredential, _)
. How would I go about getting a full address with addressStakingCredential
in it, that is, (addressPaymentCredential, addressStakingCredential)
?
I think that the JSON
structure of Address
in datum should be like this:
{
"constructor": 0,
"fields": [
{
"constructor": 0,
"fields": [
{
"bytes": PubKeyHash
}
]
},
{
"constructor": 1,
"fields": [
{
"bytes": StakingCredentialHash
}
]
}
]
}
My problem is I don't know how to get StakingCredentialHash
.
TLDR: How do I embedd an Address
instead of just PubKeyHash
into the datum in cardano cli? I have the address credentials in payment.*
and stake.*
files.
ToData a
, wherea = Address(addressCredential, addressStakingCredential)
. In the JSON provided, I can replacePubKeyHash
(which is just a placeholder there) with the output ofcardano-cli address key-hash --payment-verification-key-file payment.vkey
. My problem is that I can't figure out, what I need to replace theStakingCredentialHash
placeholder with. I have thestake.vkey
file, but I need some command to transform it in a similar manner to how I did withpayment.vkey
.