Transactions

使用仲裁時發件人無效

  • February 2, 2022

我按照本教程(https://github.com/jpmorganchase/quorum/wiki/From-Scratch)使用伊斯坦布爾共識啟動了具有 4 個節點的 Quorum。節點可以連接並且正在生成塊,但我無法添加交易,因為對於我想要添加的任何類型的交易(例如新合約創建或乙太幣轉移),我總是收到“錯誤:無效發件人未定義”。

例如,如果我“geth attach new-node-2/geth.ipc”到我的第二個節點並解鎖它的主帳戶,這樣

> personal.listWallets
[{
   accounts: [{
       address: "0x5449199af0e2c3d59b35ebabb926a2dae6e2fba4",
       url: "keystore:///home/.../Node2/new-node-2/keystore/UTC--2019-03-29T15-24-11.813787559Z--5449199af0e2c3d59b35ebabb926a2dae6e2fba4"
   }],
   status: "Unlocked",
   url: "keystore:///home/.../Node2/new-node-2/keystore/UTC--2019-03-29T15-24-11.813787559Z--5449199af0e2c3d59b35ebabb926a2dae6e2fba4"
}]

我執行任何事務,然後我得到一個像這樣的錯誤:

> eth.sendTransaction({from: '0x5449199af0e2c3d59b35ebabb926a2dae6e2fba4', to: '0x952e0ce2a4bf5e9dbbd5e186b03f760fa25d3278', value: web3.toWei(1, "ether")})
Error: invalid sender
   at web3.js:3143:20
   at web3.js:6347:15
   at web3.js:5081:36
   at <anonymous>:1:1

請注意,我的文件已安排:

.../Node2$ ls
genesis.json  new-node-2  node.log  nohup.out

.../Node2$ ls new-node-2/
geth
geth.ipc
keystore
nodekey
permissioned-nodes.json
static-nodes.json

.../Node2$ ls new-node-2/keystore
UTC--2019-03-29T15-24-11.813787559Z--5449199af0e2c3d59b35ebabb926a2dae6e2fba4

雖然所有節點共享相同的 genesis.json、permissioned-nodes.json 和 static-nodes.json 文件。genesis.json 文件是:

{
   "config": {
       "chainId": 20,
       "eip150Block": 1,
       "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
       "eip155Block": 1,
       "eip158Block": 1,
       "byzantiumBlock": 1,
       "istanbul": {
           "epoch": 30000,
           "policy": 0
       },
       "isQuorum": true
   },
   "nonce": "0x0",
   "timestamp": "0x5c9e3793",
   "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000f89af854947f2fb27d5bf950b3845e6a83161afcae1cf0823e94d7427ce2ebdbfbcf9a80c628df51af118faea25894965d1690307a389e5ac9c3a2abc6972786e01f8194d2209c0a0549cf4458764bf11433a6fe4054c730b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0",
   "gasLimit": "0xe0000000",
   "difficulty": "0x1",
   "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
   "coinbase": "0x0000000000000000000000000000000000000000",
   "alloc": {
       "7f2fb27d5bf950b3845e6a83161afcae1cf0823e": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "965d1690307a389e5ac9c3a2abc6972786e01f81": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "d2209c0a0549cf4458764bf11433a6fe4054c730": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "d7427ce2ebdbfbcf9a80c628df51af118faea258": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "6f42aa5c4b9ca57d264395f4eaa8b653bb83047e": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "5449199af0e2c3d59b35ebabb926a2dae6e2fba4": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "5449199af0e2c3d59b35ebabb926a2dae6e2fba4": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       },
       "6aa89d734ea689c05baa5833459e768dfb6cb54d": {
           "balance": "0x446c3b15f9926687d2c40534fdb564000000000000"
       }
   },
   "number": "0x0",
   "gasUsed": "0x0",
   "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

並且所有節點都在同一個網路上,即以下適用於所有節點:

> admin.nodeInfo.protocols.istanbul.network
20

請注意,我通過分析 Quorum 7 節點範例並意識到創世文件的配置部分需要具有

"eip150Block": 2,
      "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "eip155Block": 0,
      "eip158Block": 3,
      "byzantiumBlock": 1,
      "istanbul": {
          "epoch": 30000,
          "policy": 0
      },
      "isQuorum": true

但伊斯坦布爾設置會生成不同的數字。請注意,我不確定哪個參數不允許我添加事務,但它是上述參數之一。可以在此處跟踪此問題:https ://github.com/jpmorganchase/quorum/issues/670

istanbul-tools 是乙太坊的通用工具,因此它不會生成特定於 quorum 的起源,並且需要一些手工製作。例如,必須添加“isQuorum”標誌。從 quorum-examples 獲取 istanbul-genesis.json 副本是一個很好的解決方案。話雖如此,我剛剛使用 istanbul-tools 生成了一個 genesis.json,它在 quorum 上執行良好。我必須做的唯一更改是更改 extraData 以具有正確的驗證器節點地址。

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