Giter Club home page Giter Club logo

dfinity / icp-eth-starter Goto Github PK

View Code? Open in Web Editor NEW
34.0 5.0 14.0 1.96 MB

An advanced starter project for interacting with Ethereum on the Internet Computer (Beta)

Home Page: https://xm3ir-rqaaa-aaaap-abhqq-cai.icp0.io/

License: Apache License 2.0

Shell 0.07% Motoko 37.98% JavaScript 0.41% Rust 8.99% TypeScript 50.77% HTML 1.35% SCSS 0.41%
cross-chain dfinity ethereum example internet-computer motoko nft react rust starter-project

icp-eth-starter's Introduction

ICP ๐Ÿ”— Ethereum (Beta)

Interact with the Ethereum blockchain from the Internet Computer.


Designed for experienced Web3 developers, this starter project uses an IC canister to verify the ownership of Ethereum NFTs, with support for both the Sepolia and Goerli testnets in addition to the Ethereum mainnet.

This repository is in early beta testing; please feel free to open an issue to report a bug or request a feature. Thanks!

Note: this starter project is currently undergoing an internal security review. This message will be removed once the review process is complete.

๐ŸŽฌ Create a New Project

Make sure that Node.js >= 16, dfx >= 0.14, and the latest version of Rust are installed on your system.

Set up Rust canister development with the following command:

rustup target add wasm32-unknown-unknown

Run the following commands in a new, empty project directory:

npx degit dfinity/ic-eth-starter # Download this starter project
dfx start --clean --background # Run dfx in the background
npm run setup # Install packages, deploy canisters, and generate type bindings

npm start # Start the development server

When ready, run dfx deploy --network ic to deploy your application to the Internet Computer.

๐Ÿ”Œ Prepare a Testnet Wallet

Here is one way to acquire tokens and NFTs on the Sepolia testnet:

  • Install MetaMask and create a new wallet for testing purposes
  • Fund your wallet using the Sepolia Faucet (requires signing up for an Alchemy account)
  • Navigate to MetaMask's E2E Test Dapp
    • Connect your wallet
    • In your MetaMask extension, change the network from "Ethereum Mainnet" to "Sepolia" (visual guide)
    • Scroll down to the "NFTs" section
    • Press "Deploy" and then "Mint" (may take a few seconds)
    • Press "Watch all NFTs" and in the MetaMask prompt, click the link with text "Test Dapp NFTs #1"
    • In the bottom-right of the page (under "TokenID"), press "#1" to view your newly minted NFT
    • Copy / paste the URL into the ICP ๐Ÿ”— Ethereum demo project to verify that you are the owner of the NFT.

๐Ÿ› ๏ธ Technology Stack

Front-end Webapp:

  • TypeScript: JavaScript extended with syntax for types
  • Vite: high-performance tooling for front-end web development
  • React: a component-based UI library
  • Tailwind: a highly expressive, utility-first CSS framework
  • Prettier: code formatting for a wide range of supported languages

Back-end Canister:

  • Motoko: a safe and simple programming language for the Internet Computer
  • Mops: an on-chain community package manager for Motoko
  • mo-dev: a live reload development server for Motoko

Ethereum Integration:

  • Rust: a secure, high-performance canister programming language
  • ethers-core: a popular Rust library for working with Ethereum data structures
  • MetaMask: a wallet and browser extension for interacting with Ethereum dapps

๐Ÿ“š Documentation

๐Ÿ’ก Tips and Tricks

  • Customize your project's code style by editing the .prettierrc file and then running npm run format.
  • Reduce the latency of update calls by passing the --emulator flag to dfx start.
  • Install a Motoko package by running npx ic-mops add <package-name>. Here is a list of available packages.
  • Split your frontend and backend console output by running npm run frontend and npm run backend in separate terminals.

Contributions are welcome! Please check out the contributor guidelines for more information.

icp-eth-starter's People

Contributors

dependabot[bot] avatar matthewhammer avatar rvanasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

icp-eth-starter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.