Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 个月前 | ||
| 3 个月前 | ||
| 2 年前 | ||
| 5 天前 | ||
| 2 个月前 | ||
| 5 天前 | ||
| 5 个月前 | ||
| 2 个月前 | ||
| 6 年前 | ||
| 10 个月前 | ||
| 3 个月前 | ||
| 7 个月前 | ||
| 10 个月前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 6 个月前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 7 个月前 | ||
| 6 个月前 | ||
| 7 个月前 | ||
| 4 个月前 | ||
| 6 个月前 | ||
| 5 个月前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 个月前 | ||
| 6 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 10 个月前 | ||
| 1 个月前 | ||
| 3 个月前 | ||
| 2 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 1 个月前 | ||
| 19 天前 |
Remix Project
Remix Project
Remix Project 是一套丰富的工具集,其中包括全面的智能合约开发工具 Remix IDE。Remix Project 还包含 Remix 插件引擎和 Remix 库,这些都是可供广泛使用的底层工具。
Remix IDE
Remix IDE 可供不同知识水平的用户用于合约开发的整个流程。它支持快速开发周期,并配有一系列带有直观图形用户界面的插件。该 IDE 提供两种版本以及一个 VSCode 扩展:
Remix 在线 IDE,详见:https://remix.ethereum.org
👉 支持的浏览器:Firefox v100.0.1 和 Chrome v101.0.4951.64。不支持在平板电脑、智能手机或电话上使用 Remix。
Remix 桌面 IDE,详见发布版本:https://github.com/remix-project-org/remix-desktop/releases

Remix 库
Remix 库是 Remix IDE 原生插件的重要组成部分。欲了解更多关于库的信息,请参阅此处
离线使用
remix-live的gh-pages分支始终包含 Remix 的最新稳定版本构建。该分支中有一个包含完整构建内容的 ZIP 文件。下载此文件即可进行离线使用。
注意:此 ZIP 文件包含打包时支持的最新 Solidity 版本。其他编译器版本仅可在线使用。
安装设置
"engines": {
"node": "^20.0.0",
"npm": "^6.14.15"
}
- 全局安装 Nx CLI 以启用 nx 可执行命令的运行。
yarn global add nx
- 克隆 GitHub 仓库(需先安装
wget):
git clone https://github.com/remix-project-org/remix-project.git
- 构建并运行
remix-project:
- 进入项目目录:
cd remix-project - 安装依赖:
yarn install或直接运行yarn - 构建 Remix 库:
yarn run build:libs - 构建 Remix 项目:
yarn build - 构建并运行项目服务器:
yarn serve。也可选择运行yarn serve:hot以启用热模块重载,实现前端更新实时刷新。
在浏览器中打开 http://127.0.0.1:8080,即可本地加载 Remix IDE。
打开你的 text editor 开始开发。保存文件时,浏览器将自动刷新。
生产环境构建
为 remix-project 生成 React 生产环境构建版本。
yarn run build:production
构建产物可在 remix-project/dist/apps/remix-ide 目录中找到。
yarn run serve:production
生产构建将默认部署到 http://localhost:8080/ 或 http://127.0.0.1:8080/
Nx Cloud 缓存
本仓库使用 Nx Cloud 加速构建,并通过远程缓存确保 CI 的确定性。
- 配置:
nx.json使用 Nx Cloud 运行器,并从NX_CLOUD_ACCESS_TOKEN环境变量读取令牌。 - CI:当令牌存在时,CircleCI 作业会自动使用
--cloud;对于分支 PR(无密钥),则回退到仅本地缓存。构建日志存储在logs/nx-build.log下。 - 本地验证:运行相同的目标两次;第二次运行应显示“Nx read the output from the cache”。例如:
nx run remix-ide:build并再次运行。 - 洞察:访问 https://nx.app 查看缓存分析和运行详情(配置令牌后,链接会出现在 Nx 输出中)。
Docker:
前提条件:
- Docker (https://docs.docker.com/desktop/)
- Docker Compose (https://docs.docker.com/compose/install/)
使用 Docker 运行
如果您想运行已合并到 master 分支的最新更改,请运行:
docker pull remixproject/remix-ide:latest
docker run -p 8080:80 remixproject/remix-ide:latest
如果你想运行最新的 remix-live 版本,请执行。
docker pull remixproject/remix-ide:remix_live
docker run -p 8080:80 remixproject/remix-ide:remix_live
使用 docker-compose 运行:
若要在本地运行而不进行构建,您只需准备 docker-compose.yaml 文件,然后运行:
docker-compose pull
docker-compose up -d
然后访问 http://localhost:8080,即可使用你的 Remix 实例。
若要在不克隆此仓库的情况下获取 docker-compose 文件,请运行:
curl https://raw.githubusercontent.com/remix-project-org/remix-project/master/docker-compose.yaml > docker-compose.yaml
故障排除
如果在构建项目时遇到问题,请确保你安装了正确版本的 node、npm 和 nvm。同时,确保已全局安装 Nx CLI。
运行:
node --version
npm --version
nvm --version
在基于 Debian 的操作系统(如 Ubuntu 14.04LTS)中,你可能需要运行 apt-get install build-essential。安装 build-essential 后,运行 npm rebuild。
单元测试
使用库名称运行单元测试,例如:nx test <project-name>
例如,要运行 remix-analyzer 的单元测试,请使用 nx test remix-analyzer
浏览器测试
要通过 Nightwatch 运行测试:
- 首次安装 webdrivers:
yarn install_webdriver - 构建并运行 Remix:
yarn serve
注意:
-
ballot测试套件需要在本地运行ganache。 -
remixd测试套件需要在本地运行remixd。 -
gist测试套件需要在 .env 文件中指定 GitHub 访问令牌。
gist_token = <token> // token should have permission to create a gist
有一个脚本允许选择浏览器和运行特定测试:
yarn run select_test
你需要确保:
-
selenium 正在运行
-
IDE 正在运行
-
(可选)remixd 或 ganache 正在运行
使用分组拆分测试
可以使用分组将测试文件中的测试组合在一起。这样做的好处是,当你只想关注测试文件中的某一组特定测试时,可以避免运行整个冗长的测试文件。
这些分组仅适用于当前测试文件,而非所有测试文件。例如,ballot 中的 group1 与另一个测试文件中的 group1 没有关联。
运行一个分组时,只会执行标记为属于该分组的测试,以及测试文件中所有未标记分组的测试。这样,你可以设置一些在所有分组中都运行的测试,例如用于执行通用操作的测试。
无需按特定顺序为分组编号。分组的编号是任意的。
一个测试可以有多个分组标签,这意味着该测试会在不同的分组中运行。
你应该编写能够按分组执行且不依赖其他分组的测试。
要实现这一点,你需要:
- 为测试添加分组标签,格式为
#group后接数字:例如#group1、#group220、#group4。任何数字均可,无需按特定顺序设置。
'Should generate test file #group1': function (browser: NightwatchBrowser) {
browser.waitForElementPresent('*[data-id="verticalIconsKindfilePanel"]')
- 向你想要拆分的测试文件添加
@disabled: true:
module.exports = {
'@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done) // , 'http://localhost:8080', false)
},
- 修改 package JSON 以在本地运行所有组测试(根据环境指向相应的配置文件):
"nightwatch_local_debugger": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch-chrome.js dist/apps/remix-ide-e2e/src/tests/debugger_*.spec.js --env=chrome",
- 如果你想在本地运行测试文件,请运行构建脚本来构建这些测试文件
yarn run build:e2e
本地测试分组测试
你可以为任何测试标记组名,例如 #group10,并轻松在本地运行该测试。
- 确保你已全局安装 nx
- 分组测试的运行方式与其他测试相同,只需指定正确的组号
方法 1
此脚本将为你提供一个选项菜单,只需选择你想要的测试即可
yarn run select_test
在 CircleCI 中跨所有实例运行相同(不稳定的)测试
在 CircleCI 中,所有测试会分配到不同实例上并行运行。 你也可以在所有实例上同时运行一个或多个测试。 通过这种方式,可以轻松重启流水线来检查测试是否不稳定。
例如:
'Static Analysis run with remixd #group3 #flaky': function (browser) {
现在,本次测试的 group3 将在 firefox 和 chrome 中执行 80 次。 如果您在其他测试中标记了更多分组,它们也将被执行。
配置
在 .circleci/config.yml 中设置一个参数非常重要,将其设为 false 时,将运行常规测试。 将其设为 true 时,将仅运行标记为 flaky 的测试。
parameters:
run_flaky_tests:
type: boolean
default: true
重要链接
- 官方网站:https://remix.live
- 官方文档:https://remix-ide.readthedocs.io/en/latest/
- Remix 精选资源列表:https://github.com/remix-project-org/awesome-remix
- Substack:https://ethereumremix.substack.com
- 领英:https://www.linkedin.com/company/ethereum-remix
- X:https://x.com/ethereumremix
- 加入我们的 Discord:https://discord.gg/MzhfCGstNA
项目介绍
Remix 是一款基于浏览器的编译器和集成开发环境,它使用户能够利用 Solidity 语言构建以太坊智能合约并进行交易调试。【此简介由AI生成】