It's perfectly possible to run several LND nodes on the same computer.
This is how I did it:
- create separate folders for each LND node
- In each folder create a lnd.conf file
- make sure you set the datadir and the logdir to point to the folders you just created
- make sure that each configuration uses different ports for rpclisten, listen and restlisten
- adjust all other configuration to your liking. You can have multiple clients point to the the same btcd client (that's the one I used, but I'm sure it also would work with bitcoind) and the same chain or different chains
lnd --configfile=path/to/your/lnd.conf for each lnd client you want to run
I've made aliases in
.bashrc for the lnd and lncli commands for each different node.
alias lnd-alice="lnd --configfile=path/to/alice/lnd.conf"
alias lnd-bob="lnd --configfile=path/to/bob/lnd.conf"
alias lncli-alice="lncli --rpcserver=localhost:10001 --macaroonpath=path/to/alice/data/chain/bitcoin/mainnet/admin.macaroon"
alias lncli-bob="lncli --rpcserver=localhost:10002 --macaroonpath=path/to/bob/data/chain/bitcoin/testnet/admin.macaroon"
To run the lnd node for alice I just type
lnd-alice and then
lncli-alice create if it's the first time or
lncli-alice unlock if the wallet is already initialized. (The macaroon path isn't needed for
unlock but it doesn't hurt either.)
Same thing for Bob.
This guide was very helpful in finding the right info: https://dev.lightning.community/tutorial/01-lncli/index.html