Giter Site home page Giter Site logo

alvarlaigna / lisk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liskhq/lisk-sdk

0.0 3.0 0.0 17.23 MB

๐Ÿ“Ÿ Lisk blockchain application platform

Home Page: https://lisk.io/

License: GNU General Public License v3.0

JavaScript 99.20% PLpgSQL 0.80%

lisk's Introduction

Lisk

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/.

Build Status Coverage Status License: GPL v3 Join the chat at https://gitter.im/LiskHQ/lisk Dependency Status devDependency Status

Prerequisites - In order

This sections provides details on what you need install on your system in order to run Lisk.

System Install

  • Tool chain components -- Used for compiling dependencies

    • Ubuntu/Debian:

      sudo apt-get update
      sudo apt-get install -y python build-essential curl automake autoconf libtool
      
    • MacOS 10.12-10.13 (Sierra/High Sierra):

      Make sure that you have both XCode and Homebrew installed on your machine.

      Update homebrew and install dependencies:

      brew update
      brew doctor
      brew install curl automake autoconf libtool
      
  • Git (https://github.com/git/git) -- Used for cloning and updating Lisk

    • Ubuntu/Debian:

      sudo apt-get install -y git
      
    • MacOS 10.12-10.13 (Sierra/High Sierra):

      brew install git
      
  • Node.js serves as the underlying engine for code execution.

    Install System wide via package manager:

    • Ubuntu/Debian:

      curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
      sudo apt-get install -y nodejs
      
    • MacOS 10.12-10.13 (Sierra/High Sierra):

      brew install [email protected]
      
  • (Recommended) Install using a version manager such as nvm.

    1. Install nvm following their instructions (https://github.com/creationix/nvm#installation)
    2. Install the correct version of Node.js using nvm:
    nvm install 6.14.1
    
  • (Recommended) PM2 (https://github.com/Unitech/pm2) -- PM2 manages the node process for Lisk

    npm install -g pm2
    

PostgreSQL (version 9.6):

  • Ubuntu/Debian:

    curl -sL "https://downloads.lisk.io/scripts/setup_postgresql.Linux" | bash -
    sudo -u postgres createuser --createdb $USER
    createdb lisk_test
    createdb lisk_main
    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';"
    
  • MacOS 10.12-10.13 (Sierra/High Sierra):

    brew install [email protected]
    initdb /usr/local/var/postgres -E utf8
    brew services start [email protected]
    createdb lisk_test
    createdb lisk_main
    

Installing Redis

  • Ubuntu/Debian:

    sudo apt-get install redis-server
    

    Start redis:

    service redis start
    

    Stop redis:

    service redis stop
    
  • MacOS 10.12-10.13 (Sierra/High Sierra):

    brew install redis
    

    Start redis:

    brew services start redis
    

    Stop redis:

    brew services stop redis
    

NOTE: Lisk does not run on the redis default port of 6379. Instead it is configured to run on port: 6380. Because of this, in order for Lisk to run, you have one of two options:

  1. Change the Lisk configuration

Update the redis port configuration in both config.json and test/data/config.json. Note that this is the easiest option, however, be mindful of reverting the changes should you make a pull request.

  1. Change the Redis launch configuration

Update the launch configuration file on your system. Note that their a number of ways to do this. The following is one way:

  1. Stop redis-server
  2. Edit the file redis.conf and change: port 6379 to port 6380
    • Ubuntu/Debian: /etc/redis/redis.conf
    • MacOS: /usr/local/etc/redis.conf
  3. Start redis-server

Now confirm that redis is running on port 6380:

redis-cli -p 6380
ping

And you should get the result PONG.

Installation Steps

Clone the Lisk repository using git and initialize the modules.

git clone https://github.com/LiskHQ/lisk.git
cd lisk
git checkout master
npm install

Managing Lisk

To test that Lisk is built and configured correctly, issue the following command:

node app.js

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.

pm2 start --name lisk app.js

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

pm2 show lisk

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

pm2 stop lisk

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

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

Tests

Preparing Node

  1. Recreate the database in order to run the tests against a new blockchain:
dropdb lisk_test
createdb lisk_test
  1. Ensure Lisk is configured to run on the same local network used by the tests. Replace the files config.json and genesis_block.json with those located under the test/data directory:
cp test/data/config.json test/data/genesis_block.json .
  1. Launch Lisk (runs on port 4000):
NODE_ENV=test node app.js

Running Tests

Tests are run using the following command:

npm test -- mocha:<tag>:<suite>:[section]
  • Where tag can be one of slow | unstable | untagged | extensive (required)
  • Where suite can be one of unit | functional | integration (required)
  • Where section depending of the chosen suite can be:
    • when functional --> get | post | ws | system (optional)

Individual test files can be run using the following command:

npm run mocha -- path/to/test.js

Genesis Account

The master passphrase for the genesis block used by the tests is as follows:

wagon stock borrow episode laundry kitten salute link globe zero feed marble

Contributors

https://github.com/LiskHQ/lisk/graphs/contributors

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/.


This program also incorporates work previously released with lisk 0.9.11 (and earlier) versions under the MIT License. To comply with the requirements of that license, the following permission notice, applicable to those parts of the code only, is included below:

Copyright ยฉ 2016-2018 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:

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

lisk's People

Contributors

karmacoma avatar maciejbaj avatar 4miners avatar manugowda avatar diego-g avatar nazarhussain avatar tschakki avatar vitaly-t avatar sargekhan avatar lucasisasmendi avatar jondubois avatar fix avatar nazgolze avatar willclarktech avatar thegoldeneye avatar francoilol avatar webmaster128 avatar dakk avatar tobiaslins avatar chiptus avatar m-schmoock avatar isabello avatar drouillard avatar realrhys avatar akio0o avatar mrv777 avatar fchavant avatar slaweet avatar 34ro avatar darless avatar

Watchers

Alvar Laigna avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.