雨我无瓜 2024-03-04 14:24 采纳率: 0%
浏览 19
已结题

使用FISCO BCOS 3.x PRO版本host网络模式,扩容成功,但是扩容的节点无法加入到观察者列表,控制台报错

问题
使用FISCO BCOS 3.x PRO版本host网络模式,扩容成功,但是扩容的节点无法加入到观察者列表,控制台报错:


{
    "code":-4008,
    "msg":"waiting for message response timed out"
}

环境配置
FISCO BCOS版本:3.5.0
虚拟机版本:ubuntu-22.04.4
jdk版本:jdk1.8.0_202
(所有虚拟机的防火墙都处于关闭状态)

ip主机名机构
192.168.110.132(tars管理服务部署节点)FISCO2agencyA
192.168.110.133FISCO3agencyB
192.168.110.131(扩容节点)FISCO4agencyC

步骤

  1. 在FISCO2,FISCO3两台虚拟机搭建pro host版本的链,分别对应agencyA和agencyB:

img

使用console可以看到部署成功的节点:

[group0]: /apps> getGroupPeers
peer0: 20c976b763b1b7427e48198cabf5a75805989e7f0c481f3cff7c53a8e4ae6cb75308716c50376d4443dd35aae3ca7fd3ace27180339e9a94e608dca29895c1f1
peer1: 2a8ea604f5295d5197679c5b387c25ed1e863e98a3fd9944767f3f41a934e27079896056e19c7c4118f50322c10007ef7f68767d3c27f1d61940dae4c2a573aa

[group0]: /apps> getSealerList
 [
 Sealer{
 nodeID='20c976b763b1b7427e48198cabf5a75805989e7f0c481f3cff7c53a8e4ae6cb75308716c50376d4443dd35aae3ca7fd3ace27180339e9a94e608dca29895c1f1',
 weight=1
 },
 Sealer{
 nodeID='2a8ea604f5295d5197679c5b387c25ed1e863e98a3fd9944767f3f41a934e27079896056e19c7c4118f50322c10007ef7f68767d3c27f1d61940dae4c2a573aa',
 weight=1
 }
 ]

  1. 另有一台虚拟机FISCO4,想在这台机器上扩容一个agencyC,配置文件如下:
    gateway&rpc扩容配置:

[tars]
tars_url = "http://127.0.0.1:3000"
tars_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhZG1pbiIsImlhdCI6MTcwOTI1ODcyMCwiZXhwIjoxNzk4NjgyNzIwfQ.aBophmKcpcfgRwsGG1i-kIrIuBUCp9LkHxGqTufKlvk"
tars_pkg_dir = "binary/"

[chain]
chain_id="chain0"
rpc_sm_ssl=false
gateway_sm_ssl=false
# the ca path of the expanded rpc service
# must ensure that the path configuration is correct, otherwise the ssl verification will fail
rpc_ca_cert_path="generated/rpc/chain0/ca"
# the ca path of the expanded gateway service
# must ensure that the path configuration is correct, otherwise the ssl verification will fail
gateway_ca_cert_path="generated/gateway/chain0/ca"

[[agency]]
name = "agencyC"
# enable data disk encryption for rpc/gateway or not, default is false
enable_storage_security = false
# url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details
# key_center_url =
# cipher_data_key =

    [agency.rpc]
    deploy_ip=["192.168.110.131"]
    listen_ip="0.0.0.0"
    listen_port=10200
    thread_count=4

    [agency.gateway]
    deploy_ip=["192.168.110.131"]
    listen_ip="0.0.0.0"
    listen_port=40300
    peers=["192.168.110.132:30300", "192.168.110.133:30301", "192.168.110.131:40300"]

节点扩容配置:

[tars]
tars_url = "http://127.0.0.1:3000"
tars_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhZG1pbiIsImlhdCI6MTcwOTI1ODcyMCwiZXhwIjoxNzk4NjgyNzIwfQ.aBophmKcpcfgRwsGG1i-kIrIuBUCp9LkHxGqTufKlvk"
tars_pkg_dir = "binary/"

[chain]
chain_id="chain0"

[[group]]
group_id="group0"
# the genesis configuration path of the expanded group
genesis_config_path = "generated/chain0/group0/config.genesis"
# use sm-crypto or not
sm_crypto=false
auth_check=true
init_auth_address="0x4bf9de7cd28becdc540c0ca7110d25f6a427efad"

