0

我尝试了 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 个具有不同“职责”的不同节点如何共存并与一个区块链一起运行吗?

4

1 回答 1

0

是的,这背后的原因是 Quorum 使用 7 节点分类帐和密钥路径 quorum-examples/examples/7nodes/keys。但是如果你看到 Quorum 的架构,请关注路径
1.quorum-examples/examples/7nodes/qdata/dd1 2.quorum
-examples/examples/7nodes/qdata/dd2

在上面的路径中有带有permissioned-nodes.json 的geth 节点。参见enode部分。这个encode是Peers encode ID,我们在以太坊中一般使用它来通过GETH链添加peer。
以太坊 geth 通过确定通道 ID 提供了通过 geth 创建私有节点的架构。

如果您从对等方中删除此编码,则将不存在 Genesis 的写入。

Quorum 使用 istanbul 算法来决定网络上的交易。这就是为什么 Quorum 团队使用第 7 个对等点,它们各自的编码共享。

希望你能明白我的意思。

于 2018-10-27T06:00:12.840 回答