FISCO-BCOS / go-sdk

golang SDK of FISCO BCOS
Apache License 2.0
73 stars 57 forks source link

报错group0不存在 #228

Open Duanraudon opened 1 year ago

Duanraudon commented 1 year ago

image

初始化客户端连接链已经成功但却在部署合约的时候报错group0不存在

bxq2011hust commented 1 year ago
  1. 检查日志中的信息,默认在log目录
  2. 检查所使用的动态库版本,是否是3.4
Duanraudon commented 1 year ago

info|2023-07-24 11:26:39.745817|[SDK][WS][SERVICE],[NEWOBJ][WsService]=000001804EBC6500 info|2023-07-24 11:26:39.745817|[RPCWS][SERVICE]init the local protocol,minVersion=1,maxVersion=1,module=2 info|2023-07-24 11:26:39.745817|[startThread]start the timer thread info|2023-07-24 11:26:39.746335|[DEFAULT][WS][INITIALIZER][initWsService]start websocket service as client,connected endpoints size=1 info|2023-07-24 11:26:39.746335|[startThread]the timer thread start,threadName=timerFactory info|2023-07-24 11:26:39.747403|[DEFAULT][WS][INITIALIZER][initWsService]initializer for websocket service,listenIP=,listenPort=0,disableSsl=true,server=false,client=true,threadPoolSize=8,maxMsgSize=33554432,msgTimeOut=10000,connected peers=1 info|2023-07-24 11:26:39.747530|[buildJsonRpc]build json rpc,sendRequestToHighestBlockNode=true info|2023-07-24 11:26:39.747530|[bcos_sdk_create][NEWOBJ],sdk=000001804EBDDD70,version=FISCO BCOS C SDK Version : 3.4.0 Build Time : 20230612 08:01:53 Build Type : Windows/unknown/Release Git Branch : HEAD Git Commit : 8829d018c34fe8f5c8db7422aa44144d0e2b6cf8 ,peers_count=1,disable_ssl=1,message_timeout_ms=10000,reconnect_period_ms=-1,heartbeat_period_ms=-1,send_rpc_request_to_highest_block_node=1 info|2023-07-24 11:26:39.774411|[DEFAULT][WS][CONNECTOR][connectToWsServer]async_connect success,endpoint=10.0.51.196:8565 info|2023-07-24 11:26:39.774411|[DEFAULT][WS][STREAM],[NEWOBJ][WsStream]=000001804EC4EE80 info|2023-07-24 11:26:39.774411|[DEFAULT][WS][CONNECTOR][connectToWsServer]ssl async_handshake success,host=10.0.51.196,port=8565 warning|2023-07-24 11:26:39.799974|[DEFAULT][WS][CONNECTOR][connectToWsServer]websocket async_handshake failed,error=end of stream,host=10.0.51.196,port=8565 info|2023-07-24 11:26:39.799974|[DEFAULT][WS][STREAM],[DELOBJ][WsStream]=000001804EC4EE80 info|2023-07-24 11:26:39.799974|[DEFAULT][WS][STREAM]the real action to close the stream,this=000001804EC4EE80 info|2023-07-24 11:26:39.800975|[SDK][WS][SERVICE][stop]stop websocket service successfully error|2023-07-24 11:26:39.800975|[bcos_sdk_start],sdk=000001804EBDDD70,errorMsg=C:.hunter_Base\5d8365a\b9c16e4\65d745c\Build\bcos-boostssl\Source\bcos-boostssl\websocket\WsService.cpp(233): Throw in function void __cdecl bcos::boostssl::ws::WsService::syncConnectToEndpoints(class std::shared_ptr<class std::set<struct bcos::boostssl::NodeIPEndpoint,struct std::less,class std::allocator > >) Dynamic exception type: struct boost::wrapexcept std::exception::what: [end of stream:/10.0.51.196:8565] info|2023-07-24 11:26:39.800975|[bcos_sdk_start],sdk=000001804EBDDD70 info|2023-07-24 11:26:39.800975|[RPCWS][SERVICE][getGroupInfo]group not exist,group=group0 info|2023-07-24 11:26:39.805811|[RPCWS][SERVICE][getGroupInfo]group not exist,group=group0

上述是log信息,动态库确实是3.4.0

bxq2011hust commented 1 year ago

