Since announcing the project at the end of April at Sub0 (talk can be found here), we have been coding. We made the Moonbeam repo public and you can visit it here. We now have foundational elements in place including a Dockerized GitLab-based CI for automated builds that will help us ensure quality in the code we create. The Moonbeam repo includes a base runtime as well as an initial implementation of the endorsement system that we use to select collators for block production.
After we announced our project, Parity reached out to us to let us know about Frontier, a project that they are working on to build upon the EVM pallet and provide improved Substrate Ethereum support. We have agreed to join forces with Parity and work together on the same repo rather than pursuing independent efforts. You can find the Frontier repo here.
For the next few weeks we will focus on the implementation of Ethereum web3-compatible RPCs under Frontier and will be pulling this work into Moonbeam once it is complete. Web3 RPCs will allow Ethereum developer tools such as Truffle, Remix, and MetaMask to connect directly to a Moonbeam node.
We have added a Substrate node template to Frontier that can be used for demonstration purposes, which you can find here. It is currently limited in functionality and may break, as Frontier is still very much under active development. However, using this node template you can currently use Substrate RPC calls to interact with the underlying EVM.
In the screenshots below I am running the Frontier node template locally and using the standard polkadot.js apps to deploy an ERC20 contract based on the OpenZepplin ERC20 implementation. Note that the init parameter has the entire bytecode of the contract.
This test ERC20 contract mints the max supply to Alice’s EVM account. We can check her EVM account balance via Substrate chain state queries as shown below:
We can also call the transfer function on the contract via a Substrate extrinsic to move some of these tokens from Alice to Bob:
As a result of the transfer, Bob is the happy recipient of of 0xdd (221) tokens which we can look at the chain state to verify:
Using Substrate-based RPCs to interact directly with the EVM is not something that will be part of the final product, as we are bypassing security layers that, for example, check for signatures. These layers will be part of Pallet Ethereum under Frontier. However, this node template is a cool demonstration of the power of Substrate to quickly get to a running system that has a bunch of functionality and that can be iterated upon.
We will soon have enough of the web3 RPCs implemented to show some demonstrations of using Ethereum tools to interact with a Frontier-based node. Ultimately, we plan to use these components to allow users to interact with Moonbeam using either Substrate or Ethereum-based tools. This will result in a large amount of choice for developers so they can use the right tool for the job. More to come on this in the next update.
Are you interested in trying out Moonbeam? Join our new Riot room! We’d love to hear from you.
Enter your email below to receive these updates every month.