[[agency]]
name = "agencyC"
    [[agency.group]]
        group_id = "group0"

        [[agency.group.node]]
        node_name = "node0"
        deploy_ip = "192.168.110.131"
        # enable data disk encryption for bcos node or not, default is false
        enable_storage_security = false
        # url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details
        # key_center_url =
        # cipher_data_key =
        monitor_listen_port = "3901"
        # monitor log path example:"/home/fisco/tars/framework/app_log/"
        monitor_log_path = ""
        enable_hsm=false
  1. 使用以上配置生成rpc,gateway,node:

img

  1. 将证书从FISCO2 的~/fisco/BcosBuilder/pro/generated/rpc/chain0/agencyCBcosRpcService/192.168.110.131/sdk 拷贝到FISCO4 ~/fisco/console/conf下,并且使用cp -n config-example.toml config.toml拷贝重命名配置文件,修改配置文件如下:
[cryptoMaterial]

certPath = "conf"                           # The certification path
disableSsl = "false"                        # Communication with nodes without SSL
useSMCrypto = "false"                       # RPC SM crypto type

# The following configurations take the certPath by default if commented
# caCert = "conf/ca.crt"                    # CA cert file path
# sslCert = "conf/sdk.crt"                  # SSL cert file path
# sslKey = "conf/sdk.key"                   # SSL key file path

# The following configurations take the sm certPath by default if commented
# caCert = "conf/sm_ca.crt"                    # SM CA cert file path
# sslCert = "conf/sm_sdk.crt"                  # SM SSL cert file path
# sslKey = "conf/sm_sdk.key"                    # SM SSL key file path
# enSslCert = "conf/sm_ensdk.crt"               # SM encryption cert file path
# enSslKey = "conf/sm_ensdk.key"                # SM ssl cert file path

[network]
messageTimeout = "300000"
defaultGroup="group0"                            # Console default group to connect
peers=["127.0.0.1:10200"]    # The peer list to connect

[account]
keyStoreDir = "account"         # The directory to load/store the account file, default is "account"
# accountFilePath = ""          # The account file path (default load from the path specified by the keyStoreDir)
accountFileFormat = "pem"       # The storage format of account file (Default is "pem", "p12" as an option)

# accountAddress = ""           # The transactions sending account address
                                # Default is a randomly generated account
                                # The randomly generated account is stored in the path specified by the keyStoreDir

# password = ""                 # The password used to load the account file

[threadPool]
# threadPoolSize = "16"         # The size of the thread pool to process message callback
                                            # Default is the number of cpu cores
  1. 启动控制台,获取节点信息如下:

[group0]: /apps> getGroupPeers
peer0: 20c976b763b1b7427e48198cabf5a75805989e7f0c481f3cff7c53a8e4ae6cb75308716c50376d4443dd35aae3ca7fd3ace27180339e9a94e608dca29895c1f1
peer1: 2a8ea604f5295d5197679c5b387c25ed1e863e98a3fd9944767f3f41a934e27079896056e19c7c4118f50322c10007ef7f68767d3c27f1d61940dae4c2a573aa
peer2: eab8e7eb2b7998f6fc09f4f25cb0a4e0ea19cc26fcc6416a44aed608641b823740d1a06f96fec0953b255821197f08ff8a170a8c75eb2a7b875a66733d43355c


[group0]: /apps> getSealerList
[
    Sealer{
        nodeID='20c976b763b1b7427e48198cabf5a75805989e7f0c481f3cff7c53a8e4ae6cb75308716c50376d4443dd35aae3ca7fd3ace27180339e9a94e608dca29895c1f1',
        weight=1
    },
    Sealer{
        nodeID='2a8ea604f5295d5197679c5b387c25ed1e863e98a3fd9944767f3f41a934e27079896056e19c7c4118f50322c10007ef7f68767d3c27f1d61940dae4c2a573aa',
        weight=1
    }
]


  1. 将新扩容的节点加入观察者列表,报错:

[group0]: /apps> addObserver eab8e7eb2b7998f6fc09f4f25cb0a4e0ea19cc26fcc6416a44aed608641b823740d1a06f96fec0953b255821197f08ff8a170a8c75eb2a7b875a66733d43355c
{
    "code":-4008,
    "msg":"waiting for message response timed out"
}

