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 #501 from cardano-foundation/staging
EVM and Glow updates
- Loading branch information
Showing
27 changed files
with
635 additions
and
8 deletions.
There are no files selected for viewing
Binary file added
BIN
+86.3 KB
...rticles/article-images/2021-02-03_07-00-00_learning-glow-by-example/auction.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35 KB
...articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/ballot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.4 KB
...rticles/article-images/2021-02-03_07-00-00_learning-glow-by-example/buy_sig.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41 KB
...ticles/article-images/2021-02-03_07-00-00_learning-glow-by-example/coinflip.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.1 KB
...s/article-images/2021-02-03_07-00-00_learning-glow-by-example/deadmanswitch.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.4 KB
...rticles/article-images/2021-02-03_07-00-00_learning-glow-by-example/rps-min.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
10 changes: 5 additions & 5 deletions
10
...n/2020-12-14_16-00-00_FAQ_kevm_iele-en.md → ...12-14_16-00-00_FAQ_virtual-machines-en.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
7 changes: 7 additions & 0 deletions
7
resources/content/articles/en/2021-02-03_07-00-00_getting-started-en.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,7 @@ | ||
--- | ||
title: Getting started | ||
description: Study Glow using code examples | ||
order: 2 | ||
parent: 2020-05-04_06-00-00_glow | ||
last_updated: "2021-02-03T07:00:00+01:00" | ||
--- |
11 changes: 11 additions & 0 deletions
11
resources/content/articles/en/2021-02-03_07-00-00_glow-tutorial-en.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,11 @@ | ||
--- | ||
parent: 2021-02-03_07-00-00_getting-started | ||
title: Glow tutorial | ||
description: Installation instructions | ||
order: 3 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- | ||
|
||
# Glow Tutorial | ||
|
||
We’ll update this section soon with tutorials and guides. Make sure you sign up to our [devnets newsletter](https://mailchi.mp/iohk/devdigest) to get the latest updates delivered to your inbox |
11 changes: 11 additions & 0 deletions
11
resources/content/articles/en/2021-02-25_00-00-00_smart_contracts_architecture.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,11 @@ | ||
--- | ||
title: Smart Contracts Architecture | ||
description: EVM Smart Contracts Architecture | ||
parent: 2021-02-25_11-00-00_about | ||
order: 2 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- | ||
|
||
## Smart Contracts Architecture | ||
|
||
The smart contract architecture is the same for the KEVM and EVM; see [smart contracts architecture](/en/virtual-machines/kevm/about/iele_vm_architecture/) for more details. |
22 changes: 22 additions & 0 deletions
22
resources/content/articles/en/2021-02-25_07-00-00_glow-install-en.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,22 @@ | ||
--- | ||
title: Installing Glow | ||
description: Installing Glow | ||
parent: 2021-02-03_07-00-00_getting-started | ||
order: 1 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- | ||
## Installing Glow | ||
|
||
The first step is to install Glow so that you can get started. Glow can be installed on either Linux or MacOs. You can run the installation inside a virtual machine and for extra security we recommend that you use [Qubes OS](https://www.qubes-os.org/). | ||
|
||
To install Glow, follow these steps: | ||
1. Open a terminal window (or any application on your system that allows you to enter shell commands). | ||
2. Type the following command line: | ||
|
||
`curl -L https://glow-lang.org/install/glow-install | sh` | ||
|
||
This installation script first installs the [Nix](https://nixos.org/) package manager, which may require you to manually type yes, or y and/or type the administrator password to authorize parts of the installation. If you were not using Nix before, you may have to start a new shell for the PATH to be set up correctly and be able to run glow. | ||
|
||
**Note**: If you use Linux or macOS on x86_64, all the binary packages for the software are cached, and the installation should only take a few minutes, depending on the speed of your internet connection. This software may require over 2GB of memory, so please ensure that you have enough available space on disk. If you use another platform, your computer may recompile code from source, so you should let it run overnight. | ||
|
||
We plan to release a Docker image soon, so please check back for updates. |
160 changes: 160 additions & 0 deletions
160
resources/content/articles/en/2021-02-25_07-00-00_glow-test-network-en.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,160 @@ | ||
--- | ||
title: Setting up the Test Network | ||
description: Setting up the Test Network | ||
parent: 2021-02-03_07-00-00_getting-started | ||
order: 2 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- | ||
## Setting up the Test Network | ||
|
||
By default, Glow will use the Cardano EVM Devnet (“ced”)—a public network on which you can interact with other users. You may experience a short delay of a minute or so when confirming each step of the interaction. | ||
|
||
For faster local-only tests with confirmations in a couple of seconds, you can instead run your own private Ethereum test network (“pet”) on your computer with these instructions. You should add the flags --evm-network pet to your invocations of Glow, as follows: | ||
|
||
`git clone https://github.com/fare/gerbil-ethereum.git | ||
cd gerbil-ethereum | ||
./scripts/run-ethereum-test-net.ss` | ||
|
||
### Creating Keys | ||
Each participant must first generate their own identity on their own machine, with their own secret key, as follows: | ||
|
||
Alice: | ||
|
||
`glow generate-identity --nickname Alice` | ||
|
||
Bob: | ||
|
||
`glow generate-identity --nickname Bob` | ||
|
||
### Sharing Contact Information | ||
After creating your key, you must share it with the other participant in the interaction (for example, using a chat application such as Slack). | ||
|
||
First, each participant lists their address using: | ||
|
||
`glow list-identities` | ||
|
||
The listed addresses will appear in the following format (these are examples): | ||
|
||
`Alice [ 0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1 ]` | ||
`Bob [ 0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD ]` | ||
|
||
Each participant then uses a copy and paste function to share their address with the other participant, who will register it as follows: | ||
Alice replaces the address with Bob’s actual address, as follows: | ||
|
||
`address=0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD` | ||
`glow add-contact --nickname Bob --address ${address}` | ||
|
||
Bob replaces the address with Alice’s actual address, as follows: | ||
|
||
`address=0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1` | ||
|
||
`glow add-contact --nickname Alice --address ${address}` | ||
|
||
### Getting Tokens from the Faucet: | ||
As your address is a new address it does not have any tokens to spend, or to use to pay for gas. To get some tokens for your address you can use the test network’s faucet, as follows: | ||
|
||
Alice runs: | ||
|
||
`glow faucet --to Alice --evm-network pet` | ||
|
||
Bob runs: | ||
|
||
`glow faucet --to Bob --evm-network pet` | ||
|
||
(If you are using your own private Ethereum test network, the two commands above and every command below (with the exception of the digest command) are where you must add the flags --evm-network pet to your invocations of glow.) | ||
|
||
### Configuring the Interactions | ||
This section outlines how you should configure the contract interactions of Alice and Bob. | ||
|
||
#### Setting up Alice’s Interaction | ||
One of the two participants writes a document for the other to sign. For example, Alice prepares the following document and sends it to Bob for review: | ||
|
||
`echo “Bob sells BLAH to Alice” > document.txt` | ||
|
||
When both agree on the document, they should each compute its digest with: | ||
|
||
`glow digest document.txt` | ||
|
||
Now, Alice can sign the interaction. In the scenario where you are running the interactions on the same machine, you should specify a database so the two users will not conflict with each other’s data; the extra database specification is not necessary if the users are running on different machines. | ||
|
||
`glow start-interaction --database run/Alice --evm-network pet` | ||
|
||
The CLI will then prompt Alice to select an application, choose which identity to use for the interaction, which role they will play in it, assign addresses to roles of the other identities, enter the interaction parameters, and finally, print the interaction agreement for Alice to send to Bob, so that he can configure his side of the interaction with the same parameters. | ||
|
||
Here is an example of what the setup should look like from Alice’s side: | ||
``` | ||
Choose application: | ||
1) coin_flip | ||
2) buy_sig | ||
3) rps_simple | ||
Enter number | ||
> 2 | ||
``` | ||
``` | ||
Choose your identity: | ||
1) Alice - 0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1 | ||
Enter number | ||
> 1 | ||
``` | ||
``` | ||
Choose your role: | ||
1) Buyer | ||
2) Seller | ||
Enter number | ||
> 1 | ||
``` | ||
``` | ||
Assign roles | ||
Select address for Seller: | ||
1) Bob - 0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD | ||
Enter number | ||
> 1 | ||
``` | ||
``` | ||
Define parameters | ||
Enter digest | ||
> 0x07887c5873ad098e96297f041eb0736ed50d33cf7010f1786f63cddf3b0b8b20 | ||
Enter price | ||
> 1000 | ||
``` | ||
``` | ||
Max initial block [ Current block number is 350 ] | ||
> 500 | ||
``` | ||
One line command for other participants to generate the same agreement: | ||
``` | ||
./glow start-interaction --agreement '{"glow-version":"Glow v0.0-894-g575c859","interaction":"mukn/glow/examples/buy_sig#payForSignature","participants":{"Buyer":"0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1","Seller":"0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD"},"parameters":{"digest":"0x07887c5873ad098e96297f041eb0736ed50d33cf7010f1786f63cddf3b0b8b20","price":"0x3e8"},"reference":{},"options":{"blockchain":"Private Ethereum Testnet","timeoutInBlocks":"0x1f4","maxInitialBlock":"0x1f4"},"code-digest":"0x16c5659f6e3c70f0c53ac5abf3977e658093f1f5880bd478de8d3a87c92d9607"}' | ||
``` | ||
|
||
#### Setting up Bob’s Interaction | ||
Bob’s interaction does not require as many steps since the agreement contains all of the parameters already. He just needs to specify which identity and role he is going to use in the interaction. Note also the database option that was appended to separate Bob’s database from Alice’s, when running both participants on the same machine. | ||
|
||
``` | ||
glow start-interaction --agreement '{"glow-version":"Glow v0.0-894-g575c859","interaction":"mukn/glow/examples/buy_sig#payForSignature","participants":{"Buyer":"0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1","Seller":"0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD"},"parameters":{"digest":"0x07887c5873ad098e96297f041eb0736ed50d33cf7010f1786f63cddf3b0b8b20","price":"0x3e8"},"reference":{},"options":{"blockchain":"Private Ethereum Testnet","timeoutInBlocks":"0x1f4","maxInitialBlock":"0x1f4"},"code-digest":"0x16c5659f6e3c70f0c53ac5abf3977e658093f1f5880bd478de8d3a87c92d9607"}' --evm-network pet --database run/B | ||
``` | ||
``` | ||
Choose your identity: | ||
1) Bob - 0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD | ||
Enter number | ||
> 1 | ||
``` | ||
``` | ||
Choose your role: | ||
1) Buyer | ||
2) Seller | ||
Enter number | ||
> 2 | ||
``` | ||
|
||
#### Starting Alice’s Interaction | ||
After setting up the interaction, the Glow runtime component will deploy an EVM smart contract to the configured network and generate a handshake to send to Bob. The handshake is for Bob to verify that the on-chain contract corresponds to everything that is specified in the agreement. | ||
|
||
Send the handshake below to the other participant: | ||
``` | ||
{"agreement":{"glow-version":"Glow v0.0-894-g575c859","interaction":"mukn/glow/examples/buy_sig#payForSignature","participants":{"Buyer":"0xa71CEb0990dD1f29C2a064c29392Fe66baf05aE1","Seller":"0xb0bb1ed229f5Ed588495AC9739eD1555f5c3aabD"},"parameters":{"digest":"0x07887c5873ad098e96297f041eb0736ed50d33cf7010f1786f63cddf3b0b8b20","price":"0x3e8"},"reference":{},"options":{"blockchain":"Private Ethereum Testnet","timeoutInBlocks":"0x1f4","maxInitialBlock":"0x1f4"},"code-digest":"0x16c5659f6e3c70f0c53ac5abf3977e658093f1f5880bd478de8d3a87c92d9607"},"contract-config":{"contract-address":"0x9533A6610DBd92fa5C9E46364b2b36b8D37C1874","code-hash":"0x30e92fcb774f9f205242dce3f112025f999f18c6d45971f4fc48ed8fa807c1d9","creation-hash":"0xb9a04dea24f5fee9b7cbb3f4446d124bc884e869195e9d91e975ad2e3bc2a30b","creation-block":"0x16de"},"published-data":"0x"} | ||
``` | ||
|
||
#### Running the Alicea and Bob Interaction | ||
All Bob has left to do is paste the handshake when prompted and the runtime will handle everything from there. First by generating a signature of the digest and then publishing it on-chain. Alice’s runtime will then watch the network for transactions against the contract to see Bob’s move, and both runtimes should run to completion without requiring any more user input. | ||
|
||
The last thing the runtime does is print all the variables that were bound during execution of the contract, with the signature being purchased highlighted for both participants. |
13 changes: 13 additions & 0 deletions
13
resources/content/articles/en/2021-02-25_09-00-00_support-and-help-en.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,13 @@ | ||
--- | ||
title: Support and help | ||
description: EVM resources | ||
order: 2 | ||
parent: 2021-02-25_11-00-00_resources | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
|
||
--- | ||
## Support and help | ||
|
||
Thank you for your interest in using EVM. If you are a developer and want to get involved, register your interest today via our short [Typeform](https://input-output.typeform.com/to/OJsf0XcD) survey and we will be in touch soon. Invites will be sent out in stages as we roll out the program. | ||
|
||
We encourage you to draw on community feedback and support as much as possible. |
7 changes: 7 additions & 0 deletions
7
resources/content/articles/en/2021-02-25_11-00-00_about-en.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,7 @@ | ||
--- | ||
title: About | ||
description: EVM | ||
parent: 2021-02-25_11-00-00_evm | ||
order: 2 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- |
11 changes: 11 additions & 0 deletions
11
resources/content/articles/en/2021-02-25_11-00-00_block-explorer-en.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,11 @@ | ||
--- | ||
title: Block explorer | ||
description: EVM getting started | ||
parent: 2021-02-25_11-00-00_getting-started | ||
order: 6 | ||
last_updated: "2020-12-17T09:00:00+01:00" | ||
|
||
--- | ||
## Block explorer | ||
|
||
The EVM devnet provides a link to the blockchain explorer. This is a useful tool that displays information about activity on the blockchain. The block explorer shows transaction history and other details, making it easy for users to find information about the cryptocurrency. Importantly, it shows the latest blocks in the chain as well as identifying the first block in the chain. |
16 changes: 16 additions & 0 deletions
16
resources/content/articles/en/2021-02-25_11-00-00_devnet-skill-set-en.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 @@ | ||
--- | ||
title: Devnet skill set | ||
description: EVM about | ||
parent: 2021-02-25_11-00-00_about | ||
order: 1 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
|
||
--- | ||
## Devnet skill set | ||
|
||
As in the case of the KEVM to use the EVM devnet the following skills are required: | ||
|
||
- Familiarity with writing smart contracts in Solidity. You will need a suite of well-defined smart contracts to use on the devnet. | ||
- Knowledge of the JSON remote procedure call (RPC) protocol. | ||
|
||
No registration is required to use the devnet. |
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 @@ | ||
--- | ||
title: EVM | ||
description: EVM section | ||
parent: 2020-05-04_07-00-00_virtual-machines | ||
order: 3 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- |
8 changes: 8 additions & 0 deletions
8
resources/content/articles/en/2021-02-25_11-00-00_explorer-en.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,8 @@ | ||
--- | ||
title: Explorer | ||
description: EVM tools | ||
parent: 2021-02-25_11-00-tools | ||
order: 2 | ||
last_updated: "2020-12-17T09:00:00+01:00" | ||
external_href: https://explorer-evm.portal.dev.cardano.org/ | ||
--- |
7 changes: 7 additions & 0 deletions
7
resources/content/articles/en/2021-02-25_11-00-00_getting-started-en.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,7 @@ | ||
--- | ||
title: Getting Started | ||
description: EVM | ||
parent: 2021-02-25_11-00-00_evm | ||
order: 3 | ||
last_updated: "2021-02-25T09:00:00+01:00" | ||
--- |
Oops, something went wrong.