> For the complete documentation index, see [llms.txt](https://etherzero.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://etherzero.gitbook.io/doc/yi-tai-fang-dapp-ru-he-qian-yi-dao-yi-tai-ling-shang-yun-hang.md).

# 以太坊DApp如何迁移到以太零上运行

以太零在合约层与以太坊一致都使用了solidity,所以进行迁移的时候只需要对合约重新部署,且在页面上使用goetz实例化web3即可.

## GoETZ安装

GoETZ是以太零的浏览器钱包,相当于以太零的metamask.下面github网址下载最新版本的GoETZ，进行解压。然后打开浏览器的开发者模式，点击加载已解压的扩展程序，将GoETZ添加到浏览器的扩展程序中。

<https://github.com/etherzero-org/GoETZ/releases/download/GoETZ_v1.1.8/GoETZ-chrome-1.1.8.zip>

## **Remix在线开发**

Remix是一个开源的[Solidity](https://solidity.readthedocs.io/en/develop/)智能合约开发环境，提供基本的编译、部署至本地或测试网络、执行合约等功能。Solidity是以太零官方支持的开发语言，专门用于编写智能合约。<http://remix.etherzero.org> 是以太零的合约编译工具地址，Remix作为在线的开发环境，不需要安裝，可以直接在任何浏览器启动[Remix](http://remix.etherzero.org/)。网站第一次打开加载能容较多，需要耐心等待一段时间，之后打开会很快。

以太零的remix使用方法跟以太坊的一致,安装GoETZ后会自动获取GoETZ的web3对象.

## web3实例化

实例化web3是迁移的最后一步,在服务器端如果没有使用到power(发送高频交易相关),可以沿用以太坊的web3,只需要修改web3的provider为以太零的节点即可.如果需要用以太零的web3可以使用以下命令

```
npm i -S git+https://github.com/etherzero-org/web3.js.git
```

在浏览器端,由于GoETZ与metamask有所区别,要通过以下代码初始化web3

```
var web3 = new Web3(web3_etz.givenProvider);
```
