Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge branch '0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Beddows committed Apr 12, 2017
2 parents 9107b70 + 5fd7087 commit 8dcc493
Show file tree
Hide file tree
Showing 57 changed files with 4,507 additions and 3,298 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dist: 'trusty'
language: node_js
node_js:
- '6.9.5'
- '6.10.1'
cache:
directories:
- test/lisk-js
Expand All @@ -28,8 +28,10 @@ env:
- HOST=http://0.0.0.0:4000
- COVERALLS_PARALLEL=true
matrix:
# Longest duration first
- TEST=test/api/peer.transactions.stress.js TEST_TYPE='FUNC'
- TEST=test/api/peer.transactions.votes.js TEST_TYPE='FUNC'
- TEST=test/unit/logic TEST_TYPE='UNIT'
- TEST=test/api/delegates.js TEST_TYPE='FUNC'
- TEST=test/api/accounts.js TEST_TYPE='FUNC'
- TEST=test/api/blocks.js TEST_TYPE='FUNC'
Expand All @@ -49,11 +51,9 @@ env:
- TEST=test/api/transactions.js TEST_TYPE='FUNC'

- TEST=test/unit/helpers TEST_TYPE='UNIT'
- TEST=test/unit/logic TEST_TYPE='UNIT'
- TEST=test/unit/modules TEST_TYPE='UNIT'
script: 'npm run travis'
after_success:
- bash .travis/after-success.sh $TRAVIS_BUILD_NUMBER ${TRAVIS_JOB_NUMBER#*.} $TEST_TYPE $TRAVIS_BUILD_DIR $TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_BRANCH;
after_failure:
- cat .app.log

3 changes: 3 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var util = require('util');
module.exports = function (grunt) {
var files = [
'logger.js',
'api/**/*.js',
'helpers/**/*.js',
'modules/*.js',
'logic/*.js',
Expand Down Expand Up @@ -44,6 +45,7 @@ module.exports = function (grunt) {
util.format('cp %s/config.json %s', __dirname, version_dir),
util.format('cp %s/package.json %s', __dirname, version_dir),
util.format('cp %s/genesisBlock.json %s', __dirname, version_dir),
util.format('cp %s/LICENSE %s', __dirname, version_dir),
util.format('mkdir -p %s/sql/migrations', version_dir),
util.format('cp %s/sql/*.sql %s/sql/', __dirname, version_dir),
util.format('cp %s/sql/migrations/*.sql %s/sql/migrations/', __dirname, version_dir),
Expand Down Expand Up @@ -110,6 +112,7 @@ module.exports = function (grunt) {
fix: false
},
target: [
'api',
'helpers',
'modules',
'logic',
Expand Down
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

73 changes: 48 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@

Lisk is a next generation crypto-currency and decentralized application platform, written entirely in JavaScript. For more information please refer to our website: https://lisk.io/.

[![Join the chat at https://gitter.im/LiskHQ/lisk](https://badges.gitter.im/LiskHQ/lisk.svg)](https://gitter.im/LiskHQ/lisk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/LiskHQ/lisk.svg?branch=development)](https://travis-ci.org/LiskHQ/lisk)
[![Coverage Status](https://coveralls.io/repos/github/LiskHQ/lisk/badge.svg?branch=development)](https://coveralls.io/github/LiskHQ/lisk?branch=development)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Join the chat at https://gitter.im/LiskHQ/lisk](https://badges.gitter.im/LiskHQ/lisk.svg)](https://gitter.im/LiskHQ/lisk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

**NOTE:** The following information is applicable to: **Ubuntu 14.04 (LTS) - x86_64**.
**NOTE:** The following information is applicable to: **Ubuntu 14.04, 16.04 (LTS) or 16.10 - x86_64**.

## Prerequisites - In order

- Tool chain components -- Used for compiling dependencies

`sudo apt-get install -y python build-essential curl automake autoconf libtool`

- Git (<https://github.com/git/git>) -- Used for cloning and updating Lisk

`sudo apt-get install -y git`

- Nodejs v6.9.4 (<https://nodejs.org/>) -- Nodejs serves as the underlying engine for code execution.
- Node.js (<https://nodejs.org/>) -- Node.js serves as the underlying engine for code execution.

System wide via package manager:

```
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
```

Locally using [nvm](https://github.com/creationix/nvm):

```
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm install v6.9.4
nvm install v6.10.1
```
- Install PostgreSQL (version 9.6.1):

- Install PostgreSQL (version 9.6.2):

```
curl -sL "https://downloads.lisk.io/scripts/setup_postgresql.Linux" | bash -
Expand All @@ -35,18 +45,18 @@ Lisk is a next generation crypto-currency and decentralized application platform
sudo -u postgres psql -d lisk_test -c "alter user "$USER" with password 'password';"
sudo -u postgres psql -d lisk_main -c "alter user "$USER" with password 'password';"
```

- Bower (<http://bower.io/>) -- Bower helps to install required JavaScript dependencies.

`npm install -g bower`

- Grunt.js (<http://gruntjs.com/>) -- Grunt is used to compile the frontend code and serves other functions.

`npm install -g grunt`

- Forever (<https://github.com/foreverjs/forever>) -- Forever manages the node process for Lisk (Optional)
`npm install -g grunt-cli`

`npm install -g forever`
- PM2 (<https://github.com/Unitech/pm2>) -- PM2 manages the node process for Lisk (Optional)

`npm install -g pm2`

## Installation Steps

Expand Down Expand Up @@ -89,24 +99,24 @@ To test that Lisk is built and configured correctly, run the following command:

`node app.js`

In a browser navigate to: <http://localhost:7000>. If Lisk is running on a remote system, switch `localhost` for the external IP Address of the machine.
In a browser navigate to: <http://localhost:8000> (for the mainnet) or <http://localhost:7000> (for the testnet). If Lisk is running on a remote system, switch `localhost` for the external IP Address of the machine.

Once the process is verified as running correctly, `CTRL+C` and start the process with `forever`. This will fork the process into the background and automatically recover the process if it fails.
Once the process is verified as running correctly, `CTRL+C` and start the process with `pm2`. This will fork the process into the background and automatically recover the process if it fails.

`forever start app.js`
`pm2 start --name lisk app.js`

After the process is started its runtime status and log location can be found by issuing this statement:
After the process is started, its runtime status and log location can be retrieved by issuing the following command:

`forever list`
`pm2 show lisk`

To stop Lisk after it has been started with `forever`, issue the following command:
To stop Lisk after it has been started with `pm2`, issue the following command:

`forever stop app.js`
`pm2 stop lisk`

**NOTE:** The **port**, **address** and **config-path** can be overridden by providing the relevant command switch:

```
forever start app.js -p [port] -a [address] -c [config-path]
pm2 start --name lisk app.js -- -p [port] -a [address] -c [config-path]
```

## Tests
Expand Down Expand Up @@ -156,16 +166,29 @@ npm test -- test/lib/transactions.js
- Boris Povod <boris@crypti.me>
- Pavel Nekrasov <landgraf.paul@gmail.com>
- Sebastian Stupurac <stupurac.sebastian@gmail.com>
- Oliver Beddows <oliver@lisk.io>
- Oliver Beddows <oliver@lightcurve.io>
- Isabella Dell <isabella@lightcurve.io>
- Marius Serek <mariusz@serek.net>
- Maciej Baj <maciej@lightcurve.io>

## License

The MIT License (MIT)
Copyright © 2016-2017 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](https://github.com/LiskHQ/lisk/tree/master/LICENSE) along with this program. If not, see <http://www.gnu.org/licenses/>.

***

This program also incorporates work previously released with lisk `0.7.0` (and earlier) versions under the [MIT License](https://opensource.org/licenses/MIT). To comply with the requirements of that license, the following permission notice, applicable to those parts of the code only, is included below:

Copyright (c) 2016-2017 Lisk
Copyright (c) 2014-2015 Crypti
Copyright © 2016-2017 Lisk Foundation
Copyright © 2015 Crypti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Expand Down
38 changes: 38 additions & 0 deletions api/http/accounts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

var Router = require('../../helpers/router');
var httpApi = require('../../helpers/httpApi');
var schema = require('../../schema/accounts.js');

// Constructor
function AccountsHttpApi (accountsModule, app) {

var router = new Router();

router.map(accountsModule.shared, {
'post /open': 'open',
'get /getBalance': 'getBalance',
'get /getPublicKey': 'getPublickey',
'post /generatePublicKey': 'generatePublicKey',
'get /delegates': 'getDelegates',
'get /delegates/fee': 'getDelegatesFee',
'put /delegates': 'addDelegates',
'get /': 'getAccount'
});

router.map(accountsModule.internal, {
'get /count': 'count'
});

if (process.env.DEBUG && process.env.DEBUG.toUpperCase() === 'TRUE') {
router.map(accountsModule.internal, {'get /getAllAccounts': 'getAllAccounts'});
}

if (process.env.TOP && process.env.TOP.toUpperCase() === 'TRUE') {
router.get('/top', httpApi.middleware.sanitize('query', schema.top, accountsModule.internal.top));
}

httpApi.registerEndpoint('/api/accounts', app, router, accountsModule.isLoaded);
}

module.exports = AccountsHttpApi;
29 changes: 29 additions & 0 deletions api/http/blocks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict';

var Router = require('../../helpers/router');
var httpApi = require('../../helpers/httpApi');

// Constructor
function BlocksHttpApi (blocksModule, app) {

var router = new Router();

router.map(blocksModule.shared, {
'get /get': 'getBlock',
'get /': 'getBlocks',
'get /getBroadhash': 'getBroadhash',
'get /getEpoch': 'getEpoch',
'get /getHeight': 'getHeight',
'get /getNethash': 'getNethash',
'get /getFee': 'getFee',
'get /getFees': 'getFees',
'get /getMilestone': 'getMilestone',
'get /getReward': 'getReward',
'get /getSupply': 'getSupply',
'get /getStatus': 'getStatus'
});

httpApi.registerEndpoint('/api/blocks', app, router, blocksModule.isLoaded);
}

module.exports = BlocksHttpApi;
36 changes: 36 additions & 0 deletions api/http/dapps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

var Router = require('../../helpers/router');
var httpApi = require('../../helpers/httpApi');
var schema = require('../../schema/dapps');

// Constructor
function DappsHttpApi (dappsModule, app) {

var router = new Router();

router.map(dappsModule.internal, {
'get /categories': 'categories',
'get /installed': 'installed',
'get /installedIds': 'installedIds',
'get /ismasterpasswordenabled': 'isMasterPasswordEnabled',
'get /installing': 'installing',
'get /uninstalling': 'uninstalling',
'get /launched': 'launched',
'post /launch': 'launch',
'put /transaction': 'addTransactions',
'put /withdrawal': 'sendWithdrawal'
});

router.get('/', httpApi.middleware.sanitize('query', schema.list, dappsModule.internal.list));
router.put('/', httpApi.middleware.sanitize('body', schema.put, dappsModule.internal.put));
router.get('/get', httpApi.middleware.sanitize('query', schema.get, dappsModule.internal.get));
router.get('/search', httpApi.middleware.sanitize('query', schema.search, dappsModule.internal.search));
router.post('/install', httpApi.middleware.sanitize('body', schema.install, dappsModule.internal.install));
router.post('/uninstall', httpApi.middleware.sanitize('body', schema.uninstall, dappsModule.internal.uninstall));
router.post('/stop', httpApi.middleware.sanitize('body', schema.stop, dappsModule.internal.stop));

httpApi.registerEndpoint('/api/dapps', app, router, dappsModule.isLoaded);
}

module.exports = DappsHttpApi;
39 changes: 39 additions & 0 deletions api/http/delegates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use strict';

var Router = require('../../helpers/router');
var httpApi = require('../../helpers/httpApi');

// Constructor
function DelegatesHttpApi (delegatesModule, app) {

var router = new Router();

router.map(delegatesModule.shared, {
'get /count': 'count',
'get /search': 'search',
'get /voters': 'getVoters',
'get /get': 'getDelegate',
'get /': 'getDelegates',
'get /fee': 'getFee',
'get /forging/getForgedByAccount': 'getForgedByAccount',
'put /': 'addDelegate',
'get /getNextForgers': 'getNextForgers'
});

router.map(delegatesModule.internal, {
'post /forging/enable': 'forgingEnable',
'post /forging/disable': 'forgingDisable',
'get /forging/status': 'forgingStatus'
});

if (process.env.DEBUG) {
router.map(delegatesModule.internal, {
'get /forging/disableAll': 'forgingDisableAll',
'get /forging/enableAll': 'forgingEnableAll'
});
}

httpApi.registerEndpoint('/api/delegates', app, router, delegatesModule.isLoaded);
}

module.exports = DelegatesHttpApi;
24 changes: 24 additions & 0 deletions api/http/loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

var Router = require('../../helpers/router');
var httpApi = require('../../helpers/httpApi');

// Constructor
function LoaderHttpApi (loaderModule, app) {

var router = new Router();

router.map(loaderModule.shared, {
'get /status': 'status',
'get /status/sync': 'sync'
});

router.get('/status/ping', function (req, res) {
var status = loaderModule.internal.statusPing();
return res.status(status ? 200 : 503).json({success: status});
});

httpApi.registerEndpoint('/api/loader', app, router, loaderModule.isLoaded);
}

module.exports = LoaderHttpApi;
21 changes: 21 additions & 0 deletions api/http/multisignatures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

var Router = require('../../helpers/router');
var httpApi = require('../../helpers/httpApi');

// Constructor
function MultisignaturesHttpApi (mutlisignaturesModule, app) {

var router = new Router();

router.map(mutlisignaturesModule.shared, {
'get /pending': 'pending',
'post /sign': 'sign',
'put /': 'addMultisignature',
'get /accounts': 'getAccounts'
});

httpApi.registerEndpoint('/api/multisignatures', app, router, mutlisignaturesModule.isLoaded);
}

module.exports = MultisignaturesHttpApi;
Loading

0 comments on commit 8dcc493

Please sign in to comment.