Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ sidebar_position: 5

# Generating Keys and Addresses

The best way to setup your environment is with the [plinth-template](https://github.com/IntersectMBO/plinth-template) repository. See its [README](https://github.com/IntersectMBO/plinth-template?tab=readme-ov-file#plinth-template) for complete instructions on how to get up and running using Docker, Nix, or a custom approach.
The best way to set up your environment is with the [plinth-template](https://github.com/IntersectMBO/plinth-template) installer, which creates a ready-to-build Plinth project using your choice of Nix, Docker, Demeter, or plain GHC + Cabal. See its [README](https://github.com/IntersectMBO/plinth-template?tab=readme-ov-file#plinth-template) for details. For this tutorial, create the project in a directory named `on-chain`:

```
curl -fsSL https://raw.githubusercontent.com/IntersectMBO/plinth-template/main/install.sh | sh -s -- --dir on-chain
```

Make sure you also have [NodeJS](https://nodejs.org/en) and [yarn](https://yarnpkg.com/) (or [npm](https://github.com/npm/cli), which comes with `NodeJS`) installed.
Then, create a separate `off-chain` directory, initialize `package.json`, and install the required dependencies:

```
git clone git@github.com:IntersectMBO/plinth-template.git on-chain
mkdir off-chain && cd $_
yarn init -y
yarn add @meshsdk/core
Expand Down
4 changes: 2 additions & 2 deletions doc/docusaurus/docs/auction-smart-contract/end-to-end/mint.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Therefore, we'll first write the on-chain script, then compute its hash and use

## On-chain Minting Policy Script

The full minting policy code can be found at [AuctionMintingPolicy.hs](https://github.com/IntersectMBO/plinth-template/blob/main/src/AuctionMintingPolicy.hs).
The full minting policy code can be found at [AuctionMintingPolicy.hs](https://github.com/IntersectMBO/plinth-template/blob/main/template/src/AuctionMintingPolicy.hs).
The main logic is in the following function:

<LiteralInclude file="AuctionMintingPolicy.hs" language="haskell" title="AuctionMintingPolicy.hs" start="-- BLOCK1" end="-- BLOCK2" />
Expand All @@ -34,7 +34,7 @@ To do so, we first need to supply a public key hash, which the minting policy wi
Assuming the seller is the one minting the token, this should be the seller's public key hash.
Open `GenMintingPolicyBlueprint.hs` in the `on-chain` directory, and replace `error "Replace with seller pkh"` with the content of `off-chain/seller.pkh`.

The minting policy code comes with `plinth-template`, so you can find it in the `on-chain` repository.
The minting policy code comes with `plinth-template`, so you can find it in the `on-chain` project directory.
To compile it and generate the blueprint, navigate to the `on-chain` directory and run

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ She would like to create and deploy an auction smart contract with the following

Plinth is a subset of Haskell, used to write on-chain code, also known as validators or scripts.
A Plinth program is compiled into Plutus Core, which is interpreted on-chain.
The full Plinth code for the auction smart contract can be found at [AuctionValidator.hs](https://github.com/IntersectMBO/plinth-template/blob/main/src/AuctionValidator.hs).
The full Plinth code for the auction smart contract can be found at [AuctionValidator.hs](https://github.com/IntersectMBO/plinth-template/blob/main/template/src/AuctionValidator.hs).

<!-- will need to update the link and file location for the new docs platform implementation -->

Expand Down
8 changes: 7 additions & 1 deletion doc/docusaurus/docs/using-plinth/environment-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ However, there are a few additional requirements:
- You’ll need some specific packages, such as `plutus-tx` and `plutus-tx-plugin`, which are hosted on the [Cardano Haskell Package repository](https://github.com/IntersectMBO/cardano-haskell-packages) (CHaP), rather than Hackage, Haskell's default package archive.
- You'll also need a few C libraries such as `secp256k1` and `blst`, which are required by the `plutus-tx` library.

The best way to setup your environment is with the [plinth-template](https://github.com/IntersectMBO/plinth-template) repository. See its [README](https://github.com/IntersectMBO/plinth-template?tab=readme-ov-file#plinth-template) for complete instructions on how to get up and running using Docker, Nix, or a custom approach.
The best way to set up your environment is with [plinth-template](https://github.com/IntersectMBO/plinth-template), which creates a ready-to-build Plinth project for you with one command:

```
curl -fsSL https://raw.githubusercontent.com/IntersectMBO/plinth-template/main/install.sh | sh
```

The installer asks which development environment you want (Nix, Docker, Demeter, or plain GHC + Cabal), checks that environment's prerequisites, takes care of the required C libraries, and creates a fresh project containing only the files that environment needs. See its [README](https://github.com/IntersectMBO/plinth-template?tab=readme-ov-file#plinth-template) for details.
Loading