OSDN Git Service

update bytom to vapor
authorZhiting Lin <zlin035@uottawa.ca>
Wed, 17 Jul 2019 10:14:19 +0000 (18:14 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Wed, 17 Jul 2019 10:14:19 +0000 (18:14 +0800)
15 files changed:
.gitignore
README.md
main.js
modules/interface/i18n/desktop.en.i18n.json
modules/interface/i18n/desktop.zh.i18n.json
modules/interface/locales/en/translation.json
modules/interface/locales/zh/translation.json
modules/logger.js
modules/menus/application-menu.js
modules/settings.js
package.json
src/features/app/actions.js
src/features/configuration/actions.js
src/sdk/api/bytomCLI.js
src/sdk/client.js

index be4df96..95b74d9 100644 (file)
@@ -1,5 +1,5 @@
 node_modules
-bytomd
+vapord
 npm-debug.log
 .env
 public
index 66afbae..40dda88 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Bytom Dashboard
+# Vapor Dashboard
 
 ## Development
 
@@ -16,23 +16,23 @@ Install dependencies:
 npm install
 ```
 
-##### Add Bytomd Deamon
-Add a folder named `bytomd` under the root folder. Put all the bytomd files into that folder.
+##### Add Vapord Deamon
+Add a folder named `vapord` under the root folder. Put all the vapord files into that folder.
 ```
-bytom-electron
+vapor-electron
 │   README.md
 │
-└───bytomd
-│   │   bytomd-darwin_amd64
-│   │   bytomd-linux_386
-│   │   bytomd-linux_amd64
-│   │   bytomd-windows_386.exe
-│   │   bytomd-windows_amd64.exe
+└───vapord
+│   │   vapord-darwin_amd64
+│   │   vapord-linux_386
+│   │   vapord-linux_amd64
+│   │   vapord-windows_386.exe
+│   │   vapord-windows_amd64.exe
 │   │  
 ``` 
 
 
-To developer the bytom electron app, run the script.
+To developer the vapor electron app, run the script.
 ```
 DEV=ture electron .
 ```
diff --git a/main.js b/main.js
index f8226b5..34e296a 100644 (file)
--- a/main.js
+++ b/main.js
@@ -8,12 +8,12 @@ const path = require('path')
 const fs = require('fs')
 const logger = require('./modules/logger')
 const log = logger.create('main')
-const bytomdLog = logger.create('bytomd')
+const vapordLog = logger.create('vapord')
 const Settings = require('./modules/settings')
 
 const net = require('net')
 
-let win, bytomdInit, bytomdNode
+let win, vapordInit, vapordNode
 
 global.fileExist = false
 global.mining = {isMining: false}
@@ -72,7 +72,7 @@ function initialize () {
 
     setupConfigure()
 
-    bytomd()
+    vapord()
 
     createWindow()
   })
@@ -91,35 +91,35 @@ function initialize () {
   })
 
   app.on('before-quit', () => {
-    if(bytomdInit){
-      bytomdInit.kill('SIGINT')
-      log.info('Kill bytomd Init command...')
+    if(vapordInit){
+      vapordInit.kill('SIGINT')
+      log.info('Kill vapord Init command...')
     }
-    if(bytomdNode){
-      bytomdNode.kill('SIGINT')
+    if(vapordNode){
+      vapordNode.kill('SIGINT')
       const killTimeout = setTimeout(() => {
-        bytomdNode.kill('SIGKILL')
+        vapordNode.kill('SIGKILL')
       }, 8000 /* 8 seconds */)
 
-      bytomdNode.once('close', () => {
+      vapordNode.once('close', () => {
         clearTimeout(killTimeout)
-        bytomdNode = null
+        vapordNode = null
       })
 
-      log.info('Kill bytomd Mining command...')
+      log.info('Kill vapord Mining command...')
     }
   })
 }
 
-function setBytomNode(event) {
-  bytomdNode = spawn( `${Settings.bytomdPath}`, ['node', '--web.closed'] )
+function setVaporNode(event) {
+  vapordNode = spawn( `${Settings.vapordPath}`, ['node', '--web.closed'] )
 
-  bytomdNode.stdout.on('data', function(data) {
-    bytomdLog.info(`bytomd node: ${data}`)
+  vapordNode.stdout.on('data', function(data) {
+    vapordLog.info(`vapord node: ${data}`)
   })
 
-  bytomdNode.stderr.on('data', function(data) {
-    bytomdLog.info(`bytomd node: ${data}`)
+  vapordNode.stderr.on('data', function(data) {
+    vapordLog.info(`vapord node: ${data}`)
     if (data.includes('msg="start node')) {
       if (event) {
         event.sender.send('ConfiguredNetwork', 'startNode')
@@ -130,46 +130,46 @@ function setBytomNode(event) {
       }
     }
 
-    bytomdNode.on('exit', function (code) {
-      bytomdLog.info('bytom Node exited with code ' + code)
+    vapordNode.on('exit', function (code) {
+      vapordLog.info('vapor Node exited with code ' + code)
       app.quit()
     })
   })
 }
 
-function setBytomInit(event, bytomNetwork) {
-  // Init bytomd
-  bytomdInit = spawn(`${Settings.bytomdPath}`, ['init', '--chain_id',  `${bytomNetwork}`] )
+function setVaporInit(event, vaporNetwork) {
+  // Init vapord
+  vapordInit = spawn(`${Settings.vapordPath}`, ['init', '--chain_id',  `${vaporNetwork}`] )
 
-  bytomdInit.stdout.on('data', function(data) {
-    bytomdLog.info(`bytomd init: ${data}`)
+  vapordInit.stdout.on('data', function(data) {
+    vapordLog.info(`vapord init: ${data}`)
   })
 
-  bytomdInit.stderr.on('data', function(data) {
-    bytomdLog.info(`bytomd init: ${data}`)
+  vapordInit.stderr.on('data', function(data) {
+    vapordLog.info(`vapord init: ${data}`)
   })
 
-  bytomdInit.on('exit', function (code) {
+  vapordInit.on('exit', function (code) {
     event.sender.send('ConfiguredNetwork','init')
-    setBytomNode(event)
-    bytomdLog.info('bytom init exited with code ' + code)
+    setVaporNode(event)
+    vapordLog.info('vapor init exited with code ' + code)
   })
 
-  bytomdInit.once('close', () => {
-    bytomdInit = null
+  vapordInit.once('close', () => {
+    vapordInit = null
   })
 }
 
-function bytomd(){
-  const filePath = path.join(`${Settings.bytomdDataPath}/config.toml`)
+function vapord(){
+  const filePath = path.join(`${Settings.vapordDataPath}/config.toml`)
   if (fs.existsSync(filePath)) {
-    log.info('Bytomd Network has been inited')
+    log.info('Vapord Network has been inited')
     global.fileExist = true
-    setBytomNode()
+    setVaporNode()
   }else {
-    log.info('Init Bytomd Network...')
-    ipcMain.on('bytomdInitNetwork', (event, arg) => {
-      setBytomInit( event,  arg )
+    log.info('Init Vapord Network...')
+    ipcMain.on('vapordInitNetwork', (event, arg) => {
+      setVaporInit( event,  arg )
     })
   }
 }
index 18dbdf9..0332669 100644 (file)
@@ -49,7 +49,7 @@
             },
             "help": {
                 "label": "Help",
-                "bytomWiki": "Troubleshooting and Help",
+                "vaporWiki": "Troubleshooting and Help",
                 "reportBug": "Report an issue on Github",
                 "version": "Versions"
             }
index a226cf0..afde0f6 100644 (file)
@@ -45,7 +45,7 @@
             },
             "help": {
                 "label": "帮助",
-                "bytomWiki": "排除故障和帮助",
+                "vaporWiki": "排除故障和帮助",
                 "reportBug": "在Github上提交issue",
                 "version": "版本号"
             }
index 7e5db6b..a5e39f1 100644 (file)
     "welcome":"Welcome to Vapor __network__"
   },
   "welcome":{
-    "connect":"Connecting to Bytom Core...",
+    "connect":"Connecting to Vapor Core...",
     "join":"Joining network",
     "joining":"Joining network...",
-    "title":"Configure Bytom Core",
-    "mainnetTitle":"Join the Bytom Mainnet",
-    "mainnetMsg":"For common users to enter. Mainnet is the production network, that carry real Bytom transactions.",
-    "testnetTitle":"Join the Bytom Testnet",
-    "testnetMsg":"For developers or bytom testers to enter. Testnet is an alternative Bytom blockchain, and to be used for testing.",
-    "solonetTitle":"Create the Bytom Soloent",
+    "title":"Configure Vapor Core",
+    "mainnetTitle":"Join the Vapor Mainnet",
+    "mainnetMsg":"For common users to enter. Mainnet is the production network, that carry real Vapor transactions.",
+    "testnetTitle":"Join the Vapor Testnet",
+    "testnetMsg":"For developers or vapor testers to enter. Testnet is an alternative Vapor blockchain, and to be used for testing.",
+    "solonetTitle":"Create the Vapor Soloent",
     "solonetMsg":"For users/developers to run and test wallet's new function. Solonet is a private sandbox blockchain network."
   },
   "backup":{
index f71ec3d..88d2ed1 100644 (file)
     "welcome":"欢迎来到__network__"
   },
   "welcome":{
-    "connect":"正在连接到Bytom Core...",
+    "connect":"正在连接到Vapor Core...",
     "join":"加入网络",
     "joining":"加入网络...",
-    "title":"配置 Bytom Core",
-    "mainnetTitle":"加入 Bytom 主网",
-    "mainnetMsg":"普通用户选择加入。这是实际的Bytom网络,包含真实的交易信息。",
-    "testnetTitle":"加入 Bytom 测试网络",
-    "testnetMsg":"开发者选择加入。这是Bytom的测试网络,用于Bytom的相关测试。",
-    "solonetTitle":"创建 Bytom 单机网络",
+    "title":"配置 Vapor Core",
+    "mainnetTitle":"加入 Vapor 主网",
+    "mainnetMsg":"普通用户选择加入。这是实际的Vapor网络,包含真实的交易信息。",
+    "testnetTitle":"加入 Vapor 测试网络",
+    "testnetMsg":"开发者选择加入。这是Vapor的测试网络,用于Vapor的相关测试。",
+    "solonetTitle":"创建 Vapor 单机网络",
     "solonetMsg":"创建一个沙盒私有网络供用户运行和测试功能。"
   },
   "backup":{
index 4a01d52..2661b79 100644 (file)
@@ -26,15 +26,15 @@ exports.setup = function (options) {
         type: 'file',
         filename: `${logFolder}/electron/menu.log`
       },
-      bytomd: {
+      vapord: {
         type: 'file',
-        filename: `${logFolder}/bytomd/bytomd.log`
+        filename: `${logFolder}/vapord/vapord.log`
       }
     },
     categories: {
       default: { appenders: [ 'out', 'all', 'main' ], level },
       menu: { appenders: [ 'out', 'all', 'menu' ], level },
-      bytomd: { appenders: [ 'out', 'all', 'bytomd' ], level }
+      vapord: { appenders: [ 'out', 'all', 'vapord' ], level }
     }
   }
 
index db8d34f..6c3fc1a 100755 (executable)
@@ -262,7 +262,7 @@ let menuTempl = function () {
     label: i18n.t('desktop.applicationMenu.develop.logFiles'),
     click() {
       try {
-        shell.showItemInFolder(path.join(app.getPath('userData'), 'logs', 'bytomd', 'bytomd.log'))
+        shell.showItemInFolder(path.join(app.getPath('userData'), 'logs', 'vapord', 'vapord.log'))
       } catch (error) {
         log.error(error)
       }
@@ -312,14 +312,14 @@ let menuTempl = function () {
   }
 
   helpMenu.push({
-    label: i18n.t('desktop.applicationMenu.help.bytomWiki'),
+    label: i18n.t('desktop.applicationMenu.help.vaporWiki'),
     click() {
-      shell.openExternal('https://github.com/bytom/bytom/wiki')
+      shell.openExternal('https://github.com/bytom/vapor/wiki')
     },
   }, {
     label: i18n.t('desktop.applicationMenu.help.reportBug'),
     click() {
-      shell.openExternal('https://github.com/bytom/bytom/issues')
+      shell.openExternal('https://github.com/bytom/vapor/issues')
     },
   })
 
index 1abbc49..493b259 100644 (file)
@@ -35,23 +35,23 @@ class Settings {
     return app.getPath('home')
   }
 
-  get bytomdPath() {
+  get vapordPath() {
     return process.env.DEV?
-      path.join(__dirname, '../bytomd/bytomd-darwin_amd64'):
-      glob.sync( path.join(__dirname, '../../bytomd/bytomd*'))
+      path.join(__dirname, '../vapord/vapord-darwin_amd64'):
+      glob.sync( path.join(__dirname, '../../vapord/vapord*'))
   }
 
-  get bytomdDataPath(){
-    let bytomdDataPath
+  get vapordDataPath(){
+    let vapordDataPath
     switch (process.platform){
       case 'win32':
-        bytomdDataPath = `${app.getPath('appData')}/Bytom`
+        vapordDataPath = `${app.getPath('appData')}/Vapor`
         break
       case 'darwin':
-        bytomdDataPath = `${app.getPath('home')}/Library/Application Support/Bytom`
+        vapordDataPath = `${app.getPath('home')}/Library/Application Support/Vapor`
         break
       case 'linux':
-        bytomdDataPath = `${app.getPath('home')}/.bytom`
+        vapordDataPath = `${app.getPath('home')}/.bytom`
     }
     return bytomdDataPath
   }
index e771f44..a346146 100644 (file)
@@ -1,9 +1,9 @@
 {
-  "name": "bytom-wallet",
-  "productName": "Bytom Wallet",
+  "name": "vapor-wallet",
+  "productName": "Vapor Wallet",
   "build": {
     "electronVersion": "1.8.3",
-    "appId": "io.bytom.desktop",
+    "appId": "io.vapor.desktop",
     "directories": {
       "buildResources": "./",
       "output": "desktop"
@@ -21,7 +21,7 @@
       "icon": "static/images/app-icon/mac/app.icns",
       "artifactName": "${name}-desktop-${version}-${os}.${ext}",
       "category": "public.app-category.wallet",
-      "extraResources": "bytomd/bytomd-darwin_amd64",
+      "extraResources": "vapord/vapord-darwin_amd64",
       "target": "zip"
     },
     "dmg": {
     "win": {
       "icon": "static/images/app-icon/win/app.ico",
       "artifactName": "${name}-desktop-${version}-${os}-${arch}.${ext}",
-      "extraResources": "bytomd/bytomd-windows_${env.ARCH_VARIABLE}.exe",
+      "extraResources": "vapord/vapord-windows_${env.ARCH_VARIABLE}.exe",
       "target": "zip"
     },
     "linux": {
-      "maintainer": "bytom contributors <zhiting.fly@bytom.io>",
+      "maintainer": "vapor contributors <zhiting.fly@bytom.io>",
       "artifactName": "${name}-desktop-${version}-${os}-${arch}.${ext}",
-      "executableName": "Bytom Wallet",
-      "extraResources": "bytomd/bytomd-linux_${env.ARCH_VARIABLE}",
+      "executableName": "Vapor Wallet",
+      "extraResources": "vapord/vapord-linux_${env.ARCH_VARIABLE}",
       "target": "zip",
       "category": "Finance",
       "packageCategory": "wallet",
@@ -61,7 +61,7 @@
     "asar": true
   },
   "version": "1.0.9",
-  "description": "Bytom Wallet Desktop",
+  "description": "Vapor Wallet Desktop",
   "main": "main.js",
   "scripts": {
     "build:dll": "node ./bin/dependencies.js",
index 5071a7d..91eb11b 100644 (file)
@@ -43,7 +43,7 @@ const actions = {
     }
   },
   cmd: (data) => () => {
-    return chainClient().bytomCli.request(data)
+    return chainClient().vaporCli.request(data)
   }
 }
 
index 1375b5f..dd78b50 100644 (file)
@@ -1,11 +1,11 @@
 let actions = {
   submitConfiguration: (data) => {
     if (data.type == 'testnet'){
-      window.ipcRenderer.send('bytomdInitNetwork','testnet')
+      window.ipcRenderer.send('vapordInitNetwork','testnet')
     }else if(data.type == 'mainnet'){
-      window.ipcRenderer.send('bytomdInitNetwork','mainnet')
+      window.ipcRenderer.send('vapordInitNetwork','mainnet')
     }else if(data.type == 'solonet'){
-      window.ipcRenderer.send('bytomdInitNetwork','solonet')
+      window.ipcRenderer.send('vapordInitNetwork','solonet')
     }
     return (dispatch) => (dispatch)
   }
index 514b778..8b3a84a 100644 (file)
@@ -1,4 +1,4 @@
-const bytomCLI = (client) => {
+const vaporCLI = (client) => {
 
   return {
     request: (params) => {
@@ -82,4 +82,4 @@ const bytomCLI = (client) => {
   }
 }
 
-module.exports = bytomCLI
+module.exports = vaporCLI
index 8f8a92f..8668f29 100644 (file)
@@ -5,7 +5,7 @@ const accountsAPI = require('./api/accounts')
 const assetsAPI = require('./api/assets')
 const backUpAPI = require('./api/backUp')
 const balancesAPI = require('./api/balances')
-const bytomCLI = require('./api/bytomCLI')
+const vaporCLI = require('./api/vaporCLI')
 const configAPI = require('./api/config')
 const federationAPI = require('./api/federations')
 const hsmSigner = require('./api/hsmSigner')
@@ -41,7 +41,7 @@ class Client {
 
     this.balances = balancesAPI(this)
 
-    this.bytomCli = bytomCLI(this)
+    this.vaporCli = vaporCLI(this)
 
     this.config = configAPI(this)