Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Sep 14, 2017
2 parents bb27b74 + 5f1a667 commit 684d793
Show file tree
Hide file tree
Showing 390 changed files with 13,253 additions and 7,578 deletions.
28 changes: 20 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"extends": "airbnb-base",
"extends": [
"airbnb-base",
"plugin:react/recommended"
],
"plugins": [
"import"
],
"globals": {
"angular": true,
"app": true,
"describe": true,
"it": true,
"beforeEach": true,
"afterEach": true,
"ipc": true,
"PRODUCTION": true
"PRODUCTION": true,
"TEST": true,
},
"env": {
"browser": true,
Expand All @@ -27,12 +33,18 @@
]
}],

"no-loop-func": "off",
"react/prop-types": "off",
"no-plusplus": "off",
"no-restricted-properties": "off",
"no-return-assign": "off",
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"import/no-extraneous-dependencies": ["error", {
devDependencies: [
"./src/**/*.test.js",
"./features/*/*.js",
"./src/**/stories.js",
"./src/tests.js"
]
}
],
"no-param-reassign": "off"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ app/*.map
app/app.js
.vscode
.idea
blockchain_explorer.db.gz
15 changes: 15 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { configure } from '@storybook/react';
import '../src/components/app/app.css';

function loadStories() {
require('../src/components/account/stories');
require('../src/components/dialog/stories');
require('../src/components/formattedNumber/stories');
require('../src/components/toaster/stories');
require('../src/components/signMessage/stories');
require('../src/components/send/stories');
require('../src/components/spinner/stories');
require('../src/components/verifyMessage/stories');
}

configure(loadStories, module);
5 changes: 5 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = require('../webpack.config.js');

module.exports = config({
test: true,
});
839 changes: 839 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# How to contribute

First of all, thank you for taking the time to contribute to this project. We've tried to make a stable project and try to fix bugs and add new features continuously. You can help us do more.

Before you start, read the **README.md** file for info on the project and how to set it up.

## Getting started

### Check out the roadmap

We have some functionalities in mind and we have issued them and there is a *milestone* label available on the issue. If there is a bug or a feature that is not listed in the **issues** page or there is no one assigned to the issue, feel free to fix/add it! Although it's better to discuss it in the issue or create a new issue for it so there is no conflicting code.

### Filing issues

Before starting work on a larger idea not discussed in an issue we recommend starting one to iron out your approach to implementation. PRs with conflicting ideas regarding architecture or other aspects of the project may be rejected. We appreciate any and all ideas you contribute providing they're discussed in a respectful and constructive manner.

Issues created that are not relevant to this project will be closed immediately - this is purely for efficiency as we don't have time to address and or move all of them to their correct place.

### Writing some code!

Contributing to a project on Github is pretty straight forward. If this is you're first time, these are the steps you should take.

- Fork this repo.

And that's it! Read the code available and apply your changes according to the issue you're working on! You're change should not break the existing code and should pass the tests. Start from the branch **development**, create a new branch under the name of the issue and work in there.

When you're done, submit a pull request and for one of the maintainers to check it out. We would let you know if there is any problem or any changes that should be considered.

### Tests

We've written tests and you can run them to assure the stability of the code, just try running `npm test`. If you're adding a new functionality please include tests for it.

### Documentation

Every chunk of code that may be hard to understand has some comments above it. If you write some new code or change some part of the existing code in a way that it would not be functional without changing it's usages, it needs to be documented.
25 changes: 0 additions & 25 deletions Gruntfile.js

This file was deleted.

39 changes: 32 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ node('lisk-nano-01'){
try {
sh '''#!/bin/bash
cd ~/lisk-test-nano
bash lisk.sh rebuild -0
bash lisk.sh rebuild -f /home/lisk/lisk-test-nano/blockchain_explorer.db.gz
'''
} catch (err) {
currentBuild.result = 'FAILURE'
Expand All @@ -42,15 +42,37 @@ node('lisk-nano-01'){
}
}

stage ('Build Nano') {
stage ('Install npm dependencies') {
try {
sh '''#!/bin/bash
# Install Electron
npm install
# Build nano
cd $WORKSPACE
npm install
'''
} catch (err) {
currentBuild.result = 'FAILURE'
milestone 1
error('Stopping build, npm install failed')
}
}

stage ('Run Eslint') {
try {
sh '''
cd $WORKSPACE
npm run eslint
'''
} catch (err) {
currentBuild.result = 'FAILURE'
error('Stopping build, Eslint failed')
}
}

stage ('Build Nano') {
try {
sh '''#!/bin/bash
# Add coveralls config file
cp ~/.coveralls.yml-nano .coveralls.yml
Expand All @@ -68,9 +90,13 @@ node('lisk-nano-01'){
try {
sh '''
export ON_JENKINS=true
# Run test
cd $WORKSPACE
npm run test
# Submit coverage to coveralls
cat coverage/*/lcov.info | coveralls -v
'''
} catch (err) {
currentBuild.result = 'FAILURE'
Expand All @@ -81,9 +107,6 @@ node('lisk-nano-01'){
stage ('Start Dev Server and Run Tests') {
try {
sh '''
# Prepare lisk core for testing
bash ~/tx.sh
# Run Dev build and Build
cd $WORKSPACE
export NODE_ENV=
Expand All @@ -94,7 +117,6 @@ node('lisk-nano-01'){
export DISPLAY=:99
Xvfb :99 -ac -screen 0 1280x1024x24 &
./node_modules/protractor/bin/webdriver-manager update
./node_modules/protractor/bin/webdriver-manager start &
# Run End to End Tests
npm run e2e-test
Expand All @@ -106,6 +128,9 @@ node('lisk-nano-01'){
rm -rf /tmp/.X0-lock || true
pkill -f webpack -9 || true
# Cleanup - delete all files on success
cd $WORKSPACE
rm -rf *
'''
} catch (err) {
currentBuild.result = 'FAILURE'
Expand Down
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lisk Nano

[![Build Status](https://jenkins.lisk.io/buildStatus/icon?job=Nano-Pipeline/development)](https://jenkins.lisk.io/job/Nano-Pipeline/development)
[![Build Status](https://jenkins.lisk.io/buildStatus/icon?job=lisk-nano/development)](https://jenkins.lisk.io/job/lisk-nano/job/development)
[![Coverage Status](https://coveralls.io/repos/github/LiskHQ/lisk-nano/badge.svg?branch=development)](https://coveralls.io/github/LiskHQ/lisk-nano?branch=development)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)

Expand All @@ -15,6 +15,16 @@ npm run dev

Open http://localhost:8080

For ease of development, you can setItem in localStorage to prefill a passphrase, e.g.:
```
localStorage.setItem('passphrase', 'wagon stock borrow episode laundry kitten salute link globe zero feed marble')
```

And then you can setItem in localStorage to login automatically
```
localStorage.setItem('autologin', true)
```

## Build

```
Expand All @@ -39,9 +49,9 @@ Build package for Windows.
npm run dist:win
```

### Mac OS X
### macOS

Build package for Mac OS X.
Build package for macOS.

```
npm run dist:mac
Expand Down Expand Up @@ -71,17 +81,15 @@ npm run test-live

### Setup

To setup protractor as described on http://www.protractortest.org/#/ run:
Setup protractor

```
npm install -g protractor
webdriver-manager update
webdriver-manager start
./node_modules/protractor/bin/webdriver-manager update
```

Setup a lisk test node to run on localhost:4000 as described in https://github.com/LiskHQ/lisk#tests

Make sure that the Lisk version of the node matches version in https://github.com/LiskHQ/lisk-nano/blob/development/src/app/services/peers/peer.js#L16
And run it with [pm2](http://pm2.keymetrics.io/).

### Run

Expand All @@ -98,13 +106,26 @@ Run the protractor tests (replace `~/git/lisk/` with your path to lisk core):
npm run e2e-test
```

## Launch React Storybook

To launch storybook sandbox with components run
```
npm run storybook
```
and go to

http://localhost:6006/



## Authors

- Ricardo Ferro <ricardo.ferro@gmail.com>
- Oliver Beddows <oliver@lightcurve.io>
- Vít Stanislav <vit@lightcurve.io>
- Tobias Schwarz <tobias@lightcurve.io>
- Ali Haghighatkhah <ali@lightcurve.io>
- Yashar Ayari <darkyashi@gmail.com>

## License

Expand Down
4 changes: 2 additions & 2 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function createWindow() {
{
label: 'Report Issue...',
click() {
electron.shell.openExternal('https://github.com/LiskHQ/lisk-nano/issues/new');
electron.shell.openExternal('https://lisk.zendesk.com/hc/en-us/requests/new');
},
},
{
Expand Down Expand Up @@ -153,7 +153,7 @@ function createWindow() {

win.loadURL(`file://${__dirname}/dist/index.html`);

win.on('closed', () => win = null);
win.on('closed', () => { win = null; });

const selectionMenu = Menu.buildFromTemplate([
{ role: 'copy' },
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-nano",
"version": "1.0.2",
"version": "1.1.0",
"description": "Lisk Nano",
"main": "main.js",
"author":{
Expand Down
22 changes: 10 additions & 12 deletions e2e-test-setup.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
#!/bin/bash
# Purpose of this script is to clean lisk database and create some tranactions
# Purpose of this script is to clean lisk database and create some tranactions

if [ -z "$1" ]
then
echo "One required argument missing: path to folder with lisk core app.js"
exit 1
fi

if [ ! -f blockchain_explorer.db.gz ]; then
wget https://downloads.lisk.io/lisk-explorer/dev/blockchain_explorer.db.gz
fi

pwd=`pwd`
cd $1
forever stop app.js
dropdb lisk_test && createdb lisk_test
forever start app.js
pm2 stop app.js
dropdb lisk_test
createdb lisk_test
gunzip -fcq "$pwd/blockchain_explorer.db.gz" | psql -d lisk_test
pm2 start app.js
sleep 5
cd $pwd

for i in {1..20}
do
curl -k -H "Content-Type: application/json" -X PUT -d '{"secret":"wagon stock borrow episode laundry kitten salute link globe zero feed marble","amount":'"$i"000000000',"recipientId":"537318935439898807L"}' http://localhost:4000/api/transactions
echo ''
done
curl -k -H "Content-Type: application/json" -X PUT -d '{"secret":"wagon stock borrow episode laundry kitten salute link globe zero feed marble","amount":'10000000000',"recipientId":"544792633152563672L"}' http://localhost:4000/api/transactions
curl -k -H "Content-Type: application/json" -X PUT -d '{"secret":"wagon stock borrow episode laundry kitten salute link globe zero feed marble","amount":'10000000000',"recipientId":"4264113712245538326L"}' http://localhost:4000/api/transactions
sleep 5

0 comments on commit 684d793

Please sign in to comment.