> For the complete documentation index, see [llms.txt](https://docs.emc.network/emc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emc.network/emc/zhong-wen/openverse/emc-requester.md).

# EMC-Requester

欢迎来到新的 [Edge Matrix Requester](https://57hlm-riaaa-aaaap-qbhfa-cai.icp0.io/#/info) 项目和 internet computer 开发社区。默认情况下，创建新项目会将此 README 文件和一些模板文件添加到项目目录中。您可以编辑这些模板文件，以定制您的项目并加入您自己的代码，以加快开发周期。

开始之前，您可能希望探索项目的目录结构和默认配置文件。在您的开发环境中使用此项目不会影响任何生产部署或身份令牌。

在开始使用Edge Matrix Requester之前，您可以查阅在线提供的以下文档来了解更多信息：

* [Quick Start](https://internetcomputer.org/docs/current/developer-docs/quickstart/hello10mins)
* [SDK Developer Tools](https://internetcomputer.org/docs/current/developer-docs/build/install-upgrade-remove)
* [Motoko Programming Language Guide](https://internetcomputer.org/docs/current/developer-docs/build/cdks/motoko-dfinity/motoko/)
* [Motoko Language Quick Reference](https://internetcomputer.org/docs/current/references/motoko-ref/)
* [JavaScript API Reference](https://erxue-5aaaa-aaaab-qaagq-cai.raw.icp0.io/)

如果您想立即开始进行项目开发，您可能想尝试以下命令：

```
cd Edge Matrix Requester/
dfx help
dfx canister --help
```

###

### 运行项目本地测试&#x20;

如果您想在本地测试项目，可以使用以下命令：

```
# Starts the replica, running in the background
dfx start --background

# Deploys your canisters to the replica and generates your candid interface
dfx deploy
```

完成工作后，您的应用程序将在以下地址可用：

`http://localhost:4943?canisterId={asset_canister_id}`&#x20;

如果您对后端 canister 进行了更改，您可以随时使用以下命令生成新的 candid 接口：&#x20;

```
npm run generate 
```

这在启动前端开发服务器之前是推荐的，并且会在您运行 `dfx deploy` 时自动运行。&#x20;

如果您正在进行前端更改，可以使用以下命令启动开发服务器：&#x20;

```
npm start
```

这将在 `http://localhost:8080` 启动一个服务器，并将 API 请求代理到端口 4943 上的副本。&#x20;

### 关于前端环境变量的注意事项&#x20;

如果您在不使用 DFX 的情况下托管前端代码，您可能需要进行以下调整，以确保您的项目在生产中不会获取根密钥：&#x20;

* 如果您使用 Webpack，请将 `setDFX_NETWORK` 设置为 `ic`&#x20;
* 使用您自己喜欢的方法替换自动生成的声明中的 `process.env.DFX_NETWORK` 在 `dfx.json` 中将 `canisters -> {asset_canister_id} -> declarations -> env_override` 设置为字符串，将替换自动生成的声明中的 `process.env.DFX_NETWORK` 为该字符串&#x20;
* 编写您自己的 `createActor` 构造函数
