Please visit our website at zondax.ch
This project aims to enhance the interoperability of Internet Computer Protocol (ICP) with EVM-compatible platforms.
- Counter Canister: A simple Rust-based canister that demonstrates basic functionality.
- Logger Canister: A Rust-based canister implementing ICRC-3 compatible logging.
- EVM Adapter Proxy: A Go-based service that:
- Translates ICRC-3 log data into EVM-compatible formats.
- Exposes EVM RPC compatible methods for interaction with ICP canisters.
- SubQuery Indexer: Indexes and provides queryable access to the translated EVM-compatible data.
- DFINITY Canister SDK
- Docker and Docker Compose
- Node.js (version 16 or later)
- Go (version 1.22 or later)
- Rust (latest stable version)
-
Clone the repository:
git clone https://github.com/your-username/icp-evm-proxy.git cd icp-evm-proxy
-
Deploy Logger Canister:
cd canisters/logger_canister dfx deploy --network=<chosen_icp_network>
Note down the deployed canister ID.
-
Configure Counter Canister: Edit
canisters/counter_canister/src/lib.rs
and update theLOGGER_CANISTER_ID
constant with the ID obtained in the previous step. -
Deploy Counter Canister:
cd ../counter_canister dfx deploy --network=<chosen_icp_network>
-
Configure and deploy EVM Adapter Proxy:
cd ../../evm-adapter-proxy
Edit
config.yaml
and update the ICP configuration with the deployed canister IDs.make run
-
Configure and run SubQuery Indexer:
cd ../subq-indexer
Edit
project.yaml
and update the URL of the deployed EVM Adapter Proxy.npm install npm run codegen npm run build docker-compose up
- Interact with the Counter Canister to generate log entries.
- The Logger Canister automatically records these interactions in ICRC-3 format.
- The EVM Adapter Proxy translates ICRC-3 logs to EVM-compatible formats and exposes EVM RPC methods.
- Query the translated data using one of the following methods:
a. Use the SubQuery Indexer's GraphQL endpoint (typically at
http://localhost:3000
) to execute GraphQL queries. b. Directly query the PostgreSQL database.
To stop all services:
dfx stop # Stops local canisters
docker-compose down # Stops indexer and database
To clean up build artifacts and Docker volumes:
dfx clean
docker-compose down -v