Binary

This section details how to work with a Binary installation of Lisk. Listed below are the available basic commands which can be used to manage your Lisk node. For more detail, see each commands reference below. A brief summary of all commands and associated flags has been provided for advanced users.

Command Flags Description
start -p [pm2-config.json] Starts the PostgreSQL database and Lisk Node.
stop -p [pm2-config.json] Stops the PostgreSQL database and Lisk Node.
coldstart -p [pm2-config.json] Initializes the PostgreSQL database and starts Lisk Node.
  -u [url]
  -0
  -f [filename]
rebuild -p [pm2-config.json] Rebuilds the PostgreSQL database and starts Lisk Node.
  -u [url]
  -0
  -f [filename]
reload -p [pm2-config.json] Restarts the Lisk process.
logs Displays the Lisk process logs in real time.
status -p [pm2-config.json] Checks the status of Lisk and displays the current blockheight of the database
start_node -p [pm2-config.json] Starts only the Lisk Node
stop_node -p [pm2-config.json] Stops only the Lisk Node
start_db -p [pm2-config.json] Starts only the PostgreSQL database
stop_db -p [pm2-config.json] Stops only the PostgreSQL database
snapshot -p [pm2-snapshot.json] Starts a second Lisk process and creates a snapshot of the blockchain
help

Command Usage

Coldstart

Initializes the PostgreSQL database and starts Lisk Node.

bash lisk.sh coldstart
Start

To start Lisk and PostgreSQL

bash lisk.sh start
Stop

To stop Lisk and PostgreSQL

bash lisk.sh stop
Reload

To reload Lisk and pick up changes to config.json:

bash lisk.sh reload
Status

To check the status of Lisk

bash lisk.sh status
Logs

To monitor(tail) the log file of Lisk

bash lisk.sh logs
Rebuild

To replace the blockchain with a new snapshot from Lisk Foundation

bash lisk.sh rebuild

To use your own snapshot

bash lisk.sh rebuild -f blockchain.db.gz

To use your a remote hosts snapshot (must be named blockchain.db.gz)

bash lisk.sh rebuild -u https://hostname/

To use a remote host snapshot with a different name issue this command instead

bash lisk.sh rebuild -u https://hostname/ -f filename.db.gz

To rebuild from the genesis block

bash lisk.sh rebuild -0

Advanced Command Reference

Listed below are the available advanced commands which can be used to manage your Lisk node. For more detail, see each commands reference below.

All options may be passed -c
start_node Starts a Nodejs process for Lisk
stop_node Stops a Nodejs process for Lisk
start_db Starts the PostgreSQL database
stop_db Stops the PostgreSQL database
snapshot -s Starts Lisk in snapshot mode
Start node

This command is used to start individual nodejs processes apart from the database. It is designed to be used with customized config.json files in order to manage vertically stacked Lisk processes on one node.

bash lisk.sh start_node -c <config.json>
Stop node

This command is used to stop individual nodejs processes apart from the database. It is designed to be used with customized config.json files in order to manage vertically stacked Lisk processes on one node.

bash lisk.sh stop_node   -c <config.json>
Start database

This command is used to start database instances apart from the Lisk process. It is designed to be used with customized config.json files to target specific instances.

bash lisk.sh start_db   -c <config.json>
Stop database

This command is used to stop all database instances apart from the Lisk process.

bash lisk.sh stop_db
Snapshot

The snapshot command is used to validate a copy of the blockchain from 0 and end gracefully to allow a backup to be taken. This function exists for use with lisk_snapshot.sh, but can be run adhoc as below. In the example, it snapshots to round 100, regardless of how much data exists beyond that round height.

bash lisk.sh snapshot

What's next?
Docker - Management