Skip to content

Latest commit

 

History

History
101 lines (64 loc) · 3.15 KB

README.md

File metadata and controls

101 lines (64 loc) · 3.15 KB

Warning

This is an Early Prototype. It works, but not (yet) intended for production use!!

ink! + MetaMask logo

The ethink!

This project is an experimental add-on to Polkadot SDK's pallet-contracts to make it Ethereum RPC -compatible.

Tip

In a nutshell, it allows your parachain users to call ink! smart contracts via MetaMask.

Quickstart

Run tests:

cargo test

Inject a well-known keypair of Baltathar into ethink! node's keystore:
(This step is needed only of you want to sign transactions on the node side)

cargo run -- key insert --dev --key-type "ethi" -d tmp --scheme ecdsa

Start the ethink! development node:

cargo run -- --dev

Open your MetaMask and add a new network:

Import a couple of pre-funded well-known development accounts into your MetaMask in order to be able to sign and send transactions.

Caution

It is highly recommended to use a separate MetaMask instance for this (e.g. in a dedicated browser profile), not to mix the development accounts (whose private keys are compromised by design) with your real money-holding accounts.

That's it! You should right away be able to communicate with the Duck 🦆 chain using your MetaMask. Let's see it in action, as described in the Demo section below.

End-to-end Tests

ethink! comes with e2e integration tests, grouped into test suites:

  • flipper: basic tests for the RPC methods;
  • erc20: ERC20 contract tests.
  • (more to be added later)

Use this command to run the integration tests (at the project root):

cargo test --test *

Documentation

rustdoc

Build documentation for the project crates:

cargo doc --document-private-items --open

The ethink! Book

The book is written with mdBook tool.
To install it, run:

cargo install mdbook

Then build and open the book:

cd docs/ethink-book
mdbook serve --open

Happy reading!

Demo 🧐

A comprehensive step-by-step Demo is described in the book chapter. You will be able to deploy an ink! contract to ethink-node and use the demo dApp via MetaMask. Go ahead and give it a try!

Useful Links

  • The table with all Ethereum RPC methods needed along with their description and implementation status.
  • Collection of curl composed request templates to Ethereum RPC exposed by ethink! node.