您正在查看: 2018年11月

ScatterDesktop麒麟网络及账号配置

之前我们演示了scatter 扩展版本,添加测试网络的演示 (《Scatter的使用及添加测试网络相关设置》)
目前scatter官方已经明确废弃了扩展版本,主推桌面版本ScatterDesktop

1.下载ScatterDesktop

请到https://github.com/GetScatter/ScatterDesktop/releases 下载最新版本

2.安装

我们将在mac系统演示,下载下来后,直接运行安装包,将scatter拖到Applications

3.创建scatter

输入密码点击,点击Create new Scatter。如果之前有备份,可以点击Import from Backup

3.1点击Accept

3.2选择一个目录,作为备份的保存位置

3.3进入主界面

3.4进入设置

3.5进入网络设置

3.6输入scatter密码(新建scatter时设置的密码)

3.7新建网络

3.8输入麒麟网某节点的配置
host: api.kylin.eosbeijing.one
port: 8880
chainId: 5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191


点击保存。

4添加账号

如果没有麒麟网的账号的话,可以先去注册下,并申请测试代币
访问: https://tools.cryptokylin.io/#/tools/create

4.1进入Vault

4.2点击新建New

4.3点击导入

4.4导入麒麟网账号的私钥

4.5粘贴私钥后,进入账号检测,稍等片刻,即可显示,并自动导入,当前私钥下的所有账号。


至此ScatterDesktop的下载,安装,添加测试网络,以及账号,已经演示完毕。

其他帮助

清除ScatterDesktop本地数据

终端运行

find ~ -iname  "scatter*"

查找本地scatter目录,一般是在/Users/你的当前机器登陆的账户/Library/Application\ Support/scatter/
清空目录

rm -rf /Users/你的当前机器登陆的账户/Library/Application\ Support/scatter/

Ethereum QT5 Wallet

https://github.com/almindor/etherwall

Ethereum QT5 Wallet
Etherwall is a free software wallet/front-end for Ethereum.

编译 ScatterDesktop源代码,生成对应平台安装包

下载源代码

git clone https://github.com/GetScatter/ScatterDesktop.git

Mac系统编译

首先确认下当前机器安装的node的版本为v9.8.0,否则无法编译通过。切换版本,可参考《mac os 安装指定版本 node

开始编译

进入源代码目录,安装依赖

yarn install

编译源码

npm run build

生成对应平台安装包
mac:

npm run release-mac

windows:

npm run release-windows

linux:

npm run release-linux

编译成功

suroudeMacBook-Pro:ScatterDesktop surou$ npm run release-mac

> scatter@9.5.0 release-mac /Users/surou/Documents/github/ScatterDesktop
> electron-builder --mac

  • electron-builder version=20.28.4
  • loaded configuration file=package.json ("build" field)
  • electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies

To ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`
  • writing effective config file=release/builder-effective-config.yaml
  • rebuilding native production dependencies platform=darwin arch=x64
  • packaging       platform=darwin arch=x64 electron=2.0.11 appOutDir=release/mac
  • skipped macOS application code signing reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
                                                  0 identities found

                                               Valid identities only
                                                  0 valid identities found
  • building        target=macOS zip arch=x64 file=release/mac-scatter-9.5.0.zip
  • building        target=DMG arch=x64 file=release/mac-scatter-9.5.0.dmg
  • building block map blockMapFile=release/mac-scatter-9.5.0.dmg.blockmap

常见问题

-cannot find specified resource "static/icons/icon.png
cannot find specified resource "static/icons/icon.png", nor relative to "/Users/surou/Documents/github/ScatterDesktop/build", neither relative to project dir ("/Users/surou/Documents/github/ScatterDesktop"),
手动将build/icon.png复制到static/icons

Windows系统编译

  • 下载安装:
    node v9.8.0
    yarn-1.9.4
  • 安装windows编译工具
    npm install --global windows-build-tools
  • 安装项目依赖
    yarn install
  • 开始编译,打包
    npm run build
    npm run release-win

常见错误

  • iojs.lib : fatal error LNK1106
    c:\users\surou\desktop\scatterdesktop\node_modules\keccak\src\libkeccak\KeccakSponge.h : warning C4819: ���ļ����������ڵ�ǰ����ҳ(936)�б�ʾ���ַ����뽫���ļ�����Ϊ Unicode ��ʽ�Է�ֹ���ݶ�ʧ (����Դ�ļ� ..\src\libkeccak\KeccakSponge.c) [C:\Users\Surou\Desktop\ScatterDesktop\node_modules\keccak\build\keccak.vcxproj]
    C:\Users\Surou\.electron-gyp\.node-gyp\iojs-2.0.11\x64\iojs.lib : fatal error LNK1106: �ļ���Ч���������: �޷����ҵ� 0x29851C [C:\Users\Surou\Desktop\ScatterDesktop\node_modules\keccak\build\keccak.vcxproj]
    gyp ERR! build error
    gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onExit (C:\Users\Surou\Desktop\ScatterDesktop\node_modules\node-gyp\lib\build.js:262:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
    gyp ERR! System Windows_NT 10.0.16299
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Surou\\Desktop\\ScatterDesktop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=2.0.11" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
    gyp ERR! cwd C:\Users\Surou\Desktop\ScatterDesktop\node_modules\keccak
    gyp ERR! node -v v9.8.0
    gyp ERR! node-gyp -v v3.8.0

    解决方案:删除 C:\Users\Surou\.electron-gyp
    参考:https://github.com/electron/electron-rebuild/issues/163

  • app-builder.exe exited with code 1
    Error: C:\Users\Surou\Desktop\ScatterDesktop\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code 1
      at ChildProcess.childProcess.once.code (C:\Users\Surou\Desktop\ScatterDesktop\node_modules\builder-util\src\util.ts:254:14)
      at Object.onceWrapper (events.js:272:13)
      at ChildProcess.emit (events.js:180:13)
      at maybeClose (internal/child_process.js:936:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)

    解决方案:删除node_modules,重新yarn install
    参考:https://github.com/electron-userland/electron-builder/issues/2002

  • .bin\babylon: Error: ENOENT: no such file or directory
    Cannot read file C:\Users\Surou\Desktop\ScatterDesktop\node_modules\babylon\.bin\babylon: Error: ENOENT: no such file or directory, open 'C:\Users\Surou\Desktop\ScatterDesktop\node_modules\babylon\.bin\babylon'
      at w (C:\Users\Surou\Desktop\ScatterDesktop\node_modules\app-builder-lib\src\asar\asarUtil.ts:201:11)
      at writeStream.write (C:\Users\Surou\Desktop\ScatterDesktop\node_modules\app-builder-lib\src\asar\asarUtil.ts:203:43)
      at afterWrite (_stream_writable.js:473:3)
      at onwrite (_stream_writable.js:464:7)
      at fs.write (fs.js:2252:5)-win: `electron-builder --win`
      at FSReqWrap.wrapper [as oncomplete] (fs.js:707:5)

    解决方案:安装yarn-1.9.4版本
    参考:https://github.com/GetScatter/ScatterDesktop/issues/165

  • 编译完,运行,界面空白
    经过反编译app.asar,发现缺少dist
    解决方案:先运行npm run build,在运行npm run release-win

其他

  • 反编译asar
    npm install -g asar
    asar extract app.asar ./

mac os 安装指定版本 node

由于编译ScatterDesktop时,使用brew install node安装的node为最新版本v11+,由于对应的源代码没有做兼容,导致编译出错。所以才有此文,需要安装对应需要的版本。

node版本管理工具nvm

安装nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash

此时会生成 ~/.bash_profile,添加nvm 到环境变量。
刷新环境变量,使其生效

source ~/.bash_profile

此时打开终端,输入nvm会输出,对应的帮助信息。

使用nvm安装node

所需命令如下

$ nvm ls-remote 查看 所有的node可用版本
$ nvm install xxx 下载你想要的版本
$ nvm use xxx 使用指定版本的node 
$ nvm alias default xxx 每次启动终端都使用该版本的node 

由于我们目前需要的是 node v9.8.0
所以执行命令如下

$ nvm install v9.8.0
$ nvm use v9.8.0
$ nvm alias default v9.8.0

查看node版本 v9.8.0

node -v