Skip to content

Commit 68d477d

Browse files
committed
Add offline head instructions to withdraw zero how-to
1 parent a59270c commit 68d477d

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

docs/docs/how-to/withdraw-zero.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,40 @@ cabal repl hydra-plutus
1919
> import Hydra.Cardano.Api
2020
> script = PlutusScript dummyRewardingScript
2121
> serialiseAddress $ makeStakeAddress (Testnet $ NetworkMagic 42) (StakeCredentialByScript $ hashScript script)
22-
"stake_test17rekjamvnjyn3c3tcjpxe7ea20g7aek9vdqkaa3jefknz3gc066pt"
22+
"stake_test17rekjamvnjyn3c3tcjpxe7ea20g7aek9vdqkaa3jefknz3gc066pt"
2323
> writeFileTextEnvelope (File "../rewarding.plutus") Nothing script
2424
Right ()
2525
```
2626

2727
## Withdraw zero transaction
2828

29-
Then, we can construct a transaction that withdraws zero lovelace from the rewarding script's "account". Usually, other purposes like spending a UTxO would require the reward script to run, but here we just assume there exists such a UTxO in the L2 state and initialize an [offline head](../configuration#offline-mode) for an easy demo set-up:
29+
We can construct a transaction that withdraws zero lovelace from the rewarding script's "account". Usually, other purposes like spending a UTxO would require the reward script to run, but here we just assume there exists such a UTxO in the L2 state. You can initialize an [offline head](../configuration#offline-mode) for an easy demo set-up:
30+
31+
<details>
32+
<summary>Setup with offline head</summary>
33+
```
34+
cat > utxo.json <<EOF
35+
{
36+
"0000000000000000000000000000000000000000000000000000000000000000#0": {
37+
"address": "addr_test1vp5cxztpc6hep9ds7fjgmle3l225tk8ske3rmwr9adu0m6qchmx5z",
38+
"value": {
39+
"lovelace": 100000000
40+
}
41+
}
42+
}
43+
EOF
44+
```
45+
46+
```shell
47+
cabal run hydra-node:exe:hydra-node -- \
48+
--offline-head-seed 0001 \
49+
--initial-utxo utxo.json \
50+
--ledger-protocol-parameters hydra-cluster/config/protocol-parameters.json \
51+
--hydra-signing-key demo/alice.sk
52+
```
53+
</details>
54+
55+
Then, build, sign and submit the transaction that runs the rewarding script:
3056

3157
```shell title="Withdraw zero transaction"
3258
cardano-cli latest transaction build-raw \

0 commit comments

Comments
 (0)