Skip to content

Commit 469218a

Browse files
committed
Removing duplicates
1 parent 1612da7 commit 469218a

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

docs/docs/tutorial/index.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ The Hydra Head protocol requires a connection to the Cardano layer 1 network to
107107

108108
Download the latest blockchain snapshot using `mithril-client` configured for the `pre-production` network:
109109

110-
Download the latest blockchain snapshot using `mithril-client` configured for the `preprod` network:
111110

112111
```shell
113112
mithril-client cardano-db download latest
@@ -179,12 +178,9 @@ source <(cardano-cli --bash-completion-script cardano-cli)
179178

180179
## Step 2. Prepare keys and funding
181180

182-
## Step 2: Prepare keys and funding
183181

184182
First, generate Cardano key pairs and addresses for both participants to identify the `hydra-node` and manage funds on layer 1:
185183

186-
First, generate Cardano key pairs and addresses for both participants to identify the `hydra-node` and manage funds on layer one:
187-
188184

189185
import Tabs from '@theme/Tabs';
190186
import TabItem from '@theme/TabItem';
@@ -238,8 +234,6 @@ cardano-cli address build \
238234
</TabItem>
239235
Next, fund these addresses. If you have test ada on the `pre-production` network, distribute it to the newly created addresses:
240236

241-
Next, fund these addresses. If you have tADA on `preprod`, distribute it to the newly created addresses:
242-
243237
<Tabs queryString="role">
244238
<TabItem value="alice" label="Alice">
245239

@@ -267,7 +261,6 @@ echo $(cat credentials/bob-funds.addr)"\n"
267261

268262
In case you don't have test ada on `pre-production`, you can use the [testnet faucet](https://docs.cardano.org/cardano-testnets/tools/faucet/) to fund your wallet or the addresses above. Note that due to rate limiting, it's better to request large sums for efficiency and distribute as needed.
269263

270-
In case you have no tADA on `preprod`, you can use the [Testnet Faucet](https://docs.cardano.org/cardano-testnet/tools/faucet/) to fund your wallet or the addresses above. Note that due to rate limiting, it's better to request large sums for efficiency and distribute as needed.
271264
:::
272265

273266
You can check the balance of your addresses via:
@@ -297,7 +290,6 @@ cardano-cli query utxo --address $(cat credentials/bob-funds.addr) --out-file /d
297290
</TabItem>
298291
Next, generate Hydra key pairs for use on layer 2. Use the
299292

300-
Next, generate Hydra key pairs for use on layer two. Use the
301293
`hydra-tools` to generate the keys for `alice` and/or `bob` respectively:
302294

303295
<Tabs queryString="role">
@@ -317,40 +309,38 @@ hydra-node gen-hydra-key --output-file credentials/bob-hydra
317309
</TabItem>
318310
If you are collaborating with another individual, exchange the verification (public) keys: `{alice,bob}-node.vk` and `{alice,bob}-hydra.vk` to ensure secure communication.
319311

320-
If you are collaborating with a partner, exchange the verification (public) keys: `{alice,bob}-node.vk` and `{alice,bob}-hydra.vk` to ensure secure communication
321312
Before launching the `hydra-node`, it's crucial to establish and communicate each participant's network connectivity details. This includes the IP addresses and ports where `Alice` and `Bob's` nodes will be reachable for layer 2 network interactions. For this tutorial, we're using placeholder IP addresses and ports which should be replaced with your actual network details:
322313

323-
Before launching the `hydra-node`, it's crucial to establish and communicate each participant's network connectivity details. This includes the IP addresses and ports where `Alice` and `Bob's` nodes will be reachable for the layer two network interactions. For this tutorial, we're using placeholder IP addresses and ports which should be replaced with your actual network details:
324314

325315
<!-- TODO: can we make peers configurable via some text input? -->
326316

327317
Alice: <code>127.0.0.1:5001</code>
328318

319+
Bob: <code>127.0.0.1:5001</code>
320+
329321
The next step involves configuring the protocol parameters for the ledger within our Hydra head. For the purposes of this tutorial, we'll modify the default Cardano layer 1 parameters to eliminate transaction fees, simplifying test interactions:
330322

331-
The next step involves configuring the protocol parameters for the ledger within our Hydra head. For the purposes of this tutorial, we'll modify the default Cardano layer one parameters to eliminate transaction fees, simplifying our test interactions:
332323

