I want to run a statemachine on testnet.
The SM runs in the emulator, and I can initialize on testnet, but if I try to make a new client it throws an error. The error comes from transition failure, but this is due to the PAB not being able to re-establish state.
I find this pretty hard to debug, but as far as I can see we have the following:
- The SM has the function
getState
function (here) - This calls
typeScriptTxOut
(here) which expects a valueRight Datum
or else errors. - The
ChainIndexTxOut
(Here) has the value typeEither DatumHash Datum
- the PAB ask the relies on the chain-index for this data.
- The chain-index seems to return only
Left DatumHash
(here)
The chain index does know the datum from the hash. However this requires an additional query to the datum table or equivalent join.
Has anyone else had this problem / solved this problem/ able to explain how I've got it wrong, and there's no problem here?
(plutus-apps tag:7ed28bd67d7653b3ffe08b45848134380a738148
)
MustHashDatum
orMustIncludeDatum
in the construction of the transactions? The former only adds the hash of the datum to the output (and thus results in aLeft DatumHash
. The latter actually adds the datum to the transaction which creates the utxo (and thus results in aRight Datum
).