You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@return
*/
public Client getWeb3j() {
this.checkConnection();
Set groupIdSet = bcosSDK.getGroupManagerService().getGroupList(); //1
log.info("getWeb3j groupIdSet get {}", groupIdSet);
if (groupIdSet.isEmpty()) {
log.error("web3jMap is empty, groupList empty! please check your node status");
// get default web3j of integer max value
return rpcWeb3j;
}
// get random index to get web3j
Client client = null;
for (Integer groupId : groupIdSet) {
try {
client = bcosSDK.getClient(groupId);
} catch (BcosSDKException ex) {
log.error("getClient failed groupId:{}, ex", groupId, ex);
}
if (client != null) {
return client;
}
}
log.warn("getWeb3j finally get null, now return rpcWeb3j");
return rpcWeb3j;
}
The text was updated successfully, but these errors were encountered:
关闭节点所属的全部群组以后,无法再启动的问题。应该是getWeb3j接口调用底层SDK缓存造成的问题,可以直接使用Spring注入的rpcLient类,无需通过群组进行遍历后再创建新的Client对象
com.webank.webase.front.web3api.Web3ApiService
/**
*/
public Client getWeb3j() {
this.checkConnection();
Set groupIdSet = bcosSDK.getGroupManagerService().getGroupList(); //1
log.info("getWeb3j groupIdSet get {}", groupIdSet);
if (groupIdSet.isEmpty()) {
log.error("web3jMap is empty, groupList empty! please check your node status");
// get default web3j of integer max value
return rpcWeb3j;
}
// get random index to get web3j
Client client = null;
for (Integer groupId : groupIdSet) {
try {
client = bcosSDK.getClient(groupId);
} catch (BcosSDKException ex) {
log.error("getClient failed groupId:{}, ex", groupId, ex);
}
if (client != null) {
return client;
}
}
log.warn("getWeb3j finally get null, now return rpcWeb3j");
return rpcWeb3j;
}
The text was updated successfully, but these errors were encountered: