给Remix升个级 | 联盟链开发(十)

Remix 是我们开发 Solidity 智能合约的常用工具,有时候我们会直接访问在线版的 Remix-IDE。

https://remix.ethereum.org/

但是,在线 Remix-IDE 有个问题,无法加载本地文件夹,这就会带来很多不便。

好在 Remix 有一个贴心之处 —— 我们可以让在线 Remix-IDE 连接我们本地的 Remix 后端,这个后端被称之为 Remixd,这样我们就能直接在 Remix-IDE 里加载本地文件夹了。

Remixd 的安装使用步骤如下:

1)通过 npm 或者 yarn 安装 Remixd

npm 命令:

npm install remixd -g

yarn 命令:

yarn install -g remixd

2)一条命令启动 Remix-IDE

remixd -s [path/ur/solidity/files] --remix-ide https://remix.ethereum.org

3)在 Remix-IDE 上点两下

一个点 Solidity,选择相应环境;另一个点 Connect to Localhost,连接本地环境。

好了,现在我们就能在 Remix 里使用本地的合约啦: