Quorum

為什麼 quoum 7 節點範例為每個節點創建創世塊

  • May 2, 2018

我嘗試了 Quorum 7 節點範例,它執行完美。但我發現./raft-init.sh正在為每個節點編寫執行創世塊。

程式碼 :

[*] Configuring node 1 (permissioned)
INFO [03-07|09:47:20] Maximum peer count                       ETH=25 LES=0 total=25
INFO [03-07|09:47:20] Allocated cache and file handles         database=/home/ronin/Desktop/testQuorum/quorum-examples/examples/7nodes/qdata/dd1/geth/chaindata cache=16 handles=16
INFO [03-07|09:47:20] Writing custom genesis block 
INFO [03-07|09:47:20] Persisted trie from memory database      nodes=0 size=0.00B time=2.896µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-07|09:47:20] Successfully wrote genesis state         database=chaindata                                                                               hash=c23b4e…8b1b71
INFO [03-07|09:47:20] Allocated cache and file handles         database=/home/ronin/Desktop/testQuorum/quorum-examples/examples/7nodes/qdata/dd1/geth/lightchaindata cache=16 handles=16
INFO [03-07|09:47:20] Writing custom genesis block 
INFO [03-07|09:47:20] Persisted trie from memory database      nodes=0 size=0.00B time=2.534µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-07|09:47:20] Successfully wrote genesis state         database=lightchaindata                                                                               hash=c23b4e…8b1b71
[*] Configuring node 2 (permissioned)
INFO [03-07|09:47:20] Maximum peer count                       ETH=25 LES=0 total=25
INFO [03-07|09:47:20] Allocated cache and file handles         database=/home/ronin/Desktop/testQuorum/quorum-examples/examples/7nodes/qdata/dd2/geth/chaindata cache=16 handles=16
INFO [03-07|09:47:21] Writing custom genesis block 
INFO [03-07|09:47:21] Persisted trie from memory database      nodes=0 size=0.00B time=5.99µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-07|09:47:21] Successfully wrote genesis state         database=chaindata                                                                               hash=c23b4e…8b1b71
INFO [03-07|09:47:21] Allocated cache and file handles         database=/home/ronin/Desktop/testQuorum/quorum-examples/examples/7nodes/qdata/dd2/geth/lightchaindata cache=16 handles=16
INFO [03-07|09:47:21] Writing custom genesis block 
INFO [03-07|09:47:21] Persisted trie from memory database      nodes=0 size=0.00B time=5.137µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-07|09:47:21] Successfully wrote genesis state         database=lightchaindata                                                                               hash=c23b4e…8b1b71
[*] Configuring node 3 (permissioned)
INFO [03-07|09:47:21] Maximum peer count                       ETH=25 LES=0 total=25
INFO [03-07|09:47:21] Allocated cache and file handles         database=/home/ronin/Desktop/testQuorum/quorum-examples/examples/7nodes/qdata/dd3/geth/chaindata cache=16 handles=16
INFO [03-07|09:47:21] Writing custom genesis block 
INFO [03-07|09:47:21] Persisted trie from memory database      nodes=0 size=0.00B time=1.706µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-07|09:47:21] Successfully wrote genesis state         database=chaindata                                                                               hash=c23b4e…8b1b71
INFO [03-07|09:47:21] Allocated cache and file handles         database=/home/ronin/Desktop/testQuorum/quorum-examples/examples/7nodes/qdata/dd3/geth/lightchaindata cache=16 handles=16
INFO [03-07|09:47:21] Writing custom genesis block 
INFO [03-07|09:47:21] Persisted trie from memory database      nodes=0 size=0.00B time=2.491µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-07|09:47:21] Successfully wrote genesis state         database=lightchaindata                                                                               hash=c23b4e…8b1b71

如您所見Writing genesis block,正在為每個節點完成。那麼每個節點都有自己的區塊鏈嗎?7 個節點的例子不是應該展示 7 個具有不同“職責”的不同節點如何共存並與一個區塊鏈一起執行嗎?

geth --datadir qdata/dd1 init genesis.json
geth --datadir qdata/dd2 init genesis.json
geth --datadir qdata/dd3 init genesis.json

等等…..

這是它用來初始化的同一個創世文件。它沒有不同,因此沒有不同的區塊鏈。

如果 1. 你在同一個鏈上。你有相同的網路 ID 2.你的創世塊是完全一樣的並且你是與其他具有這個網路 ID 的節點的對等點

引用自:https://ethereum.stackexchange.com/questions/41986