測驗網簡介
目前Ethereum存在三個測驗網,分別是Ropsten(PoW演算法,支持Parity和Geth),Kovan(PoA演算法,Parity專用)和Rinkeby(Clique PoA共識演算法,Geth專用),
Ropsten
- PoW
- Supported by geth and parity
- Best reproduces the current production environment
- Chaindata size 15 GB - Apr 2018
Kovan
- PoA (Immune to spam attacks)
- Supported by parity only
- Chaindata size 13 GB - Apr 2018
Rinkeby
- PoA (Immune to spam attacks)
- Supported by geth only
- Chaindata size 6 GB - Apr 2018
Rinkeby
使用Geth加入Rinkeby測驗網的操作非常簡單,因為Geth內置了Rinkeby的配置引數,
首先我們創建一個目錄,用于存盤Geth的相關資料,示例:
mkdir ~/eth/rinkeby
cd ~/eth/rinkeby
#然后啟動Geth:
geth --datadir ~/eth/rinkeby/ --rinkeby
可以通過網站 https://rinkeby.etherscan.io/ 來查看目前測驗網的最新區塊,確認Geth已經同步到了最新的區塊,
參考資料:
https://rinkeby.etherscan.io/
https://ethereum.stackexchange.com/questions/27048/comparison-of-the-different-testnets
https://www.rinkeby.io/
Parity 兩個節點形成集群網路
我們使用此地址,讓node1與node0形成集群網路,命令如下(注意用node0的enode值替換enode://后的部分):
linux使用這段
curl --data '{"jsonrpc":"2.0","method":"parity_addReservedPeer","params":["enode://e7e8e2f38f7cd485f69ffdf1a60e14fb4f45ba5c7cbb1e9b4d034a1913d65cfd9c847f9765c35459f950bee5c579d4f8fb52abc59bc58c5365a11259a2a7ceaf@127.0.0.1:30300"],"id":0}' -H "Content-Type: application/json" -X POST localhost:8541
windows使用這段
curl.exe --data '{\"jsonrpc\":\"2.0\",\"method\":\"parity_addReservedPeer\",\"params\":[\"enode://e7e8e2f38f7cd485f69ffdf1a60e14fb4f45ba5c7cbb1e9b4d034a1913d65cfd9c847f9765c35459f950bee5c579d4f8fb52abc59bc58c5365a11259a2a7ceaf@127.0.0.1:30300\"],\"id\":0}' -H "Content-Type: application/json" -X POST localhost:8541
上面的命令如果執行成功,會回傳:
{"jsonrpc":"2.0","result":true,"id":0}
然后在node0和node1的終端中,就可以看到 1/25 peers 的輸出,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/245736.html
標籤:區塊鏈