333324
```
334325
cardano-cli query protocol-parameters \
335326
| jq '.txFeeFixed = 0 |.txFeePerByte = 0 | .executionUnitPrices.priceMemory = 0 | .executionUnitPrices.priceSteps = 0' \
336327
> protocol-parameters.json
337328
This command adjusts the fees and pricing mechanisms to zero, ensuring that transactions within the Hydra head incur no costs.
338329
339-
This command adjusts the fees and pricing mechanisms to zero, ensuring that transactions within our Hydra head incur no costs.
340330
341331
In summary, the Hydra head participants exchanged and agreed on:
342332
343333
- IP addresses and the port on which their `hydra-node` will run
344334
- A Hydra verification key to identify them in the head
345335
- A Cardano verification key to identify them on the blockchain
346336
- Protocol parameters to use in the Hydra head
337+
338+
347339
## Step 3. Start the Hydra node
348340
349-
## Step 3: Start the Hydra node
350341
351342
Scripts are pre-published for all [released](https://github.com/input-output-hk/hydra/releases) HYDRA_VERSIONs of the `hydra-node` and common Cardano networks. Consult the [user manual](../configuration#reference-scripts) for guidance on publishing your own scripts.
352343
353-
For all [released](https://github.com/input-output-hk/hydra/releases) HYDRA_VERSIONs of the `hydra-node` and common Cardano networks, scripts are pre-published. Consult the [user manual](../configuration#reference-scripts) for guidance on publishing your own scripts.
354344
355345
Start the `hydra-node` using these parameters:
356346
@@ -445,7 +435,6 @@ This opens a duplex connection and you should see messages indicating successful
445435

446436
## Step 4. Open a Hydra head
447437

448-
## Step 4: Open a Hydra head
449438

450439
Using the `jq` enhanced `websocat` session, we can now communicate with the `hydra-node` through its Websocket API on the terminal. This is a duplex connection and we can just insert commands directly.
451440

@@ -459,10 +448,7 @@ Send this command to initialize a head through the Websocket connection:
459448

460449
The initiation process might take some time as it includes submitting a transaction on-chain. Upon successful initiation, both Hydra nodes and their clients will display a `HeadIsInitializing` message, listing the parties required to commit.
461450

462-
To commit funds to the head, you need to choose which UTXOs you would like to make available on layer 2. Use the HTTP API of `hydra-node` to commit all
463-
464-
To commit funds to the head, meaning to choose which UTXOs to make available on layer two. Use the HTTP API of `hydra-node` to commit all
465-
funds given to `{alice,bob}-funds.vk` beforehand:
451+
To commit funds to the head, you need to choose which UTXOs you would like to make available on layer 2. Use the HTTP API of `hydra-node` to commit all funds given to `{alice,bob}-funds.vk` beforehand:
466452

467453
<Tabs queryString="role">
468454
<TabItem value="alice" label="Alice">
@@ -527,14 +513,13 @@ When both parties, `alice` and `bob`, have committed, the Hydra head will open
527513

528514
The head is now operational and ready for further activities.
529515

530-
The head is now operational and ready for further activities.
516+
531517
## Step 5. Use the Hydra head
532518

533519
In this step, we'll demonstrate a basic transaction between `alice` and `bob` using the Hydra head. Hydra Head operates as an isomorphic protocol, meaning that functionalities available on the Cardano layer 1 network are also available on the layer 2 network. This compatibility allows us to use familiar tools like `cardano-cli` for transaction creation within the head.
534520

535521
In this example, we will transfer 10 ada from Alice to Bob. Adjust the transaction amount based on the balances previously committed to the head.
536522

537-
In this example, we will transfer `10₳` from Alice to Bob. Adjust the transaction amount based on the balances previously committed to the head.
538523

539524
First, we need to select a UTXO to spend. We can find a UTXO by referring to the `utxo` field in the most recent `HeadIsOpen` or `SnapshotConfirmed` messages. Alternatively, we can query the current UTXO set directly from the API:
540525

@@ -597,9 +582,8 @@ The transation will be validated by both `hydra-node`s and either result in a
597582
🎉 Congratulations, you just processed your first Cardano transaction off-chain
598583
in a Hydra head!
599584

600-
## Step 6. Close the Hydra head
601585

602-
## Step 6: Closing the Hydra head
586+
## Step 6. Closing the Hydra head
603587

604588
Any participant can initiate closing the Hydra head. Use the WebSocket API to submit the closing command:
605589

@@ -643,7 +627,7 @@ cardano-cli query utxo --address $(cat credentials/bob-funds.addr) --out-file /d
643627

644628
That's it. That's the full life-cycle of a Hydra head.
645629

646-
## Bonus: Be a good citizen
630+
## Bonus. Be a good citizen
647631

648632
As we have taken our funds from the testnet faucet and we do not need them
649633
anymore, we can return all the remaining tADA of `alice` and `bob` back to the

0 commit comments

Comments
 (0)