You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rust/evm_block_explorer/README.md
+26-16Lines changed: 26 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,23 @@
4
4
5
5
## Overview
6
6
7
-
The EVM Block Explorer example demonstrates how an ICP smart contract can obtain information directly from other blockchain networks. Using HTTPS outcalls, smart contracts on ICP can interact with other networks without needing to go through a third-party service such as a bridge or an oracle. Supported interactions with other chains include querying network data, signing transactions, and submitting transactions directly to other networks.
8
-
In this example, you'll also see how to sign transactions with canister ECDSA or Schnorr signatures.
7
+
The EVM Block Explorer example demonstrates how an ICP canister can fetch block data directly from Ethereum and other EVM-compatible chains. Using HTTPS outcalls via the [EVM RPC canister](https://github.com/dfinity/evm-rpc-canister), canisters on ICP can read on-chain data without a bridge or oracle. The same pattern applies to any EVM-compatible chain supported by the EVM RPC canister.
9
8
9
+
<!--
10
10
## Deploying from ICP Ninja
11
11
12
-
This example can be deployed directly from [ICP Ninja](https://icp.ninja), a browser-based IDE for ICP. To continue developing locally after deploying from ICP Ninja, see [BUILD.md](BUILD.md).
12
+
This example can be deployed directly from [ICP Ninja](https://icp.ninja), a browser-based IDE for ICP.
13
13
14
14
[](https://icp.ninja/i?g=https://github.com/dfinity/examples/rust/evm_block_explorer)
15
-
16
-
> **Note:** ICP Ninja currently uses `dfx` under the hood, which is why this example includes a `dfx.json` configuration file. `dfx` is the legacy CLI, being superseded by [icp-cli](https://cli.icp.build), which is what developers should use for local development.
Start the local network, deploy all canisters (including the local EVM RPC canister), and run the tests:
37
37
38
38
```bash
39
39
icp network start -d
40
+
icp deploy
41
+
bash test.sh
42
+
icp network stop
40
43
```
41
44
42
-
Deploy the canisters:
45
+
To start a frontend dev server with hot reload during frontend development:
43
46
44
47
```bash
45
-
icp deploy
48
+
npm run dev --prefix frontend
46
49
```
47
50
48
-
Stop the local network when done:
51
+
### Deploying on ICP mainnet
52
+
53
+
On mainnet, the `evm_rpc` canister is already deployed at `7hfb6-caaaa-aaaar-qadga-cai`. Deploy only the backend and frontend — icp-cli injects the correct canister ID via the `ic` environment configuration in `icp.yaml`:
49
54
50
55
```bash
51
-
icp network stop
56
+
icp deploy -e ic
52
57
```
53
58
54
59
## Updating the Candid interface
@@ -58,10 +63,15 @@ The `backend/backend.did` file defines the backend canister's public interface.
58
63
If you modify the backend's public API, rebuild the canister and regenerate the `.did` file:
The example uses [PublicNode](https://ethereum-rpc.publicnode.com) by default — a free, no-registration provider that works out of the box locally and on mainnet. This is sufficient for getting started and automated testing.
72
+
73
+
For production deployments requiring premium providers (Alchemy, Ankr, BlockPi), refer to the [EVM RPC canister documentation](https://github.com/dfinity/evm-rpc-canister) for how to configure API keys. Once configured, change `RpcServices::EthMainnet(Some(vec![EthMainnetService::PublicNode]))` in `backend/src/lib.rs` to `RpcServices::EthMainnet(None)` to use all configured providers for better consensus.
74
+
65
75
## Security considerations and best practices
66
76
67
-
If you base your application on this example, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/building-apps/security/overview) for developing on ICP. This example may not implement all the best practices.
77
+
If you base your application on this example, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://docs.internetcomputer.org/guides/security/overview) for developing on ICP. This example may not implement all the best practices.
0 commit comments