error|2023-07-24 11:26:39.800975|[bcos_sdk_start],sdk=000001804EBDDD70,errorMsg=C:.hunter_Base\5d8365a\b9c16e4\65d745c\Build\bcos-boostssl\Source\bcos-boostssl\websocket\WsService.cpp(233): Throw in function void __cdecl bcos::boostssl::ws::WsService::syncConnectToEndpoints(class std::shared_ptr<class std::set<struct bcos::boostssl::NodeIPEndpoint,struct std::less,class std::allocator > >) Dynamic exception type: struct boost::wrapexcept std::exception::what: [end of stream:/10.0.51.196:8565]

看error是连不上,检查是否关闭了节点的ssl,配置的IP端口是否正确

Duanraudon commented 1 year ago

链环境配置是关闭了节点的ssl, ip和端口也都正确。更新最新的代码报错变了。现在变成了

info|2023-07-31 14:05:12.442477|[SDK][WS][SERVICE],[NEWOBJ][WsService]=000001F3371F63F0 info|2023-07-31 14:05:12.442477|[RPCWS][SERVICE]init the local protocol,minVersion=1,maxVersion=1,module=2 info|2023-07-31 14:05:12.442477|[startThread]start the timer thread info|2023-07-31 14:05:12.443003|[DEFAULT][WS][INITIALIZER][initWsService]start websocket service as client,connected endpoints size=1 info|2023-07-31 14:05:12.443003|[startThread]the timer thread start,threadName=timerFactory info|2023-07-31 14:05:12.443623|[DEFAULT][WS][INITIALIZER][initWsService]initializer for websocket service,listenIP=,listenPort=0,disableSsl=true,server=false,client=true,threadPoolSize=8,maxMsgSize=33554432,msgTimeOut=10000,connected peers=1 info|2023-07-31 14:05:12.443623|[buildJsonRpc]build json rpc,sendRequestToHighestBlockNode=true info|2023-07-31 14:05:12.443623|[bcos_sdk_create][NEWOBJ],sdk=000001F337224B00,version=FISCO BCOS C SDK Version : 3.4.0 Build Time : 20230612 08:01:53 Build Type : Windows/unknown/Release Git Branch : HEAD Git Commit : 8829d018c34fe8f5c8db7422aa44144d0e2b6cf8 ,peers_count=1,disable_ssl=1,message_timeout_ms=10000,reconnect_period_ms=-1,heartbeat_period_ms=-1,send_rpc_request_to_highest_block_node=1 info|2023-07-31 14:05:12.469057|[DEFAULT][WS][CONNECTOR][connectToWsServer]async_connect success,endpoint=10.0.51.196:8565 info|2023-07-31 14:05:12.470057|[DEFAULT][WS][STREAM],[NEWOBJ][WsStream]=000001F3372483B0 info|2023-07-31 14:05:12.470057|[DEFAULT][WS][CONNECTOR][connectToWsServer]ssl async_handshake success,host=10.0.51.196,port=8565 warning|2023-07-31 14:05:12.600078|[DEFAULT][WS][CONNECTOR][connectToWsServer]websocket async_handshake failed,error=end of stream,host=10.0.51.196,port=8565 info|2023-07-31 14:05:12.600078|[DEFAULT][WS][STREAM],[DELOBJ][WsStream]=000001F3372483B0 info|2023-07-31 14:05:12.601078|[DEFAULT][WS][STREAM]the real action to close the stream,this=000001F3372483B0 info|2023-07-31 14:05:12.601078|[SDK][WS][SERVICE][stop]stop websocket service successfully error|2023-07-31 14:05:12.601078|[bcos_sdk_start],sdk=000001F337224B00,errorMsg=C:.hunter_Base\5d8365a\b9c16e4\65d745c\Build\bcos-boostssl\Source\bcos-boostssl\websocket\WsService.cpp(233): Throw in function void __cdecl bcos::boostssl::ws::WsService::syncConnectToEndpoints(class std::shared_ptr<class std::set<struct bcos::boostssl::NodeIPEndpoint,struct std::less,class std::allocator > >) Dynamic exception type: struct boost::wrapexcept std::exception::what: [end of stream:/10.0.51.196:8565] info|2023-07-31 14:05:12.601078|[bcos_sdk_start],sdk=000001F337224B00

bxq2011hust commented 1 year ago

你搭建的链版本是多少? 猜测是使用了master分支的go-sdk连接了FISCO BCOS v2的链导致的问题,需要注意master分支的go-sdk对应FISCO BCOS v3的节点,v2的FISCO BCOS节点需要使用这个分支的代码 https://github.com/FISCO-BCOS/go-sdk/tree/master-FISCO-BCOS-v2