Currently, docs don't have a complete example for at least 3 participants.
We need to do things like commit, and all them needs to commit, etc. Hydra head state needs to be checked. And several hydra operations need to be performed. For example, we could have
A minimum example could be
-
Head setup and inspection
- Call
/hydra/init to initialize a Hydra Head (or show how to join an existing one, if applicable).
- Use
/hydra/query/head and /hydra/query/state to confirm the initial state and participants.
- Optionally show
/hydra/query/protocol-parameters so developers see how to fetch configuration.
-
Commit from L1 into the Head
- Select one or more UTxOs on L1 (using the regular Kuber endpoints, plus
/hydra/query/utxo to see what Hydra sees once running).
- Call
/hydra/commit to commit those UTxOs into the Head. [[dquadrant.github]
- Use
/hydra/query/commits and /hydra/query/utxo to verify that the committed funds are now in the Hydra Head.
-
On-head transaction flow
- Use
/hydra/tx to build a transaction that spends Hydra UTxOs (e.g., a simple payment between two parties or a token transfer).
- Submit this transaction via
/hydra/submit and wait for confirmation.
- Query updated UTxOs via
/hydra/query/utxo to demonstrate the new balances/state on L2.
-
Closing and settling back to L1
- Call
/hydra/close to start closing the Head.
- Optionally illustrate
/hydra/contest in a simple scenario, or at least mention where it fits.
- Use
/hydra/fanout once the contestation period is over to distribute the final state back to L1.
- Show a final
/hydra/query/head or /hydra/query/state plus an L1 query (from Kuber) to confirm that funds have returned to the main chain.
What the concrete example should demonstrate
- A single script showing that:
- Connects to a running Hydra-enabled Kuber instance.
- Calls the command API in the logical order:
init → commit → tx/submit → close → fanout. [
- Uses the query API between steps to print meaningful state (head status, committed UTxOs, current Hydra UTxO set).
Currently, docs don't have a complete example for at least 3 participants.
We need to do things like commit, and all them needs to commit, etc. Hydra head state needs to be checked. And several hydra operations need to be performed. For example, we could have
A minimum example could be
Head setup and inspection
/hydra/initto initialize a Hydra Head (or show how to join an existing one, if applicable)./hydra/query/headand/hydra/query/stateto confirm the initial state and participants./hydra/query/protocol-parametersso developers see how to fetch configuration.Commit from L1 into the Head
/hydra/query/utxoto see what Hydra sees once running)./hydra/committo commit those UTxOs into the Head. [[dquadrant.github]/hydra/query/commitsand/hydra/query/utxoto verify that the committed funds are now in the Hydra Head.On-head transaction flow
/hydra/txto build a transaction that spends Hydra UTxOs (e.g., a simple payment between two parties or a token transfer)./hydra/submitand wait for confirmation./hydra/query/utxoto demonstrate the new balances/state on L2.Closing and settling back to L1
/hydra/closeto start closing the Head./hydra/contestin a simple scenario, or at least mention where it fits./hydra/fanoutonce the contestation period is over to distribute the final state back to L1./hydra/query/heador/hydra/query/stateplus an L1 query (from Kuber) to confirm that funds have returned to the main chain.What the concrete example should demonstrate
init → commit → tx/submit → close → fanout. [