OSDN Git Service

update bytomd data dir
authorj <coffce404@gmail.com>
Fri, 2 Jul 2021 09:29:45 +0000 (17:29 +0800)
committerj <coffce404@gmail.com>
Fri, 2 Jul 2021 09:29:45 +0000 (17:29 +0800)
main.js
modules/settings.js
package.json

diff --git a/main.js b/main.js
index a87c717..bcf5ecc 100644 (file)
--- a/main.js
+++ b/main.js
@@ -113,7 +113,7 @@ function initialize () {
 }
 
 function setBytomNode(event) {
-  bytomdNode = spawn( `${Settings.bytomdPath}`, ['node', '--web.closed'] )
+  bytomdNode = spawn( `${Settings.bytomdPath}`, ['node', '--web.closed', '--home', Settings.bytomdDataPath] )
 
   bytomdNode.stdout.on('data', function(data) {
     bytomdLog.info(`bytomd node: ${data}`)
@@ -142,7 +142,7 @@ function setBytomNode(event) {
 
 function setBytomInit(event, bytomNetwork) {
   // Init bytomd
-  bytomdInit = spawn(`${Settings.bytomdPath}`, ['init', '--chain_id',  `${bytomNetwork}`] )
+  bytomdInit = spawn(`${Settings.bytomdPath}`, ['init', '--chain_id',  `${bytomNetwork}`, '--home', Settings.bytomdDataPath] )
 
   bytomdInit.stdout.on('data', function(data) {
     bytomdLog.info(`bytomd init: ${data}`)
index 1abbc49..aad7e17 100644 (file)
@@ -45,13 +45,13 @@ class Settings {
     let bytomdDataPath
     switch (process.platform){
       case 'win32':
-        bytomdDataPath = `${app.getPath('appData')}/Bytom`
+        bytomdDataPath = `${app.getPath('appData')}/Bytom2`
         break
       case 'darwin':
-        bytomdDataPath = `${app.getPath('home')}/Library/Application Support/Bytom`
+        bytomdDataPath = `${app.getPath('home')}/Library/Application Support/Bytom2`
         break
       case 'linux':
-        bytomdDataPath = `${app.getPath('home')}/.bytom`
+        bytomdDataPath = `${app.getPath('home')}/.bytom2`
     }
     return bytomdDataPath
   }
index c8aa003..4372dc5 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "bytom-wallet",
-  "productName": "Bytom Wallet",
+  "productName": "Bytom Wallet2",
   "build": {
     "electronVersion": "1.8.3",
     "appId": "io.bytom.desktop",