API

API Access Control

Controlling access to a node plays a vital role in security. The following configurable flags are available controlling node access.

     "api": {
        "enabled": true, // Controls the API's availability. If disabled no API access is possible
        "access": {
            "public": false, // Controls the whitelist. When true all incoming connections are allowed
            "whiteList": ["127.0.0.1"] // This parameter allows connections to the API by IP. Defaults to only allow local host
        },

The recommended setup is to configure a whitelist for only trusted ip addresses, such as your home connection. Use IPV4 addresses only as the whitelist does not support IPV6. That setup would look like this:

     "api": {
        "enabled": true, // Controls the API's availability. If disabled no API access is possible
        "access": {
            "public": false, // Controls the whitelist. When true all incoming connections are allowed
            "whiteList": ["127.0.0.1","192.168.1.1"] // This parameter allows connections to the API by IP. Defaults to only allow local host
        },

To setup a public wallet, configure the section like this:

     "api": {
        "enabled": true, // Controls the API's availability. If disabled no API access is possible
        "access": {
            "public": true, // Controls the whitelist. When true all incoming connections are allowed
            "whiteList": [] // This parameter allows connections to the API by IP. Defaults to only allow local host
        },

For the best security, disable all access.

Note

This might prevent monitoring scripts from functioning.

     "api": {
        "enabled": false, // Controls the API's availability. If disabled no API access is possible
        "access": {
            "public": false, // Controls the whitelist. When true all incoming connections are allowed
            "whiteList": [] // This parameter allows connections to the API by IP. Defaults to only allow local host
        },

At this point, your changes are complete and you can return to Configuration - General document for information on how to start Lisk Node up for your environment.


What's next?
Forging - Configuration