# Connext测试网路由设置 **Published by:** [alex-jack](https://paragraph.com/@lianwen/) **Published on:** 2022-06-04 **URL:** https://paragraph.com/@lianwen/connext ## Content 我自己在操作的时候,参考了几个文档和一位YOUTUBE播主的视频,但中间多少都出了些问题,导致启动报错。后来结合几个文档进行再次操作,成功启动。 一般测试网节点整体步骤都不是太难,基本都是一些细节出错导致最终无法启动成功。 一、准备工作: 1、新建一个新的以太坊测试地址,由于测试需要用到私钥,所以不要用钱包里有资金的地址,必须新建一个。我新建了地址:0x3504B34B3bD78F1F56062d5740fe70c489761E14 2、获取三个测试网(Rinkeby, Kovan, Goerli)的以太坊测试币,目前很多ETH测试网水龙头的失败,我在这里领的以太测试币,https://faucets.chain.link/ ,每次只能领0.1个ETH, 但足够我们使用了。必须Rinkeby, Kovan和Goerli三个测试网的测试币都要领。 3、到测试桥上的水龙头领三个测试网的测试币https://amarok-testnet.coinhippo.io Rinkeby, Kovan和Goerli三个测试网的测试币都必须领取。4、在https://infura.io/注册Infura账号,获取自己的测试网 RPC地址。复制这个PROJECT ID进行备份,过会需要使用这个ID,然后选择SAVE.5、在https://www.logdna.com/ 注册LogDNA账号,获取 key。官网地址进行了更改,回车后会跳转到下面地址。 https://www.logdna.com/ 表中填入个人信息,注册后复制备份KEY,稍后需要使用。二、安装Docker compose: https://docs.docker.com/engine/install/ubuntu/ 以上是官方文档,下面做了命令总结,直接按照命令操作即可,备注:所有操作都在root用户下,如中途因为一些原因退出客户端, 再次登录要切换到root用户,使用sudo su root命令切换到root用户。 1、更新apt包索引并安装包以允许apt通过 HTTPS 使用存储库,需要转到root用户 $ sudo su root $ sudo apt-get update $ sudo apt-get install ca-certificates curl gnupg lsb-release 2️、添加 Docker 的官方 GPG 密钥: $ sudo mkdir -p /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 3、更新设置存储库: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 4、更新apt包索引,安装最新版本的 Docker Engine、containerd 和 Docker Compose $ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin 5、克隆存储库: $ sudo apt-get install git curl -y $ git clone https://github.com/connext/nxtp-router-docker-compose.git $ cd nxtp-router-docker-compose/ $ git checkout amarok 6、环境设置: $ cp .env.example .env $ vim .env 1)修改.env文件中以下环境变量:ROUTER_VERSION路由版本去以下找最新版本的https://github.com/connext/nxtp/releases 注意ROUTER_VERSION=0.2.0-beta.0,0.2.0-beta.0这前面不能带V。LOGDNA_KEY是我们之前在https://www.logdna.com/ 设置备份的KEYGeneral configurationROUTER_VERSION=0.2.0-beta.0 ROUTER_EXTERNAL_PORT=8000 GRAFANA_EXTERNAL_PORT=3008 WEB3SIGNER_HTTP_LISTEN_PORT=9000 ################################################################################Monitoring configurationLOGDNA_KEY=5895d1476ffdedkkiieifnioka326 LOGDNA_TAG= DISCORD_WEBHOOK= 7、配置key.yaml文件,把privateKey改为自己的测试钱包私钥即可。 $ cp key.example.yaml key.yaml $ vim key.yaml type: "file-raw" keyType: "SECP256K1" privateKey: "你的测试钱包私钥" 8、配置config.json文件,直接新建一个config.json文件,把下面的内容复制到文本里面修改下粘贴到config.json文件里面。 以下文件只要修改“你的key”,上面在https://infura.io/注册的PROJECT ID就是你的KYE。 $ vim config.json { "logLevel": "debug", "sequencerUrl": "https://sequencer.testnet.connext.ninja", "web3SignerUrl": "http://signer:9000", "redis": { "host": "redis", "port": 6379 }, "server": { "adminToken": "abacusggg", "port": 8080 }, "chains": { "1111": { "assets": [ { "address": "0x3FFc03F05D1869f493c7dbf913E636C6280e0ff9", "name": "TEST" } ], "providers": [ "https://rinkeby.infura.io/v3/你的key", "https://rpc.ankr.com/eth_rinkeby" ] }, "2221": { "providers": [ "https://kovan.infura.io/v3/你的key" ], "assets": [ { "address": "0x3FFc03F05D1869f493c7dbf913E636C6280e0ff9", "name": "TEST" } ] }, "3331": { "providers": [ "https://goerli.infura.io/v3/你的key" ], "assets": [ { "address": "0x3FFc03F05D1869f493c7dbf913E636C6280e0ff9", "name": "TEST" } ] } } } 三.运行路由器: $ docker compose up -d 检查状态和日志等: $ docker ps -a 状态如下属于正常$ docker logs router 四、到 https://testnet.amarok.connextscan.io/router/你的测试ETH地址 把你刚才领的测试币进行授权,增加流动性。三个测试网 Rinkeby, Kovan, Goerli的测试代币LP都增加一遍。五、访问 http://你的服务器ip:3008 可以查看 Grafana 状态监控页面,默认用户名/密码 admin/admin。到此任务完成! 有疑问可以关注我推特: https://twitter.com/alex_jack8 ## Publication Information - [alex-jack](https://paragraph.com/@lianwen/): Publication homepage - [All Posts](https://paragraph.com/@lianwen/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@lianwen): Subscribe to updates - [Twitter](https://twitter.com/alex_jack8): Follow on Twitter