```log

2024-03-04 13:54:59.888 DEBUG org.fisco.bcos.sdk.v3.transaction.manager.TransactionProcessor 211 sendTransactionAsync -- sendTransactionAsync, group: group0, to: 0000000000000000000000000000000000001003, tx hash: 0xbd30ce98b774571a820abe614bdde6e16171dc2e7766a288296e2e1219e88f80
2024-03-04 13:59:59.890 ERROR org.fisco.bcos.sdk.v3.client.ClientImpl 1444 parseResponseIntoJsonRpcResponse -- parseResponseIntoJsonRpcResponse failed, method: sendTransaction, retErrorMessage: waiting for message response timed out, retErrorCode: -4008
2024-03-04 13:59:59.891 ERROR org.fisco.bcos.sdk.v3.client.ClientImpl 1458 parseResponseIntoJsonRpcResponse -- parseResponseIntoJsonRpcResponse failed for decode the message exception, response: Response{errorCode=-4008, errorMessage='waiting for message response timed out', content=}, errorMessage: get response failed, errorCode: -4008, error message: waiting for message response timed out org.fisco.bcos.sdk.v3.client.exceptions.ClientException: get response failed, errorCode: -4008, error message: waiting for message response timed out
    at org.fisco.bcos.sdk.v3.client.ClientImpl.parseResponseIntoJsonRpcResponse(ClientImpl.java:1455) ~[fisco-bcos-java-sdk-3.6.0.jar:?]
    at org.fisco.bcos.sdk.v3.client.ClientImpl$3.onResponse(ClientImpl.java:1330) ~[fisco-bcos-java-sdk-3.6.0.jar:?]
    at org.fisco.bcos.sdk.v3.transaction.manager.TransactionProcessor.lambda$sendTransactionAsync$0(TransactionProcessor.java:207) ~[fisco-bcos-java-sdk-3.6.0.jar:?]

2024-03-04 13:59:59.893 ERROR org.fisco.bcos.sdk.v3.model.callback.TransactionCallback 31 onError -- transaction exception, errorCode: -4008, errorMessage: waiting for message response timed out
2024-03-04 13:59:59.896 ERROR console.Console 171 main -- ContractException, e: org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException: waiting for message response timed out
    at org.fisco.bcos.sdk.v3.transaction.codec.decode.ReceiptParser.getErrorStatus(ReceiptParser.java:74) ~[fisco-bcos-java-sdk-3.6.0.jar:?]
    at org.fisco.bcos.sdk.v3.transaction.codec.decode.ReceiptParser.parseTransactionReceipt(ReceiptParser.java:44) ~[fisco-bcos-java-sdk-3.6.0.jar:?]
    at org.fisco.bcos.sdk.v3.contract.precompiled.consensus.ConsensusService.addObserver(ConsensusService.java:119) ~[fisco-bcos-java-sdk-3.6.0.jar:?]
    at console.precompiled.PrecompiledImpl.addObserver(PrecompiledImpl.java:93) ~[console.jar:?]
    at console.command.category.ConsensusOpCommand.lambda$static$8(ConsensusOpCommand.java:112) ~[console.jar:?]
    at console.command.model.CommandInfo.callCommand(CommandInfo.java:310) ~[console.jar:?]
    at console.Console.main(Console.java:134) ~[console.jar:?]

```

  • 写回答

2条回答 默认 最新

  • 关注

    code_bug_ 下午好🌅🌅🌅
    本答案参考ChatGPT-3.5

    问题的关键在于扩容的节点无法加入到观察者列表,并且控制台报错"waiting for message response timed out"。根据提供的环境配置和步骤,可以进行以下解决方案:

    解决方案:

    1. 检查网络连通性:确保扩容节点(FISCO4)与其他节点(FISCO2、FISCO3)能够正常通信,包括RPC和P2P端口。

    2. 确认配置文件:

      • 确保FISCO4上的配置文件中[group]中的genesis_config_path正确指向FISCO2或FISCO3的创世区块配置文件。
      • 确保FISCO4上的配置文件中[agency]中的peers列表包含了FISCO2和FISCO3的IP和端口。
    3. 检查证书配置:确保FISCO4上的控制台的config.toml中的证书配置正确,包括caCertsslCertsslKey

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 3月7日
  • 修改了问题 3月4日
  • 修改了问题 3月4日
  • 修改了问题 3月4日
  • 展开全部

悬赏问题

  • ¥15 想要写一个跟百度网盘一样文件管理器,打开全部文件夹后 ,一级一级返回
  • ¥15 悬赏Python-playwright部署在centos7上
  • ¥15 psoc creator软件有没有人能远程安装啊
  • ¥15 快速扫描算法求解Eikonal方程咨询
  • ¥20 我的是道格手机,重置后屏幕右上角出现红色字的未写入tee key 和未写入google key请问怎么去掉啊
  • ¥30 关于R语言运行分区生存模型中的问题!
  • ¥15 校内二手商品转让网站
  • ¥20 高德地图聚合图层MarkerCluster聚合多个点,但是ClusterData只有其中部分数据,原因应该是有经纬度重合的地方点,现在我想让ClusterData显示所有点的信息,如何实现?
  • ¥100 求Web版SPC控制图程序包调式
  • ¥20 指导如何跑通以下两个Github代码