-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #488 from MeshJS/feature-update/core-cst-serializer
core-cst 1.9.0 beta0
- Loading branch information
Showing
85 changed files
with
5,593 additions
and
8,810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Alert({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="mb-4 rounded-lg bg-blue-50 p-4 text-sm text-blue-800 dark:bg-gray-800 dark:text-blue-400"> | ||
{children} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import type { NextPage } from "next"; | ||
import { useState } from "react"; | ||
|
||
import { HydraInstance, HydraProvider, MeshWallet } from "@meshsdk/core"; | ||
|
||
import SidebarFullwidth from "~/components/layouts/sidebar-fullwidth"; | ||
import Link from "~/components/link"; | ||
import TitleIconDescriptionBody from "~/components/sections/title-icon-description-body"; | ||
import Metatags from "~/components/site/metatags"; | ||
import { metaHydraTutorial } from "~/data/links-hydra"; | ||
import { getPageLinks } from "../common"; | ||
import HydraTutorialPrerequisites from "./prerequisites"; | ||
import HydraTutorialStep2 from "./step2"; | ||
import HydraTutorialStep3 from "./step3"; | ||
import HydraTutorialStep4 from "./step4"; | ||
import HydraTutorialStep5 from "./step5"; | ||
|
||
const ReactPage: NextPage = () => { | ||
const [aliceNode, setAliceNode] = useState<MeshWallet | undefined>(undefined); | ||
const [aliceFunds, setAliceFunds] = useState<MeshWallet | undefined>( | ||
undefined, | ||
); | ||
const [bobNode, setBobNode] = useState<MeshWallet | undefined>(undefined); | ||
const [bobFunds, setBobFunds] = useState<MeshWallet | undefined>(undefined); | ||
|
||
const hydraProvider = new HydraProvider({ url: "http://35.189.158.126:4001" }); | ||
const hydraInstance = new HydraInstance({ | ||
provider: hydraProvider, | ||
}); | ||
|
||
return ( | ||
<> | ||
<Metatags | ||
title={metaHydraTutorial.title} | ||
description={metaHydraTutorial.desc} | ||
/> | ||
<SidebarFullwidth sidebarItems={getPageLinks()}> | ||
<TitleIconDescriptionBody | ||
title={metaHydraTutorial.title} | ||
description={metaHydraTutorial.desc} | ||
> | ||
<> | ||
<p> | ||
This tutorial demonstrates how to use hydra-node on Cardano's | ||
preprod testing environment to open a layer 2 state channel | ||
between two participants using the Hydra Head protocol. | ||
</p> | ||
<p> | ||
This tutorial is adapted from{" "} | ||
<Link href="https://hydra.family/head-protocol/docs/tutorial/"> | ||
the Hydra documentation | ||
</Link> | ||
. | ||
</p> | ||
</> | ||
</TitleIconDescriptionBody> | ||
|
||
<HydraTutorialPrerequisites /> | ||
<HydraTutorialStep2 | ||
aliceNode={aliceNode} | ||
aliceFunds={aliceFunds} | ||
bobNode={bobNode} | ||
bobFunds={bobFunds} | ||
setAliceNode={setAliceNode} | ||
setAliceFunds={setAliceFunds} | ||
setBobNode={setBobNode} | ||
setBobFunds={setBobFunds} | ||
/> | ||
<HydraTutorialStep3 | ||
aliceNode={aliceNode} | ||
aliceFunds={aliceFunds} | ||
bobNode={bobNode} | ||
bobFunds={bobFunds} | ||
/> | ||
<HydraTutorialStep4 | ||
hydraInstance={hydraInstance} | ||
aliceNode={aliceNode} | ||
aliceFunds={aliceFunds} | ||
bobNode={bobNode} | ||
bobFunds={bobFunds} | ||
/> | ||
<HydraTutorialStep5 | ||
hydraInstance={hydraInstance} | ||
aliceNode={aliceNode} | ||
aliceFunds={aliceFunds} | ||
bobNode={bobNode} | ||
bobFunds={bobFunds} | ||
/> | ||
</SidebarFullwidth> | ||
</> | ||
); | ||
}; | ||
|
||
export default ReactPage; |
32 changes: 32 additions & 0 deletions
32
apps/playground/src/pages/hydra/tutorial/prerequisites.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Link from "~/components/link"; | ||
import TwoColumnsScroll from "~/components/sections/two-columns-scroll"; | ||
|
||
export default function HydraTutorialPrerequisites() { | ||
return ( | ||
<TwoColumnsScroll | ||
sidebarTo="prerequisites" | ||
title="Prerequisites" | ||
leftSection={Left()} | ||
/> | ||
); | ||
} | ||
|
||
function Left() { | ||
return ( | ||
<> | ||
<p> | ||
First, generate Cardano key pairs and addresses for both participants to | ||
identify the hydra-node and manage funds on layer 1: | ||
</p> | ||
<ul> | ||
<li> | ||
Hydra node and cardano-node running, check{" "} | ||
<Link href="https://hydra.family/head-protocol/docs/installation/"> | ||
Installation | ||
</Link> | ||
. | ||
</li> | ||
</ul> | ||
</> | ||
); | ||
} |
Oops, something went wrong.