You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
269
263
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.
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.
319
311
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
321
312
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:
322
313
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:
324
314
325
315
<!-- TODO: can we make peers configurable via some text input? -->
326
316
327
317
Alice: <code>127.0.0.1:5001</code>
328
318
319
+
Bob: <code>127.0.0.1:5001</code>
320
+
329
321
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:
330
322
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:
This command adjusts the fees and pricing mechanisms to zero, ensuring that transactions within the Hydra head incur no costs.
338
329
339
-
This command adjusts the fees and pricing mechanisms to zero, ensuring that transactions within our Hydra head incur no costs.
340
330
341
331
In summary, the Hydra head participants exchanged and agreed on:
342
332
343
333
- IP addresses and the port on which their `hydra-node` will run
344
334
- A Hydra verification key to identify them in the head
345
335
- A Cardano verification key to identify them on the blockchain
346
336
- Protocol parameters to use in the Hydra head
337
+
338
+
347
339
## Step 3. Start the Hydra node
348
340
349
-
## Step 3: Start the Hydra node
350
341
351
342
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.
352
343
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.
354
344
355
345
Start the `hydra-node` using these parameters:
356
346
@@ -445,7 +435,6 @@ This opens a duplex connection and you should see messages indicating successful
445
435
446
436
## Step 4. Open a Hydra head
447
437
448
-
## Step 4: Open a Hydra head
449
438
450
439
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.
451
440
@@ -459,10 +448,7 @@ Send this command to initialize a head through the Websocket connection:
459
448
460
449
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.
461
450
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:
466
452
467
453
<TabsqueryString="role">
468
454
<TabItemvalue="alice"label="Alice">
@@ -527,14 +513,13 @@ When both parties, `alice` and `bob`, have committed, the Hydra head will open
527
513
528
514
The head is now operational and ready for further activities.
529
515
530
-
The head is now operational and ready for further activities.
516
+
531
517
## Step 5. Use the Hydra head
532
518
533
519
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.
534
520
535
521
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.
536
522
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.
538
523
539
524
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:
540
525
@@ -597,9 +582,8 @@ The transation will be validated by both `hydra-node`s and either result in a
597
582
🎉 Congratulations, you just processed your first Cardano transaction off-chain
598
583
in a Hydra head!
599
584
600
-
## Step 6. Close the Hydra head
601
585
602
-
## Step 6: Closing the Hydra head
586
+
## Step 6. Closing the Hydra head
603
587
604
588
Any participant can initiate closing the Hydra head. Use the WebSocket API to submit the closing command:
0 commit comments