EtherWallet ETH私链搭建教程
发布于 10 个月前 作者 maiiz 1834 次浏览 来自 以太坊

1. 下载geth

ETH: https://geth.ethereum.org/downloads/ ETC: https://github.com/ethereumproject/go-ethereum/releases/

2. 创建genesis.json

{
   "config": {
        "chainId": 41,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
       },
   "alloc":{},
   "difficulty" : "0x200",
   "extraData"  : "0x74686520726f73657320696e206865722068616e642c2074686520666c61766f7220696e206d696e65",
   "gasLimit"   : "0x2fefd8",
   "nonce"      : "0x00000000c000ff59",
   "mixhash"    : "0x0000000000000000000000000000000000000000000000000000000000000000",
   "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
   "timestamp"  : "0x599DA33A"
 }
 
./geth --datadir "data" init genesis.json

3. 运行geth

./geth --identity "geth_testnet" --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --datadir "data" --networkid 888 console --maxpeers=0 --ipcpath $HOME/.ethereum/geth.ipc

4. 挖矿

> personal.newAccount()
Passphrase:
Repeat passphrase:
“0x471b3ebc93626cc5c09c469593b9985935680c70"

> miner.start()

5. 发送交易

> personal.unlockAccount(eth.coinbase)
Unlock account 0x20501d2e9e2222be82a4cb32ecf0f80535ae46f3
Passphrase:******
> eth.sendTransaction({from:eth.coinbase, to:"0xc604c337139da34a1e8e7a3ed8deb66332b2c130", value: web3.toWei(1.5, "ether")})
> miner.start()
>
> miner.stop()

6. EtherWallet 连接私链

EtherWallet MacOS下安装目录/Applications/Ethereum Wallet.app/Contents/MacOS

./Ethereum\ Wallet --rpc $HOME/.ethereum/geth.ipc

通过EtherWallet就可以进行交易、合约的测试

5 回复

remix 更简单,连配置都不用

@路人-戊 这个讲本地EtherWallet+私链,自己用Walllet就可以私链,转账,测试智能合约,Remix教程比较多,如果写智能合约用它比较方便。可以看发ERC20 Token那篇。

@路人-戊 没路人大神利害

回到顶部