Skip to content

Cvrana/Tutorial-deposit-ETH-to-ICP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Here's a detailed README.md file for the project that outlines the steps, functionality, and how to run the DApp:

ETH to ICP ckETH DApp

This project demonstrates how to deposit Ethereum (ETH) from the Ethereum blockchain to the Internet Computer Protocol (ICP) using ckETH. It also includes a simple React-based frontend that allows users to deposit and withdraw ETH between Ethereum and ICP.

Table of Contents


Overview

This DApp allows users to:

  • Deposit ETH from Ethereum into the ICP ecosystem as ckETH
  • Withdraw ckETH from ICP back to Ethereum

The ckETH canister acts as a bridge between Ethereum and ICP, enabling interoperability between the two blockchains.


Prerequisites

Before running the project, ensure you have the following installed:

  • Node.js: Install Node.js
  • DFX SDK: Install DFX
  • MetaMask Wallet: For interacting with Ethereum
  • An Ethereum Wallet: With some test ETH (for the testnet)

Project Structure

eth_to_icp_cketh/ │ ├── cketh_dapp/ # ICP Project containing ckETH canister code │ ├── src/ │ ├── dfx.json # DFX configuration │ ├── README.md │ └── ... │ ├── eth-icp-dapp/ # React Frontend Project │ ├── src/ │ │ ├── components/ │ │ │ ├── Deposit.js # Deposit Component │ │ │ └── Withdraw.js # Withdraw Component │ │ ├── App.js # Main React App │ │ └── ... │ ├── package.json │ └── ... └── README.md # This README file


Setup and Installation

1. Setting Up ICP Environment

  1. Clone this repository:
    git clone https://github.com/username/eth-icp-dapp
    cd eth_to_icp_cketh/cketh_dapp
    
  2. Install DFX SDK and start the ICP local environment:

dfx start --background

  1. Deploy ckETH Canister:

dfx deploy

  1. Setting Up the Frontend

  2. Navigate to the frontend project:

cd ../eth-icp-dapp

  1. Install dependencies:

npm install


Running the Project

  1. Running the ICP Canisters

Make sure your local ICP environment is running:

cd cketh_dapp dfx start --background dfx deploy

  1. Running the React Frontend

In a separate terminal, start the React application:

cd eth-icp-dapp npm start

The application should be available at http://localhost:3000.


Using the DApp

  1. Deposit ETH to ICP

Connect your MetaMask wallet.

Enter the amount of ETH to deposit.

Click on the Deposit button.

  1. Withdraw ETH from ICP

Enter the amount of ckETH to withdraw.

Click on the Withdraw button.

Note: Make sure your wallet has enough ETH for gas fees when using the Ethereum network.


Connecting to Mainnet

  1. Update your dfx.json file with mainnet configurations.

  2. Update the ckethCanisterAddress in App.js with the deployed canister address on the mainnet.

To deploy to the mainnet, run:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published