I have successfully setup a C-lightning node on ubuntu using the tutorial. The problem I am having is trying to setup a second node that DOESN'T utilize the same .lightning hidden directory to run which means I can only run 1 node at a time. How do I clone and setup a second c-lightning node on the same machine and run it in it's own hidden directory? I am aware that both nodes need to direct to their own config files located in different paths.
you can run
lightningd --help and get a list of arguments you can use to start
lightning from the output there ist:
--lightning-dir=<dir> Set working directory. All other files are relative to this (default: "/home/user/.lightning")
this means that you can set your own lightning-dir by calling
now you can either put all the config values as additional arguments to your call or you put a config file into
/some/path/to/some/directory/ which sets everything. the default is to call it
config but you can also use the command line argument
lightningd to set a different one in a different location.
One thing you need to remember that both lightning nodes need to run on different tcp/ip ports. you do this by setting the port in your accounce addr in the config file
announce-addr=IP-ADDR:PORT you need to replacei IP-ADDR with your address and the port with the port.
obviously when interacting with each of the nodes you need to tell
lightning-cli which one. again the
--help command helps (:
lightning-cli --help Usage: lightning-cli <command> [<params>...] --lightning-dir=<dir> Set working directory. All other files are relative to this (default: "/home/user/.lightning") ...
this means you can for example do
lightning-cli --lightning-dir=/some/path/to/somedir/ getinfo