1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 01:43:22 +01:00
7 Run
Bastien Teinturier edited this page 2020-05-05 11:40:08 +02:00

Basic usage

Go to the folder containing the Eclair package, navigate to the bin folder and run the following command:

# Linux, MacOS
eclair-node.sh

# Windows
eclair-node.bat

This will start your node with the basic configuration, its data directory pointing to ~/.eclair. This data directory or datadir is the folder where eclair stores all its data, such as its configuration, your seed, the output logs, the database...

Run with advanced options

For advanced use cases you can change the way the eclair node is started through Java environment variables. Most users won't need this and can skip this section. If you simply want to change your node's internal configuration, please see the Configure page.

Change the data directory

The default data directory is ~/.eclair. You can change this with the eclair.datadir parameter.

eclair-node.sh -Declair.datadir="/path/to/custom/eclair/data/folder"

Print to stdout when running

If you wish to log in the console in addition to eclair.log, add the eclair.printToConsole parameter. In addition, eclair logs are found in the datadir directory, in the eclair.log file.

eclair-node.sh -Declair.printToConsole

Run several instances of Eclair on the same host

If you want to run several instance of eclair on the same machine, you'll have to use a separate datadir for each node. You'll also have to use different ports for each running instance of Eclair.

For example, let's run two nodes (Alice and Bob) on the same host. Start by creating a folder for each node:

mkdir ~/.eclair/alice
mkdir ~/.eclair/bob

Create a configuration file ~/.eclair/alice/eclair.conf for Alice using port 9735:

eclair.node-alias=alice
eclair.server.port=9735

eclair.api.enabled=true
eclair.api.port=9000
eclair.api.password=foo

Create a configuration file ~/.eclair/bob/eclair.conf for Bob using port 9736:

eclair.node-alias=bob
eclair.server.port=9736

eclair.api.enabled=true
eclair.api.port=9001
eclair.api.password=bar

You can now start both nodes on the same host:

eclair-node.sh -Declair.datadir=$HOME/.eclair/alice
eclair-node.sh -Declair.datadir=$HOME/.eclair/bob

Docker

Up-to-date Dockerfile images are available on Docker Hub for a dockerized eclair-node.

Basic usage:

docker run -ti --rm acinq\eclair

You can use the JAVA_OPTS environment variable to set arguments to eclair-node:

$ docker run -ti --rm -e "JAVA_OPTS=-Xmx512m -Declair.api.binding-ip=0.0.0.0 -Declair.node-alias=node-pm -Declair.printToConsole" acinq\eclair

If you want to persist the data directory, you can share a volume on your host with the -v argument:

$ docker run -ti --rm -v "/path_on_host:/data" -e "JAVA_OPTS=..." acinq\eclair