Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a changelog and a brief overview of the new features.
- Loading branch information
Showing
12 changed files
with
108 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Changelog | ||
|
||
## Playground v2.0.0 (April 11th 2019) | ||
|
||
### New Features | ||
|
||
* [Gist integration](./plutus-tutorial/markdown/2019-04-11-Gist_integration.md) | ||
* [Support for multiple traces](./plutus-tutorial/markdown/2019-04-11-Multiple_traces.md) | ||
* [Multi-currency ledger](./plutus-tutorial/markdown/2019-04-11-Multi-currency_ledger.md) | ||
* [Validity range for transactions](./plutus-tutorial/markdown/2019-04-11-Validity_range_for_transactions.md) | ||
|
||
### Enhancements | ||
|
||
* Tabbed layout | ||
* Improved blockchain graph | ||
* Cryptographic primivites | ||
* Improved vesting example |
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,40 @@ | ||
# Gist Support | ||
|
||
In the [Plutus Playground](https://prod.playground.plutus.iohkdev.io/) you can now save your contracts and simulations to Github [gists](https://help.github.com/en/articles/about-gists) and read them from there. | ||
|
||
## Getting started | ||
|
||
To use the gist integration you need to create an account on [Github](https://github.com) if you don't already have one. | ||
|
||
Open the Playground and click on the "Login" button in the top right corner: | ||
|
||
![Gist login button](./img/2019-04-11-gist-login.PNG) | ||
|
||
This brings up a Github authorisation page. After granting the permission to acess gists you are redirected back to the Playground. The "Login" button has been replaced by "Publish" and "Load" buttons: | ||
|
||
![Gist publish and load buttons](./img/2019-04-11-gist-publish-load-buttons.PNG) | ||
|
||
## Publishing a contract for the first time | ||
|
||
When you click "Publish", two things happen. | ||
|
||
1. A new gist is created under your profile on Github. (To view all of your gists go to `https://gist.github.com/<your github username>`) | ||
2. The ID of the gist appears in the textbox and the "Publish" button changes to "Republish". A link "View on Github" appears. | ||
|
||
![Gist republish](./img/2019-04-11-gist-loaded.PNG) | ||
|
||
The link takes you to the gist on Github. There are two files: `Playground.hs` containing the source code of your contract, and `Simulation.json` with the wallets and actions that you have set up. | ||
|
||
## Publishing a new version | ||
|
||
Every gist is backed by a git repository. Clicking the "Republish" button creates a new commit for the gist. When you click "View on Github" again you will see that the revision count has increased: | ||
|
||
![Gist revision](./img/2019-04-11-gist-revisions.PNG) | ||
|
||
To see all prior versions of the contract click the "Revisions" tab on the gist's Github page. | ||
|
||
## Sharing your contract | ||
|
||
To share a Plutus contract with others, publish it and take note of the textbox next to the "Republish" button. This is the gist's ID. To load a contract from a gist simply enter the ID into the textbox and click the "Load" button. The Playground updates with the contract code and the simulations from the gist. | ||
|
||
**Warning** Loading a gist overrides all content in the Playground. |
28 changes: 28 additions & 0 deletions
28
plutus-tutorial/markdown/2019-04-11-Multi-currency_ledger.md
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,28 @@ | ||
# Multi-currency ledger | ||
|
||
The blockchain simulator that backs the Playground has native support for user-defined currencies. This tutorial covers the Playground UI for entering and viewing amounts in currencies. For a detailed description of multi currency support on the ledger please refer to the [design document](../../docs/multi-currency/multi-currency.md). | ||
|
||
## Known Currencies | ||
|
||
Each currency on the ledger is identified by two 32-byte `ByteString`s. To make it easy to work with custom currencies in the Playground we have added a function `mkKnownCurrencies` (similar to `mkFunctions`). The argument to `mkKnownCurrencies` is a list of `KnownCurrency` values (exported from `Plutus.Playground`), which are defined as: | ||
|
||
```haskell | ||
data KnownCurrency = KnownCurrency | ||
{ hash :: ValidatorHash | ||
, friendlyName :: String | ||
, knownTokens :: NonEmpty TokenId | ||
} | ||
``` | ||
|
||
To define a `KnownCurrency` we need the `ValidatorHash` of the monetary policy script that controls the forging of the currency (see the [design document](../../docs/multi-currency/multi-currency.md) for details). `friendlyName` can be any `String` of your choice. Whenever a value of a currency is shown, we will see the currency's `friendlyName` instead of its `ValidatorHash`. `knownTokens` is a non-empty list of the currency's token IDs. | ||
|
||
```haskell | ||
|
||
myCurrency :: KnownCurrency | ||
myCurrency = KnownCurrency { ... } | ||
|
||
$(mkKnownCurrency ['myCurrency]) | ||
|
||
``` | ||
|
||
*TODO: Actua example* |
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 @@ | ||
# Multiple Simulations | ||
|
||
The [Plutus Playground](https://prod.playground.plutus.iohkdev.io/) now supports multiple simulations. Simulations consist of a description of wallets with their initial balances, and a sequence of actions. | ||
|
||
![Simulations](./img/2019-04-11-multi-traces.PNG) | ||
|
||
The "Simulation" tab shows one button for each simulation. To add a new simulation click the "+" button. To delete a simulation click the "X" button next to the simulation. Clicking on a simulation selects it. |
16 changes: 16 additions & 0 deletions
16
plutus-tutorial/markdown/2019-04-11-Validity_range_for_transactions.md
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,16 @@ | ||
# Validity range for transactions | ||
|
||
All transactions on the simulated blockchain now have a *validity range*. The validity range is an (open, closed) interval of slots. Transactions may only be validated if their validity range contains the current slot number. The validity range feature is what makes Plutus scripts completely deterministic - their resource usage (and hence the amount of gas required to run them) can be computed before the transaction is submitted. As a result, there is no risk of a Plutus smart contract running out of gas accidentally, and no risk of overpaying gas fees either. | ||
|
||
The Playground displays validity ranges as a pair of fiels `ivTo` and `ivFrom`: | ||
|
||
![Validity range in the Playground](./img/2019-04-11-slot-range.PNG) | ||
|
||
Note that the interval is inclusive-excluse. If the current slot number is equal to `ivTo` then the transaction can be validated, but if it is equal to or larger than `ivFrom` then it cannot be validated. Consider the following example: | ||
|
||
![Validity range in the Playground](./img/2019-04-11-validity-range.PNG) | ||
|
||
A transaction `ivFrom=5` and `ivTo=8` can be validated during any of the slots 5, 6, and 7. | ||
|
||
Also please note the order of the fields in the UI: `ivTo` is shown before `ivFrom`. If you set `ivFrom` to a value greater than or equal to `ivTo` then the transaction can never be validated and will forver linger in the pool of pending transactions. | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.