008 以太坊钱包开发-切换到测试网络、正式网络

注册测试节点

官网:http://infura.io/

注册账号

进入注册页面,注册账号

登录账号,创建项目

登录到页面中,创建项目,就可以得到测试节点的链接。

切换到测试账号

修改 utils/web3helper.js 切换到测试节点

const Web3 = require('web3');

module.exports = {
    getWeb3(){
        const web3 = new Web3(Web3.givenProvider || "https://kovan.infura.io/v3/defa81f315d0472d88e8d242099524e2");
        return web3
    }
}

启动项目

$ cd myWallet
$ node index.js

访问 http://localhost:3000/transaction 查看项目:

源码下载

https://github.com/didianV5/web3EthWallet/tree/master/008_myWallet

关注我

你可能感兴趣的:(区块链,区块链学习笔记)