1. 每日区块链首页
  2. 学院
  3. 技术文档

A Blockchain Application Platform —Lisk Documentation

System Install

  • Tool chain components — Used for compiling dependencies
    • Ubuntu/Debian:
      A Blockchain Application Platform —Lisk Documentation
    • 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:
      A Blockchain Application Platform —Lisk Documentation
  • Git (https://github.com/git/git) — Used for cloning and updating Lisk
    • Ubuntu/Debian:
      A Blockchain Application Platform —Lisk Documentation
    • MacOS 10.12-10.13 (Sierra/High Sierra):
      A Blockchain Application Platform —Lisk Documentation

Node.js (https://nodejs.org/)

  • Node.js serves as the underlying engine for code execution.Install System wide via package manager:
    • A Blockchain Application Platform —Lisk Documentation
    • MacOS 10.12-10.13 (Sierra/High Sierra):
      A Blockchain Application Platform —Lisk Documentation
  • (Recommended) Install n — Used for Node.js version management
    A Blockchain Application Platform —Lisk Documentation
  • (Recommended) PM2 (https://github.com/Unitech/pm2) — PM2 manages the node process for Lisk
    A Blockchain Application Platform —Lisk Documentation

Special note about NPM 5

Due to an issue with NPM 5.4.x and higher, node-sodium currently cannot be built. Therefore it is recommended to fixate the local NPM version at 5.3.x if you are running NPM 5.4.x or higher.

All Systems – This may require sudo depending on your environment:
A Blockchain Application Platform —Lisk Documentation

PostgreSQL (version 9.6):

  • Ubuntu/Debian:
    A Blockchain Application Platform —Lisk Documentation
  • MacOS 10.12-10.13 (Sierra/High Sierra):
    A Blockchain Application Platform —Lisk Documentation

Installing Redis

  • Ubuntu/Debian:
    A Blockchain Application Platform —Lisk Documentation
    Start redis:
    A Blockchain Application Platform —Lisk DocumentationStop redis:
    A Blockchain Application Platform —Lisk Documentation
  • MacOS 10.12-10.13 (Sierra/High Sierra):
    A Blockchain Application Platform —Lisk Documentation
    Start redis:
    A Blockchain Application Platform —Lisk DocumentationStop redis:

    A Blockchain Application Platform —Lisk Documentation
    

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/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
  1. Start redis-server

Now confirm that redis is running on port 6380:
A Blockchain Application Platform —Lisk Documentation

And you should get the result PONG.

Installation Steps

Clone the Lisk repository using git and initialize the modules.
A Blockchain Application Platform —Lisk Documentation

Managing Lisk

To test that Lisk is built and configured correctly, issue the following command:
A Blockchain Application Platform —Lisk Documentation

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.
A Blockchain Application Platform —Lisk Documentation

After the process is started, its runtime status and log location can be retrieved by issuing the following command:
A Blockchain Application Platform —Lisk Documentation

To stop Lisk after it has been started with pm2, issue the following command:
A Blockchain Application Platform —Lisk Documentation

NOTE: The port, address and config-path can be overridden by providing the relevant command switch:
A Blockchain Application Platform —Lisk Documentation

Tests

Preparing Node

  1. Recreate the database in order to run the tests against a new blockchain:

A Blockchain Application Platform —Lisk Documentation

  1. Ensure Lisk is configured to run on the same local network used by the tests. Replace the files config.json and genesisBlock.json with those located under the test/data directory:

>A Blockchain Application Platform —Lisk Documentation

  1. Launch Lisk (runs on port 4000):

A Blockchain Application Platform —Lisk Documentation

Running Tests

Tests are run using the following command:
A Blockchain Application Platform —Lisk Documentation

  • Where tag can be one of slow | unstable | untagged | extensive (required)
  • Where suite can be one of unit | functional | integration (required)
  • Where section can be one of get | post | ws | system (optional)

Individual test files can be run using the following command:
A Blockchain Application Platform —Lisk Documentation

Genesis Account

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

A Blockchain Application Platform —Lisk Documentation

原创文章,作者:每日区块链,如若转载,请注明出处:http://www.dayqkl.com/3345.html

发表评论

登录后才能评论
QR code