diff --git a/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/auction.png b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/auction.png new file mode 100644 index 000000000..ccde64e05 Binary files /dev/null and b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/auction.png differ diff --git a/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/ballot.png b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/ballot.png new file mode 100644 index 000000000..22ae553c7 Binary files /dev/null and b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/ballot.png differ diff --git a/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/buy_sig.png b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/buy_sig.png new file mode 100644 index 000000000..537a9b00f Binary files /dev/null and b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/buy_sig.png differ diff --git a/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/coinflip.png b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/coinflip.png new file mode 100644 index 000000000..6e9a5d570 Binary files /dev/null and b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/coinflip.png differ diff --git a/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/deadmanswitch.png b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/deadmanswitch.png new file mode 100644 index 000000000..bc304e18f Binary files /dev/null and b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/deadmanswitch.png differ diff --git a/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/rps-min.png b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/rps-min.png new file mode 100644 index 000000000..f4920c2ce Binary files /dev/null and b/resources/content/articles/article-images/2021-02-03_07-00-00_learning-glow-by-example/rps-min.png differ diff --git a/resources/content/articles/en/2020-05-04_10-00-00_iele-en.md b/resources/content/articles/en/2020-05-04_10-00-00_iele-en.md index 63d92eb62..73875a276 100644 --- a/resources/content/articles/en/2020-05-04_10-00-00_iele-en.md +++ b/resources/content/articles/en/2020-05-04_10-00-00_iele-en.md @@ -2,6 +2,6 @@ title: IELE description: IELE section parent: 2020-05-04_07-00-00_virtual-machines -order: 3 +order: 4 last_updated: "2020-05-01T09:00:00+01:00" --- diff --git a/resources/content/articles/en/2020-11-25_09-00-00_overview-en.md b/resources/content/articles/en/2020-11-25_09-00-00_overview-en.md index 1c11984a0..69bdc7613 100644 --- a/resources/content/articles/en/2020-11-25_09-00-00_overview-en.md +++ b/resources/content/articles/en/2020-11-25_09-00-00_overview-en.md @@ -8,11 +8,11 @@ hasNoChildContent: true --- ## Overview -Glow is a new domain specific language (DSL) for developing decentralized applications (DApps) on blockchain. With Glow, you can write secure DApps and be assured that your smart contracts can run safely in an adversarial environment. Glow is the brainchild of [MuKn](https://mukn.io), a valued community partner within the Cardano ecosystem. +[Glow](https://glow-lang.org/) is a new domain specific language (DSL) for developing decentralized applications (DApps) on blockchain. With Glow, you can write secure DApps and be assured that your smart contracts can run safely in an adversarial environment. Glow is the brainchild of [MuKn](https://mukn.io), a valued community partner within the Cardano ecosystem. Glow is a language to develop not just a smart contract, but an entire DApp itself, which also includes client code and formal proofs. It is backed by formal methods that are intrinsically built into the language and its actual implementation. It is this inherent correctness of the language that means the code will perform as expected and the DApp will behave as users want (so users do not have their transactions blocked or their assets locked). Additionally, the Glow compiler generates matching client code, and a logical model of your DApp, so you can actually prove that it is correct prior to deploying it. From a single Glow specification, the compiler will generate matching code for both the DApp client and the smart contract itself. The runtime component tracks the code versions to ensure you are always using the correct, matching, and trusted versions of both the client and smart contract. Finally, since correctness is such a priority for DApps, Glow helps you specify a logical model of your DApp, so you can formally verify that it is indeed correct. -We are currently working on additional documentation to support our integration with Glow, and explain exactly how you can use and interact with this language. We’ll be expanding these pages over the weeks and months ahead; [take our short survey](https://input-output.typeform.com/c/OJsf0XcD) to be kept informed of all the latest updates. +Glow is the very latest addition to the suite of developer tools languages for Cardano. Here’s where to get started. We will be expanding the list of resources and documentation to support our integration with Glow over the weeks ahead. If you want to get involved, please join our dedicated devnets developer program by [taking our short survey](https://input-output.typeform.com/c/OJsf0XcD). diff --git a/resources/content/articles/en/2020-12-14_16-00-00_FAQ_kevm_iele-en.md b/resources/content/articles/en/2020-12-14_16-00-00_FAQ_virtual-machines-en.md similarity index 97% rename from resources/content/articles/en/2020-12-14_16-00-00_FAQ_kevm_iele-en.md rename to resources/content/articles/en/2020-12-14_16-00-00_FAQ_virtual-machines-en.md index 3c4564d7e..66794ab8c 100644 --- a/resources/content/articles/en/2020-12-14_16-00-00_FAQ_kevm_iele-en.md +++ b/resources/content/articles/en/2020-12-14_16-00-00_FAQ_virtual-machines-en.md @@ -1,13 +1,13 @@ --- -title: FAQs for KEVM and IELE -description: Frequently asked questions on KEVM -order: 4 +title: FAQs for Virtual Machines +description: Frequently asked questions on Virtual Machines +order: 5 external_href: "" parent: "2020-05-04_07-00-00_virtual-machines" -last_updated: "2020-12-15T11:30:00+01:00" +last_updated: "2021-02-25T11:30:00+01:00" --- -## FAQs for KEVM and IELE +## FAQs for Virtual Machines Note: At this point in time, we are restarting and accelerating the K Ethereum Virtual Machine (KEVM) program *only*. The IELE program will be coming very soon, but you can learn about IELE's features and benefits in this page. diff --git a/resources/content/articles/en/2021-02-03_07-00-00_getting-started-en.md b/resources/content/articles/en/2021-02-03_07-00-00_getting-started-en.md new file mode 100644 index 000000000..1e85f1665 --- /dev/null +++ b/resources/content/articles/en/2021-02-03_07-00-00_getting-started-en.md @@ -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" +--- diff --git a/resources/content/articles/en/2021-02-03_07-00-00_glow-tutorial-en.md b/resources/content/articles/en/2021-02-03_07-00-00_glow-tutorial-en.md new file mode 100644 index 000000000..2489fd9d9 --- /dev/null +++ b/resources/content/articles/en/2021-02-03_07-00-00_glow-tutorial-en.md @@ -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 diff --git a/resources/content/articles/en/2021-02-25_00-00-00_smart_contracts_architecture.md b/resources/content/articles/en/2021-02-25_00-00-00_smart_contracts_architecture.md new file mode 100644 index 000000000..fa4acdfd0 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_00-00-00_smart_contracts_architecture.md @@ -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. diff --git a/resources/content/articles/en/2021-02-25_07-00-00_glow-install-en.md b/resources/content/articles/en/2021-02-25_07-00-00_glow-install-en.md new file mode 100644 index 000000000..9300b7d64 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_07-00-00_glow-install-en.md @@ -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. diff --git a/resources/content/articles/en/2021-02-25_07-00-00_glow-test-network-en.md b/resources/content/articles/en/2021-02-25_07-00-00_glow-test-network-en.md new file mode 100644 index 000000000..4893057cc --- /dev/null +++ b/resources/content/articles/en/2021-02-25_07-00-00_glow-test-network-en.md @@ -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. diff --git a/resources/content/articles/en/2021-02-25_09-00-00_support-and-help-en.md b/resources/content/articles/en/2021-02-25_09-00-00_support-and-help-en.md new file mode 100644 index 000000000..31502824e --- /dev/null +++ b/resources/content/articles/en/2021-02-25_09-00-00_support-and-help-en.md @@ -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. diff --git a/resources/content/articles/en/2021-02-25_11-00-00_about-en.md b/resources/content/articles/en/2021-02-25_11-00-00_about-en.md new file mode 100644 index 000000000..fe5eb8caa --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_about-en.md @@ -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" +--- diff --git a/resources/content/articles/en/2021-02-25_11-00-00_block-explorer-en.md b/resources/content/articles/en/2021-02-25_11-00-00_block-explorer-en.md new file mode 100644 index 000000000..09f8f89ce --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_block-explorer-en.md @@ -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. diff --git a/resources/content/articles/en/2021-02-25_11-00-00_devnet-skill-set-en.md b/resources/content/articles/en/2021-02-25_11-00-00_devnet-skill-set-en.md new file mode 100644 index 000000000..e620d6eb1 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_devnet-skill-set-en.md @@ -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. diff --git a/resources/content/articles/en/2021-02-25_11-00-00_evm-en.md b/resources/content/articles/en/2021-02-25_11-00-00_evm-en.md new file mode 100644 index 000000000..39d4db20f --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_evm-en.md @@ -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" +--- diff --git a/resources/content/articles/en/2021-02-25_11-00-00_explorer-en.md b/resources/content/articles/en/2021-02-25_11-00-00_explorer-en.md new file mode 100644 index 000000000..3465c247e --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_explorer-en.md @@ -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/ +--- diff --git a/resources/content/articles/en/2021-02-25_11-00-00_getting-started-en.md b/resources/content/articles/en/2021-02-25_11-00-00_getting-started-en.md new file mode 100644 index 000000000..da9dea586 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_getting-started-en.md @@ -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" +--- diff --git a/resources/content/articles/en/2021-02-25_11-00-00_mallet-end-to-end-en.md b/resources/content/articles/en/2021-02-25_11-00-00_mallet-end-to-end-en.md new file mode 100644 index 000000000..94b2bc877 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_mallet-end-to-end-en.md @@ -0,0 +1,270 @@ +--- +title: Mallet end to end tutorial +description: EVM getting started +parent: 2021-02-25_11-00-00_getting-started +order: 5 +last_updated: "2021-02-25T09:00:00+01:00" + +--- + + +## Installation prerequisites + +- Linux and MacOS: Node.js 10.16.3 (recommended), Python (2.7), Curl, Make and Git. +- Windows: Install the same as above within the Windows Subsystem for Linux (WSL). + +Consult the official [nodejs](https://github.com/nodesource/distributions/blob/master/README.md) documentation for reference. + + +### Installing Node.js for Linux and MacOS + +Follow these steps to install Node.js in Linux and MacOS operating systems. + +**1. Open a terminal and execute:** + + curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash - + sudo apt-get -q install -y nodejs + + +**2. Verify Node.js is installed with:** + + node --version + + +**3. Install `nvm` (a version manager for node.js):** + + curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash + + +**4. Make the `nvm` command available in the current session:** + + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + + +**5. Verify that `nvm` is installed:** + + nvm --version + + 0.37.2 + +Note: Install Mallet only *after* verifying that `nvm` is installed *and* working. + + +### Installing Mallet 2.0 + +**1. Clone this [repo]() to get the latest version of Mallet, and then +install it with the `npm` command.** + + +**2. Clone the Mallet git repository** + +Open a terminal window and type: + + git clone https://github.com/input-output-hk/mallet + + +**3. Install specific node version for Mallet** + +After cloning the repository, execute: + + cd mallet + + cat .nvmrc + + 10.16.3 + +Then install the required node version: + + nvm install 10.16.3 + nvm use --silent + + +**4. Download and install Mallet and its dependencies:** + + npm install --silent + + +**5. Verify that Mallet was installed correctly** + +Check the integrity of the Mallet installation by using the `version` command: + + ./mallet --version + + 2.1.0 + +If the version number displays correctly, the installation was successful. + +## Create a HelloWorld smart contract + +To deploy your smart contracts on the EVM devnet and test Mallet, +you will need to compile the Solidity code to EVM bytecode. +You can compile the bytecode directly with using [solc](https://hub.docker.com/r/ethereum/solc). + +**1. Create a Solidity file** + +Create a `myContract.sol` file: + + cat << EOF >myContract.sol + // SPDX-License-Identifier: MIT + pragma solidity >=0.5.1 <0.9.0; + + + contract HelloWorld { + function helloWorld() external pure returns (string memory) { + return "Hello, World!"; + } + } + EOF + +**2. Compile with `solc`:** + +To compile with `solc`, you will need to use the Docker command. For this, first install the [Docker Engine](https://docs.docker.com/engine/install/), then run: + + docker run --rm -v $(pwd):/sources ethereum/solc:0.5.1 -o /sources --bin --abi /sources/myContract.sol + +**3. Verify that the compiled file exists:** + +If the file was correctly compiled, there should be a `.bin` file in your directory. + + ls *.bin + + HelloWorld.bin + +## Mallet 2.0 + +Mallet, the minimal wallet, is the command line interface (CLI) used to send +transactions, deploy smart contracts, and interact with the IELE and +EVM devnets. + +**1. Connect to the EVM devnet:** + + ./mallet evm -d ./data + + Mallet 2.1.0 - IELE/EVM devnet utility + Type 'help()' to view the online documentation or 'listCommands()' to view available commands + +This will open a session in the read-eval-print-loop (Repl) environment +for Node.js. Mallet commands are imported automatically. + +Everything typed in the Repl has to be valid JavaScript. Technically +speaking, the commands are simply functions and properties of Mallet +object. However, we tend to refer to them as *commands* because that +reflects how they are used. + +> Note: If you have problems installing any of the prerequisites (node or Mallet), +contact the community in Slack: +[Join IOHK | Devnets on Slack](https://join.slack.com/t/iohkdevnets/shared_invite/zt-jvy74l5h-Bhp5SQajefwjig72BIl73A) + +## Using the faucet + +**1. Create an account** + +Create an account to use this faucet by using this code: + + //execute inthe Mallet Repl + //mallet evm -d ./my_data/ + //mallet> .load ../test_smartcontract_deploy.js + + myAccount = newAccount() + +The `newAccount` command asks your password, and returns your new account +address. + +Note that we are assigning the return value of `newAccount` to a variable +named `myAccount` so we can refer to it later. + + +**2. Select an account** + +Activate the account we have just created by using this code: + + selectAccount(myAccount) + + '0x45402404f51909b640d03f361c742c38d34bb3e7' + + +**3. Verify the balance of your new account** + +Since the account has just been created, its balance should be 0. + + getBalance() + +If you don't give any argument, this will return the balance of the +selected account. + + +**4. Request tokens from the faucet with `requestFunds`:** + + requestFunds() + +Fund transfer might take a few minutes. + +You can now compile and deploy smart contracts as your account is created *and* funded. + + +**5. Check the new balance in the account:** + + getBalance() + + +**6. Bring the compiled smart contract into Mallet** + +Using the `HelloWorld.bin` created earlier you can import the smart contract into Mallet. + + +**7. Import the `fileSystem` module:** + + fs = require("fs"); + + +**8. Read the contents of the binary file:** + + myContract = "0x" + fs.readFileSync('HelloWorld.bin', 'utf8'); + + +## Deploying smart contracts + +Now that you have the bytecode from `solc`, the next step is simply to deploy it. + + +**1. Prepare the transaction to deploy the contract:** + + tx = { gas: 470000, data: myContract} + + +**2. Send a transaction with the smart contract:** + + deploymentHash = sendTransaction(tx) + +This will return the tx hash on which the contract was deployed to. + + +**3. View receipt** + +You can view transaction details with the following command: + + getReceipt(deploymentHash) + + +**4. Save your contract address** + +To save your contract address, create a variable that takes the return value of getReceipt(): + + myContractAddress = getReceipt(deploymentHash).contractAddress + + +### Test your smart contract + + web3.toAscii(web3.eth.call({to: myContractAddress, data: '0xc605f76c'})) + +The expected output should contain "Hello, World!". + + +**Getting help** + +The `help` command can be useful When running Mallet in the CLI. This command opens the **Readme file** in your default web browser: + + help() + +Alternatively, [Join IOHK | Devnets on Slack](https://join.slack.com/t/iohkdevnets/shared_invite/zt-jvy74l5h-Bhp5SQajefwjig72BIl73A) to obtain help from the community. diff --git a/resources/content/articles/en/2021-02-25_11-00-00_overview-en.md b/resources/content/articles/en/2021-02-25_11-00-00_overview-en.md new file mode 100644 index 000000000..23b71ba80 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_overview-en.md @@ -0,0 +1,15 @@ +--- +title: Overview +description: EVM overview +parent: 2021-02-25_11-00-00_evm +order: 1 +last_updated: "2021-02-25T11:30:00+01:00" +hasNoChildContent: true + +--- +## Overview +The Ethereum Virtual Machine (EVM) is a sandboxed virtual software stack, designed to enable the execution of smart contracts across a decentralized network of computers. It is embedded within every full Ethereum node, where every node on the network runs an instance, and thus reaches consensus. + +The EVM provides a runtime environment for smart contracts in Ethereum. Contracts will typically be written in a higher-level programming language, like Solidity, or in a DSL like [Glow](https://glow-lang.org/), and then compiled to low level EVM bytecode. + +By providing EVM support throughout our devnets programme, developers can write DApps in Solidity – Ethereum’s most popular smart contract language or Glow, as well as other EVM languages, and in time deploy these contracts on Cardano via sidechains. diff --git a/resources/content/articles/en/2021-02-25_11-00-00_resources-en.md b/resources/content/articles/en/2021-02-25_11-00-00_resources-en.md new file mode 100644 index 000000000..139123d76 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_resources-en.md @@ -0,0 +1,7 @@ +--- +title: Resources +description: EVM +parent: 2021-02-25_11-00-00_evm +order: 4 +last_updated: "2021-02-25T09:00:00+01:00" +--- diff --git a/resources/content/articles/en/2021-02-25_11-00-00_rpc-endpoints.md b/resources/content/articles/en/2021-02-25_11-00-00_rpc-endpoints.md new file mode 100644 index 000000000..f93113def --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_rpc-endpoints.md @@ -0,0 +1,37 @@ +--- +title: RPC Endpoints +description: RPC endpoints for KEVM +order: 0 +parent: 2021-02-25_11-00-00_resources +last_updated: "2020-12-22T09:00:00+01:00" +--- +## RPC Endpoints + +The following is a list of API calls that are supported. + +```json +eth_accounts +eth_blockNumber +eth_call +eth_estimateGas +eth_gasPrice +eth_getBalance +eth_getblockByHash +eth_getBlockByNumber +eth_getBlockTransactionCountByHash +eth_getBlockTransactionCountByNumber +eth_getTransactionReceipt +eth_getCode +eth_getLogs +eth_getStorageAt +eth_getTransactionByHash +eth_getTransactionCount +eth_getUncleCountByBlockHash +eth_getUncleCountByNumber +eth_getWork +eth_mining +eth_protocolVersion +eth_syncing +``` + +This list is not exclusive and additional calls or further changes may be made to extend this list. diff --git a/resources/content/articles/en/2021-02-25_11-00-00_using-the-evm-devnet-en.md b/resources/content/articles/en/2021-02-25_11-00-00_using-the-evm-devnet-en.md new file mode 100644 index 000000000..2b0d31536 --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-00_using-the-evm-devnet-en.md @@ -0,0 +1,11 @@ +--- +title: Using the EVM devnet +description: EVM getting started +parent: 2021-02-25_11-00-00_getting-started +order: 1 +last_updated: "2021-02-25T09:00:00+01:00" + +--- +## Using the EVM devnet + +To get up and running, you need to install Mallet and start compiling your smart contracts. Then you can start experimenting and identify any issues with your smart contracts. diff --git a/resources/content/articles/en/2021-02-25_11-00-tools-en.md b/resources/content/articles/en/2021-02-25_11-00-tools-en.md new file mode 100644 index 000000000..8a8d4097a --- /dev/null +++ b/resources/content/articles/en/2021-02-25_11-00-tools-en.md @@ -0,0 +1,7 @@ +--- +title: Tools +description: EVM +parent: 2021-02-25_11-00-00_evm +order: 5 +last_updated: "2021-02-25T09:00:00+01:00" +---