4. 使用 Ganache v7

通过 Ganache v7 创建本地区块链环境

Consensys 宣布终止与 Truffle 和 Ganache 的合作关系以及和 HardHat 新的合作关系,更多详情

1. 打开 Sandbox

注:以 GIthub 方式登录 ChainIDE 后才可使用 Sandbox 功能。

打开 Sandbox

2. 启动 Ganache

通过输入带参数的 ganache 来启动一条 terminal 之外的客户端也可以访问的本地链:

ganache -h 0.0.0.0

3. 端口转发

为了其他客户端可以通过链接访问到上图启动的 ganache,请参考 ChainIDE - 端口转发 转发 HTTP 8545 端口,并复制其地址 (例如:https://sandbox-1e82a87a951241179f98494a6dbb2617-ethereum-8545.uat-sandbox.chainide.com)。

这样你就成功的启动了一条 ganache 本地区块链。接下来可以通过 Metamask 连上该条链,或者通过 Truffle, Hrdhat 部署合约, chain id 为 1337。

相关链接

Last updated