LiskHQ / Lisk Desktop
Programming Languages
Projects that are alternatives of or similar to Lisk Desktop
Lisk Desktop
For Contributors
Please see CONTRIBUTING_GUIDE.md for more information.
Development
Using Commercial Fonts
Basier Circle
and Gilroy
used in the production version are commercial fonts. This repository only contains open fonts and uses Open Sans
as a replacement for the commercial ones.
If you have licensed copies of Basier Circle
and Gilroy
, you can add them to fonts folder. If you don't have the fonts, you need to remove lines 25 - 81 of type.css. After that, the build
and dev
npm scripts run without any errors.
Setup environemnt
git clone https://github.com/LiskHQ/lisk-desktop.git
cd lisk-desktop
npm install
npm run dev
Run on browser
For ease of development, you can set the following query string to see network options in login page:
http://localhost:8080/#/?showNetwork=true
If you are actively developing in a specific route, and want to be automatically signed in every time you reload the page, please add the following input pairs to your localStorage:
loginKey: a valid passphrase
Add the above pair using the storage tab in your dev tools or via JavaScript command:
localStorage.setItem('loginKey', 'wagon stock borrow episode laundry kitten salute link globe zero feed marble') // desired account passphrase
When developing with hardware wallet, this will sign you in using the first account on the first connected hardware wallet:
localStorage.setItem('hwWalletAutoLogin', true);
You can use the same approach to define a desired network to which Lisk Desktop connects:
localStorage.setItem('liskCoreUrl', 'http://localhost:4000') // desired node to log in into
Build
Production build
To build the project simply run
npm run build
Under the hood, this script runs
npm run build-prod
to build the React app under src/
and
npm run build-electron
to build the electron app under app/
using webpack. You can run the above scripts individually if you're looking to see the changes solely on one of the two said applications.
Run Electron
If you have already built the application as described above, you can launch Electron using
npm run start
Run with parameters
To launch a version which supports hardware wallets, you can run
npm run dev-hardware-wallet
or to launch electron and receive live updates from already running webpack-dev-server
on port 8080
and you can run
LISK_HUB_URL="http://localhost:8080" DEBUG=true npm run start
This comes with Redux dev tools.
Distribution
Windows
Build package for Windows (on Windows in Git BASH).
npm run pack:win
macOS
Build package for macOS (on macOs)
npm run pack
Linux
Build package for Linux (on Linux).
npm run pack
Testing
Unit tests
Single run
npm run test
Run each time a file changes
npm run test-live
E2E tests
In order to run e2e tests you need to install lisk-core
Setup core
Setup a lisk test node as described in Preparing Node headline under the tests section of Lisk Framework README.
Run lisk test node with pm2 on localhost:4000
Run
Start the development version of Lisk:
npm run dev
Apply blockchain snapshot
./test/e2e-test-setup.sh ~/git/lisk/
(replace ~/git/lisk/
with your path to lisk core)
Run e2e tests
npm run cypress:run
React Storybook
To launch storybook sandbox with components run
npm run storybook
and navigate to
Directory Layout
โโโ __mocks__/ # Modules used to mock dependencies for testing purpose.
โโโ .storybook/ # React storybooks reside here.
โโโ app/ # Electron based application that launces the react app.
โโโ build/ # Build specific materials.
โโโ config/ # Automation scripts (Webpack configurations, i18n scanner, etc)
โโโ coverage/ # Results of Jest test coverage.
โโโ dist/ # Platform specific built outputs.
โโโ docs/ # Project documentations such as contribution guides and development guidelines.
โโโ i18n/ # Localization files inluding setup scripts and translation json files.
โโโ libs/ # Modules which can be consumed individually in other projects.
โโโ node_modules/ # 3rd-party libraries and utilities.
โโโ src/ # Application source code.
โ โโโ actions/ # Store actions reside here and are broken into script files dedicated to each system entity.
โ โโโ app/ # The bootstrap React application
โ โโโ assets/ # Static files (images, fonts, etc)
โ โโโ components/ # React presentational components are located here.
โ โ โโโ screens/ # These are the component that represent screens with dedicated URL.
โ โ โโโ shared/ # These are the React components used at least in 2 other components (calendar, liskAmount, etc)
โ โ โโโ toolbox/ # Basic elements with basic styles and functionality which are used in numerous places (button, input, etc)
โ โโโ constants/ # Names, addresses, static configurations and other values used throughout the application
โ โโโ context/ # React context configuration files
โ โโโ hooks/ # React custom hooks
โ โโโ store/ # Redux store resides here.
โ โ โโโ middlewares/ # All the Redux middlewares are places here and have their dedicated script files based on the system entities.
โ โ โโโ reducers/ # Redux reducers are located here. similar to actions and reducers, they are placed in script files named after the entity they represent.
โ โโโ utils/ # Utility functions
โโโtest/ # E2E tests written with Cypress.io and Cucumber; also some helpers used by unit test that live in /src
Contributors
See contributors section.
License
Copyright ยฉ 2016-2018 Lisk Foundation
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.