Skip to content

Commit 7df7158

Browse files
committed
修改IPFS
1 parent b680cf2 commit 7df7158

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/java/UI/AppMainWindow.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import UI.panel.im.IMPanel;
77
import UI.panel.monitor.ConsolePanel;
88
import UI.panel.setting.SettingPanel;
9+
import com.nbs.ipfs.IPFSHelper;
910
import com.nbs.tools.ConfigHelper;
1011
import io.ipfs.api.IPFS;
1112
import org.slf4j.Logger;
@@ -58,17 +59,15 @@ public class AppMainWindow {
5859

5960
public static boolean SERVER_STAT = false;
6061

61-
public static String PROFILE_NICKNAME = "lanbery";
62-
62+
protected static IPFSHelper ipfsHelper = IPFSHelper.getInstance();
6363
/**
6464
*
6565
*/
66-
public static IPFS ipfs = null;
66+
public static IPFS ipfs = IPFSHelper.getInstance().getIpfs();
67+
68+
69+
public static String PROFILE_NICKNAME = "";
6770

68-
/**
69-
* 运行监控
70-
*/
71-
public static ConsolePanel monitorPanel;
7271
/**
7372
*
7473
*/
@@ -175,7 +174,6 @@ private void initialize(){
175174
*/
176175
private void loadEnv(){
177176
Properties props = ConfigHelper.getEnv();
178-
179177
logger.info("ENV ============================>>");
180178
for(String k : props.stringPropertyNames()){
181179
String v = props.getProperty(k);
@@ -189,12 +187,14 @@ private void loadEnv(){
189187
}
190188

191189
try {
192-
ipfs = new IPFS(ConfigHelper.getIpfsAddress());
190+
if(ipfs==null)ipfs = new IPFS(ConfigHelper.getIpfsAddress());
193191
SERVER_STAT = true;
194192
Map map = ipfs.id();
193+
PROFILE_NICKNAME = ipfsHelper.getNickName();
195194
logger.info(">>>>>>>>>>>>>."+map.get("ID"));
196195
}catch (Exception e){
197196
logger.error("ipfs Server is dead.");
197+
ipfs = new IPFS(ConfigHelper.getIpfsAddress());
198198
}
199199

200200
}

0 commit comments

Comments
 (0)