remix共享本地文件夹教程

1、安装remixd

npm install -g @remix-project/remixd

备注:如果未按照node和npm,需要先安装node环境。


npm install -g @remix-project/remixd
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
/usr/local/bin/remixd -> /usr/local/lib/node_modules/@remix-project/remixd/bin/remixd.js

> fsevents@1.2.13 install /usr/local/lib/node_modules/@remix-project/remixd/node_modules/fsevents
> node install.js

SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
+ @remix-project/remixd@0.4.1
added 190 packages from 138 contributors in 207.421s


╭────────────────────────────────────────────────────────────────╮
│ │
│ New major version of npm available! 6.14.13 → 7.18.1 │
│ Changelog: https://github.com/npm/cli/releases/tag/v7.18.1 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯

2、开启remixd共享服务

remixd -s /Users/evan/code/solidity --remix-ide https://remix.ethereum.org

备注:-s 后参数指定成本地合约代码的目录

[INFO] you are using the latest version 0.4.1
[WARN] You may now only use IDE at https://remix.ethereum.org to connect to that instance
[WARN] Any application that runs on your computer can potentially read from and write to all files in the directory.
[WARN] Symbolic links are not forwarded to Remix IDE

[INFO] Thu Jun 24 2021 17:12:24 GMT+0800 (中国标准时间) remixd is listening on 127.0.0.1:65520
setup notifications for /Users/oker/code/local

3、remix开启插件 Remixd

image

4、remix workspaces切换到localhost

 

image

5、remix上查看本地文件

上一步点击Connect后,就可以在localhost看到第2步指定目录(/Users/evan/code/solidity)下的文件了,如下图:


image

原文地址:https://www.cnblogs.com/zccst/p/14927519.html